Instructions to use zai-org/GLM-5.2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use zai-org/GLM-5.2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="zai-org/GLM-5.2") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("zai-org/GLM-5.2") model = AutoModelForCausalLM.from_pretrained("zai-org/GLM-5.2") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Inference
- HuggingChat
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use zai-org/GLM-5.2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "zai-org/GLM-5.2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "zai-org/GLM-5.2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/zai-org/GLM-5.2
- SGLang
How to use zai-org/GLM-5.2 with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "zai-org/GLM-5.2" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "zai-org/GLM-5.2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "zai-org/GLM-5.2" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "zai-org/GLM-5.2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use zai-org/GLM-5.2 with Docker Model Runner:
docker model run hf.co/zai-org/GLM-5.2
zRzRzRzRzRzRzR commited on
Commit ·
f226310
1
Parent(s): e32aaf0
add Footnote
Browse files
README.md
CHANGED
|
@@ -75,6 +75,21 @@ GLM-5.2 supports deployment with the following frameworks. Feel free to try them
|
|
| 75 |
- [Unsloth](https://github.com/unslothai/unsloth) (v0.1.47-beta+) — see [guide](https://unsloth.ai/docs/models/glm-5.2)
|
| 76 |
- For deployment on the `Ascend NPU` platform, inference frameworks such as vLLM-Ascend, xLLM and SGLang are supported — see [here](github.com/zai-org/GLM-5/blob/main/example/ascend.md).
|
| 77 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 78 |
## Citation
|
| 79 |
|
| 80 |
If you find GLM-5.2 useful in your research, please cite our technical report:
|
|
|
|
| 75 |
- [Unsloth](https://github.com/unslothai/unsloth) (v0.1.47-beta+) — see [guide](https://unsloth.ai/docs/models/glm-5.2)
|
| 76 |
- For deployment on the `Ascend NPU` platform, inference frameworks such as vLLM-Ascend, xLLM and SGLang are supported — see [here](github.com/zai-org/GLM-5/blob/main/example/ascend.md).
|
| 77 |
|
| 78 |
+
## Footnote
|
| 79 |
+
|
| 80 |
+
* **Humanity’s Last Exam (HLE) & other reasoning tasks**: We use sampling parameters of `temperature=1.0`, `top_p=0.95` for evaluation. We evaluate with a maximum generation length of `163,840` tokens. By default, we report the text-only subset; results marked with * are from the full set. For AIME, HMMT and IMOAnswerBench, we evaluate each question using the following system prompt: `Your response should be in the following format:\nExplanation: {your explanation for your final answer}\nExact Answer: {your succinct, final answer}\nConfidence: {your confidence score between 0% and 100% for your answer}.` We use GPT-5.5 (medium) as the judge model. For HLE-with-tools, we use a maximum context length of 300,000 tokens, with no context management strategy.
|
| 81 |
+
* **SWE-Bench Pro**: We run the SWE-Bench Pro suite with OpenHands using a tailored instruction prompt. Settings: `temperature=1`, `top_p=1`, `max_new_tokens=32k`, with a 400K context window.
|
| 82 |
+
* **NL2Repo**: We evaluated NL2Repo with `temperature=1.0`, `top_p=1.0`, and `max_new_tokens=48k` under 400k context. To prevent hacking, we use rule-based and a LLM-based judgement to prevent malicious behaviors (e.g., unauthorized pip or curl operations).
|
| 83 |
+
* **DeepSWE**: We run DeepSWE with the official pier evaluation framework and the mini-swe-agent harness (`temperature=1.0`, `top_p=1.0`, `timeout=2h`, 400K context). Each task is solved in an isolated container with 2 CPUs, 8 GB RAM, and no internet access.
|
| 84 |
+
* **ProgramBench**: We evaluate ProgramBench (200 instances) with Claude-Code 2.1.156 using `temperature=1.0, top_p=1.0, max_tokens=64000, max_turns=2000, sample_timeout=6h, reasoning_effort=max`, with a 400K context window. Each instance runs in a (4 CPUs, 8 GB RAM) sandbox with internet access disabled.
|
| 85 |
+
* **Terminal-Bench 2.1 (Terminus 2)**: We evaluate Terminal-Bench 2.1 with Terminus-2 framework using `parser=json`, `timeout=4h`, `temperature=1.0`, `top_p=1.0`, `max_new_tokens=48k`, `max_episodes=500`, with a 256K context window. Resource limits are capped at 4 CPUs and 8 GB RAM.
|
| 86 |
+
* **Terminal-Bench 2.1 (Claude Code)**: We evaluate in Claude Code 2.1.167 with `temperature=1.0, top_p=0.95, max_new_tokens=131072`. We override max_new_tokens to 128k via a transparent proxy, bypassing the 64k CLI cap to restore the configurability of `CLAUDE_CODE_MAX_OUTPUT_TOKENS`. We remove wall-clock time limits, while preserving per-task CPU and memory constraints. Scores are averaged over 5 runs.
|
| 87 |
+
* **MCP-Atlas**: All models were evaluated in think mode on the 500-task public subset with a 10-minute timeout per task. We use Gemini-3.0-Pro as the judge model for evaluation.
|
| 88 |
+
* **Tool-Decathlon**: We use the official evaluation service and set max_token to 128K.
|
| 89 |
+
* **FrontierSWE**: The evaluation was conducted by [Proximal](https://www.proximal.ai) with 1M context length, max effort level, and 128K maximum output tokens. Dominance score reported as of 2026/06/16.
|
| 90 |
+
* **PostTrainBench**: The evaluation was conducted by [PostTrainBench](https://posttrainbench.com) with 1M context length, max effort level, and 128K maximum output tokens.
|
| 91 |
+
* **SWE-Marathon**: The evaluation was conducted by [Abundant AI](https://www.abundant.ai) with 1M context length, max effort level, and 128K maximum output tokens.
|
| 92 |
+
|
| 93 |
## Citation
|
| 94 |
|
| 95 |
If you find GLM-5.2 useful in your research, please cite our technical report:
|