GLM-5.2

Models & AI Labs ⚖️ Apache-2.0 🟢 Actively maintained
7.1k stars

GLM-5.2 is a large language model from the GLM-5 series, designed for long-horizon agentic tasks and complex coding. It features a solid 1M-token context and improved architecture for efficiency. It is intended for developers and researchers working on advanced AI applications.

✨ Key features

  • Solid 1M-token context for long-horizon tasks
  • Advanced coding with flexible reasoning effort levels
  • IndexShare architecture reduces per-token FLOPs by 2.9x
  • Improved MTP layer increases speculative decoding acceptance length
  • Strongest open-source model on standard coding benchmarks
  • Available in BF16 and FP8 precision variants

🎯 Use cases

  • Complex software engineering and code generation
  • Long-horizon agentic tasks requiring sustained reasoning
  • Handling very long documents or contexts up to 1M tokens
  • Deploying as a high-performance coding assistant

📦 Installation

🧰 Requirements: Requires a compatible inference framework (e.g., SGLang, vLLM, Transformers) and sufficient GPU resources for a 744B-parameter model.

To use GLM-5.2, download the model from Hugging Face or ModelScope. For local serving, use a supported framework like SGLang or vLLM. Refer to the respective framework's documentation for installation and usage. Example download:

# Using Hugging Face CLI
huggingface-cli download zai-org/GLM-5.2

🚀 Usage

Example using Transformers:

from transformers import AutoModelForCausalLM, AutoTokenizer

model_name = "zai-org/GLM-5.2"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(model_name, device_map="auto")

prompt = "Write a Python function to compute Fibonacci numbers."
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=100)
print(tokenizer.decode(outputs[0]))

⚠️ Good to know

GLM-5.2 is a large model requiring significant computational resources; it may not be suitable for low-resource environments.

❓ FAQ

What is the context length of GLM-5.2?

GLM-5.2 supports a solid 1M-token context.

What reasoning_effort values does GLM-5.2 accept?

GLM-5.2 accepts only 'high' and 'max' for reasoning_effort, with 'max' as the default.

How does GLM-5.2 compare to GLM-5.1 on coding benchmarks?

GLM-5.2 significantly improves over GLM-5.1, e.g., 81.0 vs 62.0 on Terminal-Bench 2.1.

What is the model size of GLM-5.2?

GLM-5.2 has 744B total parameters with 40B active.

📊 Repository

Stars★ 7,146
Forks🍴 935
Open issues🐛 34
Last commit🕒 Sep 1, 2026
Created📅 Feb 2026
License⚖️ Apache-2.0

🤖 Overview, features, install steps and FAQ were generated from the project's README on Sep 4, 2026. Always check the original source before running commands.