MLog
Back to posts
Tech#GLM-5.2#开源模型#AI开发工具#LLM

GLM-5.2: The First Open-Weights Model to Beat GPT-5 on Coding Benchmarks

Published: Jul 22, 2026Reading time: 5 min

Z.ai's GLM-5.2 — 753B parameters, MIT license, 1M-token context — becomes the first open-weights model to surpass GPT-5.5 on coding benchmarks, at roughly one-sixth the API cost. A milestone for open-source AI.

On June 17, 2026, Z.ai (formerly Zhipu AI) released GLM-5.2. This wasn't just another version bump — it became the first open-weights model in history to beat GPT-5 on agentic coding benchmarks.

The Short Version

753 billion parameters. MIT license. 1 million token context window. Purpose-built for long-horizon coding agents. It beats GPT-5.5 across SWE-bench Pro, FrontierSWE, and MCP-Atlas, sits just behind Claude Opus 4.8, and costs roughly one-sixth as much to run.

The Benchmark Picture

Here are the vendor-reported numbers (higher is better):

Benchmark GLM-5.2 GPT-5.5 Opus 4.8
SWE-bench Pro 62.1 58.6 69.2
FrontierSWE 74.4 72.6 75.1
MCP-Atlas (tool use) 76.8 75.3 77.8
Terminal-Bench 2.1 81.0 84.0 85.0
SWE-Marathon (long-horizon) 13.0 12.0 26.0

The story these numbers tell is clear. In the agentic coding sweet spot — typical feature work and bug fixes — GLM-5.2 cleanly surpasses GPT-5.5 and runs neck-and-neck with Opus 4.8. But SWE-Marathon, the brutal multi-hour, many-step gauntlet, exposes the gap: Opus roughly doubles both GLM-5.2 and GPT-5.5.

The honest takeaway: if your workload is standard agent loops, GLM-5.2 is right there at the frontier. If it's grueling day-long refactors, the closed frontier still earns its price. And these are Z.ai's own numbers — trust the shape, treat the last decimal as marketing.

Built for Sustained Work, Not One-Shot Answers

GLM-5.2's architectural choices signal a clear intent: it wasn't built to produce a single clever response — it was built to keep an agent coherent across hours of coding.

IndexShare Attention: Z.ai introduced a novel attention scheme that cuts per-token compute by roughly 2.9x at the full 1M-token context. Combined with speculative decoding improvements, this means an agent can read the codebase, edit multiple files, run terminal commands, and iterate across a long session without the model grinding to a crawl.

MIT License: This might be the most important line in the entire release. Not "open weights for research only." Not "commercial use requires a separate agreement." Just MIT — download, modify, commercialize, redistribute, no strings attached. At the 753B scale, this is virtually unprecedented.

ZCode: The Free Official Harness

On July 2, Z.ai made ZCode — its official agent-first development environment — free to download (version 3.2.2, macOS / Windows / Linux beta). You describe a goal, and the agent reads the codebase, plans, edits files, runs terminal commands, and iterates. It accepts any API key speaking the OpenAI or Anthropic protocols, so you can drive it with Claude, DeepSeek, or whatever model you prefer.

The free tier includes a five-day full GLM-5.2 trial. Paid plans range from $16.20/month (Light) to $144/month (Max). The barrier to entry for trying a near-frontier coding agent has dropped to zero.

The Cost: One-Sixth Is Not a Gimmick

Model Input (per 1M tokens) Output (per 1M tokens)
GLM-5.2 ~$1.40 ~$4.40
GPT-5.5 ~$5.00 ~$30.00
Opus 4.8 ~$5.00 ~$25.00

Agentic coding is a token-heavy workload — an hour-long agent session can burn millions of tokens. At that scale, the cost difference isn't "a bit cheaper." It's a decisive architectural choice. Running a model that delivers roughly 90% of the frontier at one-sixth the price isn't a compromise — it's a strategy.

The Real-World Catch: Data Residency

Here's what the benchmark charts won't tell you. Z.ai's production API is hosted in China, which means every call through the hosted endpoint is subject to Chinese law, including national-intelligence provisions that can compel the provider to cooperate with government requests.

For hobby projects and non-sensitive commercial work, this is a non-issue. For regulated industries — finance, healthcare, legal, government — this data-residency reality can rule out the hosted API on its own.

This is precisely where open weights earn their keep. Because GLM-5.2 is MIT-licensed, a team with strict compliance requirements can download it and run it on their own infrastructure. The code never leaves the building. That's a categorical advantage no closed API model can offer at any price.

The tradeoff: self-hosting a 753B model is not a laptop project.

The Lightweight Option: GLM-5.2 Air

If 753B is too heavy, Z.ai also shipped an Air variant: 106B total parameters with 12B active (MoE architecture). At 4-bit quantization it fits in roughly 60GB of VRAM — right on the edge of a 64GB Mac. Its SWE-bench Pro score is 58%, which, remarkably, still beats GPT-5.5 on the same metric. A year ago, the idea of a locally-runnable model clearing the GPT-5 bar would have been unthinkable.

The Open-Source Coding Landscape Has Shifted

GLM-5.2 didn't arrive alone. July 2026 saw a cascade of open releases: Qwen 4.1 (32B-A3B, 80% SWE-Verified on a 24GB Mac), DeepSeek R3 (95% on AIME), Llama 5 405B, and more. Open models are no longer playing catch-up in coding — they're challenging and sometimes beating the closed frontier on key benchmarks.

For developers, this is a rare moment. Top-tier coding capability is no longer an auction of monthly API bills. It's a tool you can download, run on your own terms, and build into your infrastructure without asking permission. The MIT license turns this from a technical breakthrough into industrial infrastructure.