Model reference · open weights

codegeex4-all

LLMs zai-org Text gen 1 build Its own licence terms 10k dl/mo

codegeex4-all is an open-weight language model from zai-org. codegeex4-all-9b (BF16) weighs 18.8 GB; the smallest configuration that runs it is 2× RTX 3060 12 GB.

  • CodeGeeX4-ALL-9B is a 9.4B parameter multilingual code generation model developed by zai-org.
  • It is designed for software development tasks including code completion, generation, and repository-level Q&A, supporting both Chinese and English.
  • The model features a 128K sequence length and is released under a custom license.

Summary of the zai-org/codegeex4-all-9b model card, 2026-10-01

What it is

Released byzai-org
Released2024-07-05
Parameters9.4B
VRAM18.8 GB for the weights

What it runs on

Memory and cards for codegeex4-all-9b (BF16)

18.8 GBweights, file size
41 MBcache per 1K tokens
764 MBruntime overhead, at least
CardRequests at onceContext maxMemory
8K each32K each
RTX 3060 12 GB … RTX 4060 Ti 16 GB
2 smaller cards
———
RTX 3090 24 GB11291K23.4 GB
RTX 4090 24 GB11290K23.4 GB
RTX 5090 32 GB348128K31.0 GB
L40S 48 GB7218128K44.0 GB
A100 80 GB17443128K78.2 GB
H100 80 GB16140128K78.1 GB
RTX PRO 6000 Blackwell 96 GB20852128K93.8 GB
DGX Spark (GB10) 128 GB unified24862128K107 GB
H200 141 GB33984128K138 GB
B200 180 GB451112128K176 GB
2× RTX 3060 12 GB
tensor parallel
8269K11.6 GB a card
2× RTX 4060 Ti 16 GB
tensor parallel
317128K15.4 GB a card
Memory needed at each load
Requests at once8K tokens each32K tokens each
119.9 GB20.9 GB
521.2 GB26.3 GB
822.2 GB30.3 GB
1624.9 GB41.0 GB
3230.3 GB62.5 GB
6441.0 GB105 GB

One card, with vLLM's small-card settings.

From the model card

What zai-org says about codegeex4-all

Read the model card

中文

GitHub

We 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, 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 and NaturalCodeBench. 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.

Get Started

Use 4.39.0<=transformers<=4.40.2 to quickly launch codegeex4-all-9b:

import torch
from transformers import AutoTokenizer, AutoModelForCausalLM

device = "cuda" if torch.cuda.is_available() else "cpu"
tokenizer = AutoTokenizer.from_pretrained("THUDM/codegeex4-all-9b", trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
    "THUDM/codegeex4-all-9b",
    torch_dtype=torch.bfloat16,
    low_cpu_mem_usage=True,
    trust_remote_code=True
).to(device).eval()
inputs = 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)
with torch.no_grad():
    outputs = model.generate(**inputs, max_length=256)
    outputs = outputs[:, inputs['input_ids'].shape[1]:]
    print(tokenizer.decode(outputs[0], skip_special_tokens=True))

If you want to build the chat prompt manually, please make sure it follows the following format:

f"\n{system_prompt}\n\n{prompt}\n\n"

Default system_prompt:

你是一位智能编程助手,你叫CodeGeeX。你会为用户回答关于编程、代码、计算机方面的任何问题,并提供格式规范、可以执行、准确安全的代码,并在必要时提供详细的解释。

The English version:

You are an intelligent programming assistant named CodeGeeX. You will answer any questions users have about programming, coding, and computers, and provide code that is formatted correctly.

For infilling ability, please use (without system prompt):

f"\n{suffix}{prefix}\n"

Additional infos (like file path, programming language, mode) can be added. Example:

###PATH:src/example.py
###LANGUAGE:Python
###MODE:BLOCK

Evaluation

ModelSeq LengthHumanEvalMBPPNCBLCBHumanEvalFIMCRUXEval-O
Llama3-70B-intruct8K77.482.337.027.4--
DeepSeek Coder 33B Instruct16K81.180.439.329.378.249.9
Codestral-22B32K81.178.246.035.391.651.3
CodeGeeX4-All-9B128K82.375.740.428.585.047.1

License

The model weights are licensed under the following License.

Citation

If you find our work helpful, please feel free to cite the following paper:

@inproceedings{zheng2023codegeex,
  title={CodeGeeX: A Pre-Trained Model for Code Generation with Multilingual Benchmarking on HumanEval-X},
  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},
  booktitle={Proceedings of the 29th ACM SIGKDD Conference on Knowledge Discovery and Data Mining},
  pages={5673--5684},
  year={2023}
}

Quoted from the model card on Hugging Face. The full card is behind the Hugging Face link above.

© 2026 AxForge · EU-hosted AI infrastructure Pricing Docs Trust Privacy Terms