GLM-5.2
Zhipu AI's flagship long-horizon coding/agentic MoE model, distributed via Z.ai (glm-5.2, open weights published 2026-06-17): ~1.05M-token context, MIT-licensed weights, $1.40/$4.40 per Mtok, benchmarked by Zhipu against Claude Opus 4.8 and GPT-5.5 on agentic-coding evals.
Last verified 2026-07-12
GLM-5.2 (Hugging Face repo zai-org/GLM-5.2, API model id glm-5.2) is a
Mixture-of-Experts model from Zhipu AI, distributed under the Z.ai brand as
the flagship long-horizon coding/reasoning/agentic model in the GLM-5 family,
succeeding GLM-5.1
(Hugging Face blog, accessed
2026-07-12). The models.dev registry (accessed
2026-07-12) records 2026-06-13 as the release date — the day GLM-5.2 first
became available inside the GLM Coding Plan — while open weights and the
inference-code repository followed on 2026-06-17 per Zhipu's own launch blog
(Hugging Face blog). The
weights are MIT-licensed and the serving code is Apache-2.0
(HF LICENSE;
GitHub LICENSE) — a
genuinely open-weight release by the vendor's own license files, though
models.dev's registry flags it as closed-weight (see Key specs).
Key specs
Values as of 2026-07-12, cross-checked against models.dev and Zhipu/Z.ai's own documentation. Where the two disagree, this page follows the vendor's primary documentation (source hierarchy: vendor docs and license files over a third-party registry) and flags the gap rather than silently picking a number.
| Spec | Value | Source |
|---|---|---|
| Context window | 1,048,576 tokens (~1M), per Z.ai docs and the HF launch blog; models.dev's registry instead lists a round 1,000,000 | Z.ai docs; HF blog; models.dev |
| Max output | 131,072 tokens ("128K") for coding/agent tasks — matches models.dev's registry exactly; the HF blog separately reports 163,840 for reasoning-mode tasks, so the cap is task-mode dependent | Z.ai docs; HF blog; models.dev |
| Total parameters | 753B total per the HF model card and launch blog; the GitHub README instead states 744B total with ~40B active — both are Zhipu-controlled primary channels and disagree with each other, unresolved as of 2026-07-12 | HF model card; GitHub README |
| Modality | Text input, text output only — no vision or audio | Z.ai docs; models.dev |
| License | Open weights, MIT (Hugging Face); inference/serving code, Apache-2.0 (GitHub); models.dev's registry flags the model open_weights: false, contradicting the vendor's own license files |
HF LICENSE; GitHub LICENSE; models.dev |
| Pricing, input | $1.40 / Mtok — matches models.dev exactly | Z.ai pricing docs; models.dev |
| Pricing, output | $4.40 / Mtok — matches models.dev exactly | Z.ai pricing docs; models.dev |
| Pricing, cached input | $0.26 / Mtok; cache storage listed as free "for a limited time" — matches models.dev exactly | Z.ai pricing docs; models.dev |
| Knowledge cutoff | Not stated on any primary Zhipu/Z.ai page found as of 2026-07-12 — an open gap, not a documented spec (see Limitations) | — |
| Release date | GLM Coding Plan access: 2026-06-13 (models.dev registry); open weights on Hugging Face/GitHub: 2026-06-17 (Zhipu launch blog) | models.dev; HF blog |
Pricing and max-output figures cross-validate exactly against models.dev; context window, license classification, and the precise release-date field are the three points where the registry and vendor docs disagree, and this page resolves all three in the vendor's favor.
Architecture combines sparse MoE with DeepSeek-style Sparse Attention (DSA)
and a mechanism Zhipu calls IndexShare, which reuses the same indexer
across every four sparse-attention layers, cutting per-token FLOPs by 2.9x at
1M context length
(HF blog; GitHub README).
Reasoning effort is selectable per request: the GitHub README documents
reasoning_effort as "max" (default) or "high", plus enable_thinking=false
to disable thinking entirely; the Z.ai docs confirm the same toggle under a
"type": "enabled" parameter
(GitHub README; Z.ai docs).
Benchmark results
| Benchmark | GLM-5.2 | Comparison | Source | As of |
|---|---|---|---|---|
| SWE-bench Verified (Vals AI harness, independent) | 82.8% | GPT-5.6 Sol 96.2%, Claude Fable 5 95.0%, Claude Opus 4.8 88.6%, Grok 4.5 86.6%, GPT-5.5 82.6% — same leaderboard | Vals AI | 2026-07-12 |
| SWE-bench Pro (Zhipu self-reported) | 62.1% | GLM-5.1 58.4% — according to Zhipu | HF model card | 2026-06-17 |
| Terminal-Bench 2.1 (Zhipu self-reported) | 81.0% on the Terminus-2 harness / 82.7% best-reported — two measurement conditions in the same HF model card, not a cross-artifact disagreement (the GitHub README's Terminal-Bench figure is the 81.0 Terminus-2 number) | GLM-5.1 63.5%, Claude Opus 4.8 85.0% (both on the Terminus-2 harness) — according to Zhipu | HF model card; GitHub README | 2026-06-17 |
| FrontierSWE | 74.4% | Claude Opus 4.8 75.1% — according to Zhipu | HF blog | 2026-06-17 |
| SWE-Marathon | 13.0% | Claude Opus 4.8 26.0% — according to Zhipu | HF blog | 2026-06-17 |
| GPQA-Diamond | 91.2% | GLM-5.1 86.2%, Claude Opus 4.8 93.6% — according to Zhipu | HF model card | 2026-06-17 |
| AIME 2026 | 99.2% | GLM-5.1 95.3%, Claude Opus 4.8 95.7% — according to Zhipu | HF model card | 2026-06-17 |
| Humanity's Last Exam | 40.5% | GLM-5.1 31%, Claude Opus 4.8 49.8% (asterisked in Zhipu's source, caveat unspecified) — according to Zhipu | HF model card | 2026-06-17 |
| MCP-Atlas (agentic tool use) | 76.8% | GLM-5.1 71.8%, Claude Opus 4.8 77.8% — according to Zhipu (GLM-5.2 trails Opus by 1.0 pt) | HF model card | 2026-06-17 |
| Tool-Decathlon (agentic tool use) | 48.2% | GLM-5.1 40.7%, Claude Opus 4.8 59.9% — according to Zhipu (GLM-5.2 trails Opus by 11.7 pt) | HF model card | 2026-06-17 |
Full leaderboard: Vals AI — SWE-bench Verified leaderboard, as of 2026-07-12.
Reading notes for practitioners:
- On the one independent benchmark on this page, GLM-5.2 is a near-exact tie with GPT-5.5 — 82.8% vs 82.6% on Vals AI's SWE-bench Verified run — not with the other open-weight lab models in the same table: Kimi K2.7-Code (78.2%) and Kimi K2.6 (76.2%) both trail by several points (Vals AI, accessed 2026-07-12).
- Zhipu's Terminal-Bench 2.1 comparison numbers for other vendors' models don't match those vendors' own reporting. Zhipu's table credits Claude Opus 4.8 with 85.0% — above both Anthropic's own self-reported 74.6% (Anthropic announcement) and the independent Terminus-2/Claude-Code leaderboard's 78.9% best run (tbench.ai leaderboard). The same table's GLM-5.1 figure (63.5%) is likewise above that leaderboard's measured 58.7% for GLM-5.1. Treat every comparison-model score in Zhipu's Terminal-Bench table as Zhipu's own reproduction rather than that vendor's reported number, and extend the same caution to GLM-5.2's own 81.0–82.7% entry, which comes from the identical self-reported methodology.
- SWE-bench Verified and SWE-bench Pro are distinct benchmarks; the 82.8% and 62.1% rows above are not comparable to each other.
- The largest documented gap to Claude Opus 4.8 is on SWE-Marathon (13.0 vs 26.0, roughly half, by Zhipu's own reproduction) — the long-horizon agentic tasks this benchmark targets are exactly the profile GLM-5.2's 1M context and IndexShare efficiency work are aimed at, so this is the benchmark row most worth re-checking independently before relying on GLM-5.2 for that workload class.
Agentic behavior notes
- OpenAI/Anthropic-compatible API surface. GLM-5.2 supports streaming, function calling, structured/JSON output, context caching, and MCP tool integration, which is how third-party guides document wiring it into Claude Code and other harnesses as a swap-in backend via base-URL override — the endpoint/feature list itself is primary, but the specific "point Claude Code at it" setup steps come only from secondary how-to guides, not a Zhipu-published configuration (Z.ai docs, accessed 2026-07-12).
- Zhipu shipped its own agent harness, ZCode, around the GLM-5.2 release for autonomous coding-agent loops, with launch promotions to drive adoption — reported by a technology-desk outlet, not found on a primary Zhipu page in this pass (South China Morning Post, accessed 2026-07-12). See agent-harness for the general pattern.
- Self-hosting is a documented option, not just a license technicality. MIT-licensed weights plus multi-framework inference support (Transformers, vLLM, SGLang, xLLM, KTransformers, Unsloth, Ascend NPU) mean the model can run outside Zhipu's hosted API (GitHub README, accessed 2026-07-12).
- Cached input is priced separately at $0.26/Mtok against $1.40/Mtok base input — a lever for agent loops that re-send large system prompts or tool schemas on every turn (Z.ai pricing docs, accessed 2026-07-12).
- Zhipu's launch materials describe a two-stage anti-reward-hacking mechanism used during training (a rule-based filter plus an LLM judge) aimed at preventing benchmark/eval gaming (HF blog, accessed 2026-07-12) — a training-time claim, not an independently audited outcome.
Limitations
- Internal inconsistency in Zhipu's own primary artifacts. The total parameter count differs between two Zhipu-controlled channels — 753B per the Hugging Face model card/blog vs 744B (with ~40B active) per the GitHub README — a genuine gap in the vendor's own materials rather than an aggregator error (HF model card; GitHub README). The Terminal-Bench 81.0/82.7 spread is not such an inconsistency: both figures appear in the HF model card as two measurement conditions (Terminus-2 harness vs best-reported), and the GitHub README's Terminal-Bench number matches the 81.0 Terminus-2 figure.
- No independent verification for most benchmark claims, and Zhipu's own comparison numbers for other vendors run high. Every score in the table above except SWE-bench Verified is Zhipu self-reported. Where an independent check exists — the Terminal-Bench 2.1 leaderboard — Zhipu's own comparison table overstates both Claude Opus 4.8's score (85.0% vs a measured 78.9%) and GLM-5.1's own prior score (63.5% vs a measured 58.7%) (tbench.ai leaderboard, accessed 2026-07-12), which is reason to treat GLM-5.2's self-reported scores as an upper bound rather than a settled number.
- Trails Claude Opus 4.8 on several long-horizon/agentic tasks, by Zhipu's own comparison: SWE-Marathon (13.0 vs 26.0) and, on the Terminal-Bench methodology issue above notwithstanding, FrontierSWE (74.4 vs 75.1) — the gap narrows or closes on some non-agentic reasoning benchmarks (GPQA-Diamond, AIME 2026) but widens specifically on long-horizon coding/agent execution.
- Knowledge cutoff is undisclosed. No primary Zhipu/Z.ai page reviewed for this page states a training-data cutoff date; treat any specific date circulating elsewhere as unverified and do not rely on it for recency-sensitive tasks.
- Text-only modality. No documented vision or audio input/output, unlike several frontier competitors (Z.ai docs, accessed 2026-07-12).
- Dual-use commentary. Analysts have flagged that an unrestricted open-weight license lets GLM-5.2 be built into both defensive and offensive security tooling (large-scale automated code/vulnerability scanning), a framing raised in opinion/analysis coverage rather than a Zhipu-documented constraint (The AI Chronicle, accessed 2026-07-12).
Related
- Claude Opus 4.8 — Zhipu's own comparison table benchmarks GLM-5.2 directly against this model throughout the launch materials, though see the Terminal-Bench cross-check above before trusting those specific numbers.
- GPT-5.5 — GLM-5.2's closest peer on the one independently measured benchmark on this page (SWE-bench Verified, 82.8% vs 82.6%).
- Kimi K2.6 and Kimi K2.7-Code — the other prominent open-weight lab models on the same SWE-bench Verified leaderboard, both trailing GLM-5.2 by several points as of 2026-07-12.
- Context compaction — relevant to how a 1M-context, long-horizon coding model like GLM-5.2 is actually used across extended agent sessions rather than one-shot calls.
Sources
- zai-org/GLM-5.2 — Hugging Face model cardaccessed 2026-07-12
- GLM-5.2: Built for Long-Horizon Tasks — Hugging Face blog (zai-org)accessed 2026-07-12
- GLM-5.2 overview — Z.ai developer docsaccessed 2026-07-12
- Pricing overview — Z.ai developer docsaccessed 2026-07-12
- zai-org/GLM-5 — GitHub READMEaccessed 2026-07-12
- zai-org/GLM-5 LICENSE — GitHub (Apache-2.0)accessed 2026-07-12
- zai-org/GLM-5.2 LICENSE — Hugging Face (MIT)accessed 2026-07-12
- models.dev — model registry APIaccessed 2026-07-12
- Vals AI — SWE-bench Verified leaderboardaccessed 2026-07-12
- Terminal-Bench 2.1 leaderboard (tbench.ai)accessed 2026-07-12
- Introducing Claude Opus 4.8 — Anthropic announcementaccessed 2026-07-12
- Zhipu AI releases harness for GLM-5.2 model as Chinese firm takes aim at Anthropic — South China Morning Postaccessed 2026-07-12
- Zhipu AI GLM-5.2: China Challenges Western Cybersecurity — The AI Chronicleaccessed 2026-07-12
- Chinese AI steps onto global stage as GLM-5.2 narrows frontier gap — CGTNaccessed 2026-07-12
Verification
7 log entries
| date | action | result |
|---|---|---|
| 2026-07-12 | research | applied |
| 2026-07-12 | draft | applied |
| 2026-07-12 | fact-check | fail-0-3 |
| 2026-07-12 | draft | applied |
| 2026-07-12 | fact-check | fail-0-3 |
| 2026-07-12 | correction | applied |
| 2026-07-12 | fact-check | pass-3-0 |