GLM-5 Guide: The MIT-Licensed Base of Z.ai's 5.x Family
GLM-5 grew to 744B total and 40B active parameters, added sparse attention and shipped MIT weights. What it is, what it costs, and when it still fits.
GLM-5 is no longer Z.ai's newest model. GLM-5.1 followed in April 2026, GLM-5.2 in June, and the 5.3 line after that. It is tempting to treat the original as a stepping stone and move on, but that misses why it still turns up in production configs: it is the cheapest full-size model in the 5.x family on Z.ai's own price list, and its weights are MIT-licensed.
This guide covers what GLM-5 actually is, how to read its benchmark sheet without being misled, and the narrow set of jobs where it remains a sensible pick in late 2026.
What changed from the GLM-4 generation
Z.ai released GLM-5 in mid-February 2026; OpenRouter lists it from 11 February and Z.ai's release notes date it 12 February. The Hugging Face model card frames the change against GLM-4.5 in three numbers:
- Total parameters went from 355B to 744B.
- Active parameters per token went from 32B to 40B.
- Pre-training data went from 23T to 28.5T tokens.
So the total more than doubled while the per-token compute rose by a quarter. That is the usual mixture-of-experts bargain: more knowledge stored in experts that sit idle most of the time, without a proportional rise in serving cost. If the total-versus-active split is new to you, mixture of experts explained covers it.
Two architectural notes matter more than the parameter counts. Z.ai's documentation says GLM-5 is the first GLM to integrate DeepSeek Sparse Attention, credited with keeping long-context quality intact while cutting deployment cost. And post-training moved to slime, an asynchronous reinforcement learning framework built so the model can learn from long multi-step interactions rather than short exchanges. Both choices point the same way: GLM-5 was trained for agent loops, not chat.
The benchmark sheet, read carefully
The model card compares GLM-5 with GLM-4.7, DeepSeek-V3.2, Kimi K2.5, Claude Opus 4.5, Gemini 3 Pro and GPT-5.2. The coding and agent rows are the interesting ones:
- SWE-bench Verified: 77.8, up from 73.8 for GLM-4.7. Opus 4.5 is listed at 80.9.
- Terminal-Bench 2.0 (Terminus 2): 56.2, or 60.7 on the verified task set, up from 41.0.
- BrowseComp: 62.0, rising to 75.9 with context management.
- MCP-Atlas (public set): 67.8. Tool-Decathlon: 38.0.
- Vending Bench 2, a year-long simulated business: $4,432.12 final balance against $4,967.06 for Opus 4.5.
The jump that stands out is Terminal-Bench: fifteen points over GLM-4.7 on a benchmark that rewards sustained shell work. That is where the agent-focused training shows.
Now the caveat. The same Hugging Face page also carries the SWE-bench project's own listing for GLM-5, which records 72.8 at high reasoning rather than the 77.8 Z.ai reports. A five-point gap between a vendor harness and an independent one is normal, and it is exactly why a vendor table should be read as an upper bound. Building a 20-task eval of your own is the only figure that will predict your results.
200K context in a family that moved to 1M
GLM-5 offers a 200K-token context window and up to 128K output tokens. At launch that was competitive. Since June, GLM-5.2 has offered 1M tokens at the same scale, and the gap is the main practical reason to upgrade.
Whether it matters depends on the job. A single-repository refactor where the agent reads files on demand rarely gets near 200K. A loop that keeps a long transcript, or one fed whole log files, will hit it. Compaction and retrieval work around the limit, but they are engineering you would not need on a 1M model. The GLM-5.2 guide covers what the larger window buys.
Thinking is on by default and can be switched off per request, which is worth doing for extraction and classification work where reasoning tokens only add cost:
{
"model": "glm-5",
"messages": [{"role": "user", "content": "Extract the invoice total."}],
"thinking": {"type": "disabled"}
}
Self-hosting: MIT weights and an eight-GPU starting point
The weights are on Hugging Face and ModelScope under the MIT licence, alongside an official FP8 build. No revenue threshold, no regional restriction, no separate agreement to serve it to paying customers. Open weights vs open source explains why that matters more as a product grows.
The deployment examples in the model card use vLLM and SGLang with tensor parallelism across eight GPUs, plus speculative decoding to raise throughput. KTransformers and xLLM, the latter for Huawei Ascend hardware, are also supported. That makes GLM-5 a node-sized deployment rather than a workstation one. Check the minimum framework versions in the model card before you start, because older vLLM and SGLang builds will not load it.
Price, and when GLM-5 still earns a slot
Z.ai's pricing page lists GLM-5 at $1.00 per million input tokens, $0.20 cached and $3.20 output. GLM-5.1 and GLM-5.2 are listed at $1.40, $0.26 and $4.40. OpenRouter showed the same $1.00 and $3.20 for GLM-5 at the time of writing; prices move, so check before you budget.
That is a little under 30 percent cheaper than its successors on both input and output. A short decision rule:
- Keep GLM-5 for bounded agent tasks that fit inside 200K, where you have already validated it and the saving compounds over volume.
- Keep GLM-5 if you self-host and your serving stack is tuned for it. Re-validating a new checkpoint has a real cost.
- Move to GLM-5.1 or 5.2 for long unattended runs or anything that needs more than 200K of context. The GLM-5.1 guide covers the long-run tuning.
- Look at GLM-5 Turbo only if your harness is OpenClaw. It is a tuned variant for that environment, not a cheaper GLM-5.
A quick way to decide
Take ten tasks from your recent history that a model already solved. Run them on GLM-5 and on GLM-5.2 through the same harness, from the same starting commit. Record pass rate, turns to completion and total tokens, then compute cost per completed task rather than price per token.
If GLM-5 matches the newer model on your tasks, the cheaper rate is a straight saving. If it falls behind on the longer ones, the upgrade has paid for itself before you finish the spreadsheet.
Common questions
Is GLM-5 open source?
The weights are published on Hugging Face and ModelScope under the MIT licence, with an official FP8 build. You can fine-tune, redistribute and serve it commercially without a separate agreement.
What is the context window of GLM-5?
Z.ai documents a 200K-token context window with up to 128K output tokens. GLM-5.2, released in June 2026, raised the family's window to 1M tokens.
Should I still use GLM-5 now that GLM-5.2 exists?
For bounded tasks that fit in 200K, possibly. Z.ai lists GLM-5 at $1.00 input and $3.20 output per million tokens against $1.40 and $4.40 for GLM-5.2, so measure cost per completed task on your own work before deciding.