{"id":16352708,"url":"https://github.com/cswellessun/camel","last_synced_at":"2026-01-26T03:32:02.059Z","repository":{"id":240499857,"uuid":"800336274","full_name":"CSWellesSun/CAMEL","owner":"CSWellesSun","description":"CAMEL: Context-Aware Modifier for Efficient Language model","archived":false,"fork":false,"pushed_at":"2024-06-05T04:21:32.000Z","size":229,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-16T23:20:23.128Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CSWellesSun.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-05-14T06:26:45.000Z","updated_at":"2024-06-06T09:22:33.000Z","dependencies_parsed_at":"2024-05-19T11:24:20.569Z","dependency_job_id":"7ec22565-dcbd-44b4-8e05-85b92ace283b","html_url":"https://github.com/CSWellesSun/CAMEL","commit_stats":null,"previous_names":["cswellessun/camel"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/CSWellesSun/CAMEL","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CSWellesSun%2FCAMEL","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CSWellesSun%2FCAMEL/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CSWellesSun%2FCAMEL/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CSWellesSun%2FCAMEL/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CSWellesSun","download_url":"https://codeload.github.com/CSWellesSun/CAMEL/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CSWellesSun%2FCAMEL/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28765906,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-26T03:19:35.311Z","status":"ssl_error","status_checked_at":"2026-01-26T03:19:13.815Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-11T01:27:16.164Z","updated_at":"2026-01-26T03:32:02.044Z","avatar_url":"https://github.com/CSWellesSun.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CAMEL\n\n## Introduction\n\nCAMEL(Context-Aware Modifier for Efficient Language model) is a speculative decoding method inspired by [EAGLE](https://github.com/SafeAILab/EAGLE). It compresses former input hidden states according to window size and then make speculations.\n\n\u003cdiv align=\"center\"\u003e\n    \u003cimg src=\"docs/arch.png\" alt=\"architecture\" width=\"300\"\u003e\n\u003c/div\u003e\n\n## Installation\n\n```bash\npip install modifier\n```\n\n## Quick Start\n\nCAMEL only supports `meta-llama/Llama-2-7b-chat-hf` currently.\n\n```python\nimport torch\nfrom camel import CamelModel\n\nprompt = \"What is artificial intelligence?\"\nmodel = CamelModel.from_pretrained(\n    base_model_path=\"meta-llama/Llama-2-7b-chat-hf\",\n    modifier_path=\"0xWe11es/camel-llama2-h1024-w1\",\n    torch_dtype=torch.float16,\n    device_map=\"auto\"\n)\ntokenizer = model.get_tokenizer()\ninput_ids = tokenizer(prompt).input_ids\noutput_ids = model.generate(input_ids)\noutput = tokenizer.decode(output_ids)\nprint(output)\n```\n\nCAMEL has the following modifier based on Llama2 (`h` stands for hidden size, `w` stands for window size):\n\n- [0xWe11es/camel-llama2-h256-w1](https://huggingface.co/0xWe11es/camel-llama2-h256-w1)\n- [0xWe11es/camel-llama2-h256-w4](https://huggingface.co/0xWe11es/camel-llama2-h256-w4)\n- [0xWe11es/camel-llama2-h256-w16](https://huggingface.co/0xWe11es/camel-llama2-h256-w16)\n- [0xWe11es/camel-llama2-h256-w64](https://huggingface.co/0xWe11es/camel-llama2-h256-w64)\n- [0xWe11es/camel-llama2-h1024-w1](https://huggingface.co/0xWe11es/camel-llama2-h1024-w1)\n- [0xWe11es/camel-llama2-h1024-w4](https://huggingface.co/0xWe11es/camel-llama2-h1024-w4)\n- [0xWe11es/camel-llama2-h1024-w16](https://huggingface.co/0xWe11es/camel-llama2-h1024-w16)\n- [0xWe11es/camel-llama2-h1024-w64](https://huggingface.co/0xWe11es/camel-llama2-h1024-w64)\n\n## Performance\n\nWe test modifier `0xWe11es/camel-llama2-h1024-w4` on several datasets, and get the following results compared to vanilla model (hf version).\n\n| Dataset  | Model       | Temperature | Speed(Token/s) | Speedup |\n|----------|-------------|-------------|----------------|---------|\n| MT-Bench | LlaMa2 7B   | 0.0         | 71.85          | 1.92x   |\n| MT-Bench | LlaMa2 7B   | 1.0         | 57.54          | 1.62x   |\n| GSM8K    | LlaMa2 7B   | 0.0         | 73.51          | 2.20x   |\n| GSM8K    | LlaMa2 7B   | 1.0         | 57.15          | 1.77x   |\n| Alpaca   | LlaMa2 7B   | 0.0         | 68.92          | 1.88x   |\n| Alpaca   | LlaMa2 7B   | 1.0         | 55.38          | 1.56x   |\n\n## Reference\n\n- [Medusa](https://github.com/FasterDecoding/Medusa)\n\n- [EAGLE](https://github.com/SafeAILab/EAGLE)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcswellessun%2Fcamel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcswellessun%2Fcamel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcswellessun%2Fcamel/lists"}