[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-72461":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":17,"stars7d":18,"stars30d":19,"stars90d":16,"forks30d":16,"starsTrendScore":20,"compositeScore":21,"rankGlobal":10,"rankLanguage":10,"license":22,"archived":23,"fork":23,"defaultBranch":24,"hasWiki":23,"hasPages":23,"topics":25,"createdAt":10,"pushedAt":10,"updatedAt":26,"readmeContent":27,"aiSummary":28,"trendingCount":16,"starSnapshotCount":16,"syncStatus":29,"lastSyncTime":30,"discoverSource":31},72461,"CodeGeeX4","zai-org\u002FCodeGeeX4","zai-org","CodeGeeX4-ALL-9B, a versatile model for all AI software development scenarios, including code completion, code interpreter, web search, function calling, repository-level Q&A and much more.","https:\u002F\u002Fcodegeex.cn",null,"Python",2531,264,32,117,0,10,19,31,30,91.87,"Apache License 2.0",false,"main",[],"2026-06-12 04:01:05","![](resources\u002Flogo.jpeg)\n\n\u003Cp align=\"center\">\n    🏠 \u003Ca href=\"https:\u002F\u002Fcodegeex.cn\" target=\"_blank\">Homepage\u003C\u002Fa>｜🛠 Extensions \u003Ca href=\"https:\u002F\u002Fmarketplace.visualstudio.com\u002Fitems?itemName=aminer.codegeex\" target=\"_blank\">VS Code\u003C\u002Fa>, \u003Ca href=\"https:\u002F\u002Fplugins.jetbrains.com\u002Fplugin\u002F20587-codegeex\" target=\"_blank\">Jetbrains\u003C\u002Fa>｜🤗 \u003Ca href=\"https:\u002F\u002Fhuggingface.co\u002FTHUDM\u002Fcodegeex4-all-9b\" target=\"_blank\">HF Repo\u003C\u002Fa> | 🪧 \u003Ca href=\"https:\u002F\u002Fhuggingface.co\u002Fspaces\u002FTHUDM\u002FCodeGeeX\" target=\"_blank\">HF DEMO\u003C\u002Fa>\n\u003C\u002Fp>\n\n[English](.\u002FREADME.md) | [中文](.\u002FREADME_zh.md) | [日本語](.\u002FREADME_ja.md)\n\n# CodeGeeX4: Open Multilingual Code Generation Model\n\nWe introduce CodeGeeX4-ALL-9B, the open-source version of the latest CodeGeeX4 model series. It is a multilingual code generation model continually trained on the [GLM-4-9B](https:\u002F\u002Fgithub.com\u002FTHUDM\u002FGLM-4), significantly enhancing its code generation capabilities. Using a single CodeGeeX4-ALL-9B model, it can support comprehensive functions such as code completion and generation, code interpreter, web search, function call, repository-level code Q&A, covering various scenarios of software development. CodeGeeX4-ALL-9B has achieved highly competitive performance  on public benchmarks, such as [BigCodeBench](https:\u002F\u002Fhuggingface.co\u002Fdatasets\u002Fbigcode\u002Fbigcodebench) and [NaturalCodeBench](https:\u002F\u002Fgithub.com\u002FTHUDM\u002FNaturalCodeBench). It is currently the most powerful code generation model with less than 10B parameters, even surpassing much larger general-purpose models, achieving the best balance in terms of inference speed and model performance.\n\n## Model List\n\n| Model             | Type | Seq Length | Download                                                                                                                                                                                                    |\n|-------------------|------|------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| codegeex4-all-9b  | Chat | 128K       | [🤗 Huggingface](https:\u002F\u002Fhuggingface.co\u002FTHUDM\u002Fcodegeex4-all-9b) [🤖 ModelScope](https:\u002F\u002Fmodelscope.cn\u002Fmodels\u002FZhipuAI\u002Fcodegeex4-all-9b) [🟣 WiseModel](https:\u002F\u002Fwisemodel.cn\u002Fmodels\u002FZhipuAI\u002Fcodegeex4-all-9b)    |\n\n## Get Started\n\n### Ollama\nCodeGeeX4 is now available on [Ollama](https:\u002F\u002Follama.com\u002Flibrary\u002Fcodegeex4)!\nPlease install [Ollama 0.2](https:\u002F\u002Fgithub.com\u002Follama\u002Follama\u002Freleases\u002Ftag\u002Fv0.2.0) or later and run the following command:\n```bash\nollama run codegeex4\n```\nTo connect the local model to our [VS Code](https:\u002F\u002Fmarketplace.visualstudio.com\u002Fitems?itemName=aminer.codegeex) \u002F [Jetbrains](https:\u002F\u002Fplugins.jetbrains.com\u002Fplugin\u002F20587-codegeex) extensions, please check [Local Mode Guideline](.\u002Fguides\u002FLocal_mode_guideline.md).\n\n### Huggingface transformers\nUse `4.39.0\u003C=transformers\u003C=4.40.2` to quickly launch [codegeex4-all-9b](https:\u002F\u002Fhuggingface.co\u002FTHUDM\u002Fcodegeex4-all-9b)：\n\n```python\nimport torch\nfrom transformers import AutoTokenizer, AutoModelForCausalLM\n\ndevice = \"cuda\" if torch.cuda.is_available() else \"cpu\"\ntokenizer = AutoTokenizer.from_pretrained(\"THUDM\u002Fcodegeex4-all-9b\", trust_remote_code=True)\nmodel = AutoModelForCausalLM.from_pretrained(\n    \"THUDM\u002Fcodegeex4-all-9b\",\n    torch_dtype=torch.bfloat16,\n    low_cpu_mem_usage=True,\n    trust_remote_code=True\n).to(device).eval()\ninputs = tokenizer.apply_chat_template([{\"role\": \"user\", \"content\": \"write a quick sort\"}], add_generation_prompt=True, tokenize=True, return_tensors=\"pt\", return_dict=True ).to(device)\nwith torch.no_grad():\n    outputs = model.generate(**inputs)\n    outputs = outputs[:, inputs['input_ids'].shape[1]:]\n    print(tokenizer.decode(outputs[0], skip_special_tokens=True))\n```\n\n### vLLM\nUse `vllm==0.5.1` to quickly launch [codegeex4-all-9b](https:\u002F\u002Fhuggingface.co\u002FTHUDM\u002Fcodegeex4-all-9b):\n```\nfrom transformers import AutoTokenizer\nfrom vllm import LLM, SamplingParams\n\n# CodeGeeX4-ALL-9B\n# max_model_len, tp_size = 1048576, 4\n# If OOM，please reduce max_model_len，or increase tp_size\nmax_model_len, tp_size = 131072, 1\nmodel_name = \"codegeex4-all-9b\"\nprompt = [{\"role\": \"user\", \"content\": \"Hello\"}]\n\ntokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=True)\nllm = LLM(\n    model=model_name,\n    tensor_parallel_size=tp_size,\n    max_model_len=max_model_len,\n    trust_remote_code=True,\n    enforce_eager=True,\n    # If OOM，try using follong parameters\n    # enable_chunked_prefill=True,\n    # max_num_batched_tokens=8192\n)\nstop_token_ids = [151329, 151336, 151338]\nsampling_params = SamplingParams(temperature=0.95, max_tokens=1024, stop_token_ids=stop_token_ids)\n\ninputs = tokenizer.apply_chat_template(prompt, tokenize=False, add_generation_prompt=True)\noutputs = llm.generate(prompts=inputs, sampling_params=sampling_params)\n\nprint(outputs[0].outputs[0].text)\n```\nSet up OpenAI Compatible Server via vllm, detailed please check [OpenAI Compatible Server](https:\u002F\u002Fdocs.vllm.ai\u002Fen\u002Flatest\u002Fserving\u002Fopenai_compatible_server.html)\n```\npython -m vllm.entrypoints.openai.api_server \\\n     --model THUDM\u002Fcodegeex4-all-9b \\\n     --trust_remote_code\n```\n\n### Rust-candle\nCodegeex4 now suport Candle framwork [Repo](https:\u002F\u002Fgithub.com\u002Fhuggingface\u002Fcandle\u002Fblob\u002Fmain\u002Fcandle-examples\u002Fexamples\u002Fcodegeex4-9b\u002FREADME.org)\n#### Cli\nUse Rust to launch [codegeex4-all-9b](https:\u002F\u002Fhuggingface.co\u002FTHUDM\u002Fcodegeex4-all-9b):\n``` shell\n\tcd candle_demo\n\tcargo build -p codegeex4-cli --release --features cuda # for Cuda\n\tcargo build -p codegeex4-cli --release # for cpu\n\t.\u002Ftarget\u002Frelease\u002Fcodegeex4-cli --sample-len 512\n```\n\n\n\n## Tutorials\nCodeGeeX4-ALL-9B provides three user guides to help users quickly understand and use the model:\n\n![ALL Fuctions](.\u002Fresources\u002Fall_functions.jpg)\n\n1. **[System Prompt Guideline](.\u002Fguides\u002FSystem_prompt_guideline.md)**: This guide introduces how to use system prompts in CodeGeeX4-ALL-9B, including the VSCode extension official system prompt, customized system prompts, and some tips for maintaining multi-turn dialogue history.\n\n2. **[Infilling Guideline](.\u002Fguides\u002FInfilling_guideline.md)**: This guide explains the VSCode extension official infilling format, covering general infilling, cross-file infilling, and generating a new file in a repository.\n\n3. **[Repository Tasks Guideline](.\u002Fguides\u002FRepository_tasks_guideline.md)**: This guide demonstrates how to use repository tasks in CodeGeeX4-ALL-9B, including QA tasks at the repository level and how to trigger the aicommiter capability of CodeGeeX4-ALL-9B to perform deletions, additions, and changes to files at the repository level.\n\n4. **[Local Mode Guideline](.\u002Fguides\u002FLocal_mode_guideline.md)**：This guide introduces how to deploy CodeGeeX4-ALL-9B locally and connect it to Visual Studio Code \u002F Jetbrains extensions.\n\nThese guides aim to provide a comprehensive understanding and facilitate efficient use of the model.\n\n## Evaluation\n\nCodeGeeX4-ALL-9B is ranked as the most powerful model under 10 billion parameters, even surpassing general models several times its size, achieving the best balance between inference performance and model effectiveness.\n\n| **Model**                   | **Seq Length** | **HumanEval** | **MBPP** | **NCB** | **LCB** | **HumanEvalFIM** | **CRUXEval-O** |\n|-----------------------------|----------------|---------------|----------|---------|---------|------------------|----------------|\n| Llama3-70B-intruct          | 8K             | 77.4          | 82.3     | 37.0    | 27.4    | -                | -              |\n| DeepSeek Coder 33B Instruct | 16K            | 81.1          | 80.4     | 39.3    | 29.3    | 78.2             | 49.9           |\n| Codestral-22B               | 32K            | 81.1          | 78.2     | 46.0    | 35.3    | 91.6             | 51.3           |\n| CodeGeeX4-All-9B            | 128K           | 82.3          | 75.7     | 40.4    | 28.5    | 85.0             | 47.1           |\n\nCodeGeeX4-ALL-9B scored `48.9` and `40.4` for the `complete` and `instruct` tasks of BigCodeBench, which are the highest scores among models with less than 20 billion parameters.\n![BigCodeBench Test Results](.\u002Fmetric\u002Fpics\u002FBigcodebench.png)\nIn CRUXEval, a benchmark for testing code reasoning, understanding, and execution capabilities, CodeGeeX4-ALL-9B presented remarkable results with its COT (chain-of-thought) abilities. From easy code generation tasks in HumanEval and MBPP, to very challenging tasks in NaturalCodeBench, CodeGeeX4-ALL-9B also achieved outstanding performance at its scale. It is currently the only code model that supports Function Call capabilities and even achieves a better execution success rate than GPT-4.\n![Function Call Evaluation](.\u002Fmetric\u002Fpics\u002FFunctionCall.png)\nFurthermore, in the \"Code Needle In A Haystack\" (NIAH) evaluation, the CodeGeeX4-ALL-9B model demonstrated its ability to retrieve code within contexts up to 128K, achieving a 100% retrieval accuracy in all python scripts.\n\u003Cp align=\"center\">\n  \u003Cimg src=.\u002Fmetric\u002Fpics\u002FNIAH_PYTHON.png alt=\"图片1描述\" width=\"45%\">\n  \u003Cimg src=\".\u002Fmetric\u002Fpics\u002FNIAH_ALL.png\" alt=\"图片2描述\" width=\"45%\">\n\u003C\u002Fp>\n\nDetails of the evaluation results can be found in the **[Evaluation](.\u002Fmetric\u002FREADME.md)**.\n\n\n\n## License\n\nThe code in this repository is open source under the [Apache-2.0](https:\u002F\u002Fwww.apache.org\u002Flicenses\u002FLICENSE-2.0) license. The model weights are licensed under the [Model License](MODEL_LICENSE). CodeGeeX4-9B weights are open for academic research. For users who wish to use the models for commercial purposes, please fill in the [registration form](https:\u002F\u002Fbigmodel.cn\u002Fmla\u002Fform?mcode=CodeGeeX4-ALL-9B).\n\n\n## Citation\n\nIf you find our work helpful, please feel free to cite the following paper:\n\n```bibtex\n@inproceedings{zheng2023codegeex,\n  title={CodeGeeX: A Pre-Trained Model for Code Generation with Multilingual Benchmarking on HumanEval-X},\n  author={Qinkai Zheng and Xiao Xia and Xu Zou and Yuxiao Dong and Shan Wang and Yufei Xue and Zihan Wang and Lei Shen and Andi Wang and Yang Li and Teng Su and Zhilin Yang and Jie Tang},\n  booktitle={Proceedings of the 29th ACM SIGKDD Conference on Knowledge Discovery and Data Mining},\n  pages={5673--5684},\n  year={2023}\n}\n```\n","CodeGeeX4-ALL-9B 是一个适用于多种软件开发场景的多功能代码生成模型，包括代码补全、代码解释器、网络搜索、函数调用和仓库级问答等。该项目基于GLM-4-9B持续训练而成，显著提升了其代码生成能力，并且在BigCodeBench和NaturalCodeBench等公开基准测试中表现出色。作为目前参数少于100亿但性能最强大的代码生成模型之一，CodeGeeX4不仅超越了许多规模更大的通用模型，在推理速度与模型性能之间达到了最佳平衡。该模型特别适合需要高效代码生成及辅助开发工具支持的各种编程环境，如通过VS Code或JetBrains插件进行本地部署使用。",2,"2026-06-11 03:42:08","high_star"]