What Is GLM 5.2? Zhipu's 1M-Context Open Model
GLM 5.2 is Zhipu/Z.ai's open-weight flagship: a one-million-token context window, top-tier open coding, MIT-licensed weights. What it is and how to run it.
GLM 5.2 is the latest open-weight large language model from Zhipu AI, released through its Z.ai platform in June 2026. Its headline feature is a one-million-token context window — a big jump from the 200K of the previous GLM-5.1 — paired with some of the strongest coding and agentic performance available in an openly licensed model. For developers tracking how open-weight models are closing the gap with closed frontier labs, GLM 5.2 is a landmark release.
The GLM-5 lineage
GLM 5.2 is an incremental but significant step in the GLM-5 line:
- GLM-5 launched in early 2026 as Zhipu’s frontier model — a large Mixture-of-Experts (MoE) design with roughly 744 billion total parameters and around 40 billion active per token, more than double the scale of GLM-4.5.
- GLM-5.1 refined it and offered a 200K-token context.
- GLM 5.2 extends the context window to a full 1 million tokens and pushes coding and agentic benchmarks higher still.
A few technical details make GLM-5 notable beyond raw size. It uses an efficient sparse-attention mechanism to handle long context affordably, and — unusually for a frontier model — it was reportedly trained entirely on Huawei Ascend accelerators rather than NVIDIA hardware, a meaningful data point about the diversification of the AI hardware supply chain.
From GLM-130B to Z.ai: a decade in the making
GLM did not appear from nowhere. Zhipu AI spun out of Tsinghua University’s Knowledge Engineering Group in 2019, and “GLM” — General Language Model — began as a pretraining method the lab published in 2021. Its open-release habit started early:
- GLM-130B (2022) was one of the first openly available bilingual models at the 100-billion-parameter scale, at a time when models that size were otherwise locked inside big labs.
- ChatGLM-6B (2023) became one of the most downloaded open chat models in the world, small enough to run on a single consumer GPU and hugely popular with hobbyists and Chinese enterprises alike.
- GLM-4 (2024) and GLM-4.5 (2025) moved the line to frontier-adjacent capability, adding tool use, multimodality, and agentic training.
That history matters because it explains the GLM-5 strategy. Zhipu has consistently treated open weights as its route to adoption — publish capable models, build a developer base, and monetize hosted inference and enterprise deployments on top. GLM 5.2 is that playbook executed at frontier scale.
Inside the architecture: MoE and sparse attention
GLM-5 is a Mixture-of-Experts model: instead of running every input through all 744 billion parameters, a router activates a small subset of specialized “expert” sub-networks — around 40 billion parameters — for each token. You get the knowledge capacity of a very large model with the inference cost of a much smaller one. Nearly every frontier-scale open model now uses this design, because it is the only economical way to serve models this large.
The second trick is sparse attention. Standard attention cost grows quadratically with input length, which is what historically kept context windows short. GLM-5’s sparse-attention mechanism prunes that computation so a million-token prompt remains affordable to process. The two techniques are complementary: MoE cuts the cost per token, sparse attention cuts the cost of many tokens.
What a million tokens of context buys you
A million tokens is roughly 750,000 words — several long novels, or a mid-sized codebase, in a single prompt. In practice that changes how you work with the model:
- Whole-repository coding. The model can hold your entire project in view while it edits, instead of seeing files through a keyhole.
- Document-set analysis. Contracts, filings, research corpora, and log archives fit in one conversation without chunking.
- Long agent sessions. An autonomous agent can carry hours of tool outputs and intermediate reasoning without forgetting its earlier steps.
Two honest caveats. First, advertised context and effective context are not the same thing — models generally recall the start and end of a long prompt better than the middle, so test on your own workload. Second, long context complements rather than replaces retrieval-augmented generation: stuffing a million tokens into every request costs real money, and retrieval is still the cheaper way to give a model access to data it only occasionally needs.
What it’s good at
GLM 5.2 is positioned squarely at coding and agentic engineering — writing, debugging, and modifying code, and operating as the engine for autonomous agents. On standard software-engineering benchmarks like SWE-bench Verified, the GLM-5 family scores in the same neighborhood as leading proprietary models, which is striking for an openly licensed release. The million-token context is especially valuable for code: it can hold an entire repository in view at once.
Open weights and low cost
Two things make GLM 5.2 stand out commercially:
- Open weights under MIT. You can download, run, fine-tune, and self-host it — no vendor lock-in. That’s a sharp contrast with closed models like Claude Fable 5, which you can only access through an API.
- Low price. Accessed through marketplaces like OpenRouter, GLM-5-class models cost a small fraction of comparable proprietary models per token — a difference large enough to change which projects are economically viable.
Where it sits in the open-model landscape
GLM 5.2 arrives in the middle of a remarkably strong open-weight cohort, most of it Chinese. DeepSeek proved in early 2025 that open releases could match closed frontier models at far lower training cost; Alibaba’s Qwen line became the default base model for fine-tuners; and Moonshot’s Kimi K2 family competes directly with GLM on agentic coding. Meta’s Llama series remains the best-known Western open line, but the frontier end of open-weight AI is now contested mostly among these labs.
Within that field, GLM 5.2’s differentiators are the million-token window, the MIT license (some rivals attach usage restrictions), and its benchmark strength on software engineering specifically. If your workload is code, GLM and Kimi are usually the two open lines to shortlist first.
How to use it
You have the full range of options that open weights unlock:
- Hosted API via Z.ai’s OpenAI- and Anthropic-compatible endpoints, or third-party providers like OpenRouter — the practical choice for most teams.
- Self-hosted on your own infrastructure. A 744B-parameter model demands a multi-GPU server even with only 40B parameters active, so this is enterprise territory; quantization reduces the footprint at some quality cost.
- Smaller variants of the GLM family run on far more modest hardware, and tools like Ollama make trying them locally a one-command affair.
The takeaway
GLM 5.2 is the current flagship of Zhipu’s open-weight GLM line: a frontier-scale Mixture-of-Experts model with a one-million-token context window, top-tier open coding performance, MIT-licensed weights, and costs far below proprietary equivalents. It is the product of a lab that has been releasing open models since GLM-130B in 2022, and one of the clearest signs yet that the most capable models are no longer exclusively closed. To understand the platform and company behind it, read our Z.ai explainer.
Tagged
Keep reading
Chisato · · 6 min read DeepSeek V4-Flash-0731: Benchmarks, Price, What Changed
DeepSeek's retrained V4-Flash-0731 beats its own flagship on nine agent benchmarks at the same $0.14/$0.28 price, with MIT-licensed weights on Hugging Face.
Chisato · · 6 min read LG K-EXAONE 2.0: Korea's 750B Open AI Model
LG released K-EXAONE 2.0, a 750B-parameter Apache-2.0 open model — Korea's largest, built to rival DeepSeek and Qwen. Specs, benchmarks, and the stakes.
Chisato · · 5 min read DeepSeek V4 Release: Specs, Benchmarks, Peak Pricing
DeepSeek V4 graduates from preview to general availability with two open-weight MoE models, an 80.6% SWE-bench score, and new peak-hour API pricing.