GLM-5.2: 744B MoE, 1M Context, MIT-Licensed (2026)

Z.ai's GLM-5.2: 744B params (40B active), 1M-token context, MIT-licensed weights — still the newest GLM you can self-host while GLM-5.3's weights are pending. Architecture, benchmarks, pricing, and a 3-path local-inference playbook.

Quick answer. GLM-5.2 is an open-weights coding model from Z.ai (Zhipu AI), released 13 June 2026. It is a Mixture-of-Experts transformer with ~744B total parameters and ~40B active per token, a 1,048,576-token context window, and MIT-licensed weights on Hugging Face at zai-org/GLM-5.2. It scores 53 on the Artificial Analysis Intelligence Index (v4.1.1) and costs $1.40 / $4.40 per million input / output tokens.

Status check — 23 August 2026. GLM-5.3 shipped on 14 August 2026 via API and the GLM Coding Plan, but its weights are still not public: as of today there is no GLM-5.3 repository under huggingface.co/zai-org (checked against the Hugging Face API while writing this). Z.ai promised them roughly two weeks after launch — around 28 August. Until they land, GLM-5.2 remains the newest GLM you can self-host, and it stays MIT. Full detail in the GLM-5.3 section below.

What is GLM-5.2?

GLM-5.2 is the open-weights flagship coding model released by Z.ai on 13 June 2026. Z.ai is the international brand of Zhipu AI, the Tsinghua University spinout that has shipped the General Language Model (GLM) lineage since 2021. The model was announced alongside the GLM Coding Plan tiers, with the metered API and the MIT-licensed weights rolling out over the following week (MarkTechPost, 14 June 2026).

The pitch is narrow and deliberate: long-horizon agentic coding at open-weights pricing. GLM-5.2 is a Mixture-of-Experts model of roughly 744 billion parameters that activates only about 40 billion per token, gives you a genuinely usable one-million-token context window, exposes multiple thinking-effort levels so you can trade latency for quality, and ships under the MIT license with no revenue thresholds and no regional restrictions. You can point Claude Code, Cline, or Cursor at it through an OpenAI-compatible endpoint, or download the checkpoint and run it inside your own VPC.

That combination is the whole reason it matters. Before GLM-5.2, a team that wanted Opus-class quality on multi-file refactors either paid closed-API rates or accepted a visible quality gap in exchange for controlling its own weights. GLM-5.2 narrowed that gap far enough that self-hosting became a real option for production coding agents rather than a compromise.

What are GLM-5.2's full specifications?

SpecificationValue
DeveloperZ.ai / Zhipu AI (Tsinghua University spinout, Beijing)
Release date13 June 2026
ArchitectureMixture-of-Experts transformer, 78 layers, hidden size 6,144
Total parameters~744B (Z.ai's model card and Artificial Analysis both round to 753B; vLLM's recipe page computes 743B — see note below)
Active parameters per token~40B (vLLM computes 39B)
Experts256 routed experts + 1 shared expert; 8 routed experts selected per token. The first 3 feed-forward blocks are dense; the remaining 75 are MoE.
AttentionMulti-head Latent Attention (MLA) combined with DeepSeek Sparse Attention (DSA), keeping the top 2,048 tokens per query
Long-context optimisation"IndexShare" — the sparse-attention indexer is reused across every four attention layers, cutting per-token FLOPs ~2.9× at a 1M window
Speculative decodingMulti-Token Prediction layer; mean accepted draft length rises from 4.56 to 5.47 tokens (+20%)
Context window1,048,576 tokens (1M) — 5× GLM-5.1's 200K
Max output tokens128K via the Z.ai API (the model card cites up to 163,840 in its own reasoning evaluations)
LicenseMIT — commercial use, no revenue threshold, no regional limits
Hugging Face model IDzai-org/GLM-5.2 (also zai-org/GLM-5.2-FP8); both last updated 2 July 2026
Artificial Analysis Intelligence Index53 on index v4.1.1 (current as of August 2026). It scored 51 on v4.1 at launch, which was the leading open-weights score at the time.
ModalitiesText in, text out. No native vision.
API price$1.40 / 1M input · $0.26 / 1M cached input · $4.40 / 1M output

Sources: Z.ai's Hugging Face model card, the GLM-5.2 launch blog, vLLM's GLM-5.2 recipe, Artificial Analysis, and Sebastian Raschka's config-level architecture breakdown.

Why do sources disagree on the parameter count?

You will see 743B, 744B and 753B quoted for the same checkpoint, and all three are defensible. The spread comes from what each counter includes: whether the multi-token-prediction head, the embedding and output matrices, and the shared expert are folded into the total. vLLM derives 743B / 39B straight from config.json; Sebastian Raschka's layer-by-layer walkthrough lands on 744B / 40B; Z.ai's own model card and Artificial Analysis's model page both publish 753B. If you need one number, use ~744B total and ~40B active — that is the figure most third-party evaluations standardise on, and the ~40B active figure is the one that actually governs your inference cost and throughput.

How does the MoE routing actually work?

Each of the 75 sparse layers holds 256 routed experts plus one shared expert that always fires. The router picks 8 routed experts per token, so roughly 3% of the expert bank is live at any moment — that is how a 744B-parameter model runs at 40B-parameter cost. The attention side pairs MLA (queries, keys and values compressed to low-rank latents, with partial RoPE) with DeepSeek Sparse Attention, which uses a lightning indexer to retain only the 2,048 most relevant tokens per query rather than attending across the full million. IndexShare is the piece that makes 1M context economically sane: instead of recomputing the token-selection index at every sparse layer, GLM-5.2 computes it once and reuses the selected positions across the next three layers, while each layer still computes fresh queries and outputs. Z.ai's stated result is a 2.9× reduction in per-token FLOPs at maximum context — an architectural estimate, not an end-to-end wall-clock speedup.

Is GLM-5.3 out, and should you wait for it?

Yes, GLM-5.3 exists — Z.ai launched it on 14 August 2026 — but as of 23 August 2026 its weights have not been published. The official zai-org organisation on Hugging Face still lists GLM-5.2 and GLM-5.2-FP8 as its newest GLM-5-series releases. Z.ai committed to publishing 5.3's weights roughly two weeks after launch — around 28 August — after what it describes as its most extensive risk review to date, prompted by cyber-capability results that it says scaled faster than the team anticipated.

Here is what actually changes:

GLM-5.2GLM-5.3
Released13 June 202614 August 2026
Base model~744B MoE, ~40B activeIdentical base model — all gains come from scaled post-training
Open weightsYes, MIT, live since JuneNot yet — promised ~28 August 2026
Context / max output1M / 128K1M / 128K
AA Intelligence Index53 (v4.1.1)60 (measured 18 August 2026)
GDPval-AA v2 (agentic Elo)15241770 — 2nd overall, behind Claude Opus 5 (1855)
Terminal-Bench 3.0 (vendor-reported)4.628.3
DeepSWE v1.1 (vendor-reported)46.266.9
API price$1.40 / $0.26 / $4.40Identical: $1.40 / $0.26 / $4.40

Index and Elo figures from Artificial Analysis (18 August 2026); Terminal-Bench 3.0 and DeepSWE numbers are Z.ai's own and are not yet independently reproduced. At 60, GLM-5.3 ties Kimi K3 for the top open-weights score and sits three points behind Claude Opus 5 (63), the current overall leader.

The recommendation depends on which path you are on, and it is unambiguous either way:

  • If you use the GLM Coding Plan, you are already on 5.3. Z.ai's developer docs state plainly that "requests for previous models (GLM-5.2/GLM-5.1) will be automatically routed to GLM-5.3." There is no documented opt-out. Do nothing; you got the upgrade whether you asked for it or not.
  • If you use the metered API, switch. GLM-5.3 costs exactly the same per token and scores seven index points higher. There is no reason to keep pinning glm-5.2.
  • If you self-host, stay on 5.2 for now — and stop planning around the wait. 5.3's weights do not exist publicly yet, and a two-week promise made by a lab conducting an unusually heavy safety review is a soft date. The good news is that because the base model is unchanged, every quantisation and hardware calculation on this page carries straight over when 5.3 does land. Your capacity planning is not wasted.

We track the successor separately in the GLM-5.3 launch guide, and the cyber-capability claim that triggered the weights delay in GLM-5.3's cyber capabilities explained.

How much does GLM-5.2 cost?

Z.ai publishes flat per-token pricing with a heavily discounted cached-input rate. These are the official figures from Z.ai's pricing documentation:

ModelInput / 1MCached input / 1MOutput / 1M
GLM-5.2$1.40$0.26$4.40
GLM-5.2-Fast$2.29$8.00
GLM-5.3$1.40$0.26$4.40
GLM-5-Turbo$1.20$0.24$4.00
GLM-5$1.00$0.20$3.20
GLM-4.7$0.60$0.11$2.20
GLM-4.7-FlashX$0.07$0.01$0.40

What is GLM-5.2-Fast and is it worth the premium?

GLM-5.2-Fast is the same weights on throughput-tuned infrastructure. Quality and benchmark scores are identical to standard GLM-5.2 — the extra 64% on input and 82% on output buys latency only. Providers report roughly double the tokens-per-second of their standard GLM-5.2 endpoints, with peaks measured around 446 tok/s (Vercel AI Gateway). Note that GLM-5.2-Fast is a serving tier offered through gateways and resellers rather than a line item on Z.ai's own pricing table, so the exact rate varies slightly by provider.

The decision rule is simple: pay for Fast only when a human is waiting on the response. Interactive IDE completion and chat justify it. Batch refactors, nightly test generation, and background agent runs do not — at those volumes the 82% output premium is pure waste.

What about the GLM Coding Plan subscription?

For agent-heavy usage, the subscription is usually far cheaper than metered billing. Z.ai's developer-pack documentation confirms the plan starts at $18/month and publishes these credit allowances:

TierCredits per 5 hoursCredits per week
Lite2,00010,000
Pro12,00060,000
Max28,000140,000

Z.ai's docs publish the $18 entry price and the credit quotas, but not per-tier prices for Pro and Max; third-party trackers report roughly $72–$80 for Pro and $160–$168 for Max depending on the promotion running, with a discount on annual billing. Treat those two figures as approximate and check the checkout page. All tiers bundle GLM-5.3, GLM-5-Turbo and GLM-4.7, and work directly inside Claude Code, Cline and similar harnesses.

How should you prompt GLM-5.2?

GLM-5.2 has genuinely different sampling recommendations from the OpenAI-family habits most developers carry around, and getting them wrong is the most common cause of disappointing output.

What sampling parameters does Z.ai recommend?

Task typeTemperatureTop-p
Reasoning / math / analysis1.00.95
General evaluation and coding1.01.0

Do not set temperature=0 or 0.2 out of habit. Z.ai's model card recommends temperature 1.0 for both reasoning and general use, and only varies top-p. This is the single most impactful correction for teams migrating an existing prompt stack: low-temperature settings tuned for GPT-class models measurably degrade GLM-5.2's chain-of-thought quality, because the model's post-training assumes a full-entropy sampler. Turn the knob back to 1.0 and control determinism with a seed and structured output instead.

How do you control thinking effort?

GLM-5.2 exposes reasoning depth through two API parameters:

  • thinking: {"type": "enabled"} or {"type": "disabled"} — the hard on/off switch for chain-of-thought.
  • reasoning_effort — the depth dial. Z.ai's own examples use "max"; through OpenRouter the exposed levels are "high" and "xhigh".

Practical guidance: use max/xhigh effort for anything multi-file or multi-step — planning a refactor, debugging across module boundaries, writing a migration. It is slower and burns considerably more output tokens, but the benchmark gap between effort levels on long-horizon coding tasks is large. Use high effort for code review, documentation, single-function edits and anything where you would have reached for a smaller model anyway. Disable thinking entirely for classification, extraction and formatting calls, where the reasoning trace is pure cost.

What does a correct GLM-5.2 call look like?

The Z.ai API is OpenAI-SDK-compatible, so the only changes from an OpenAI call are the base URL, the model id, and the two thinking parameters:

from openai import OpenAI

client = OpenAI(
    api_key="YOUR_ZAI_KEY",
    base_url="https://api.z.ai/api/paas/v4",
)

resp = client.chat.completions.create(
    model="glm-5.2",
    messages=[
        {"role": "system", "content": "You are a senior backend engineer. "
                                      "Make the smallest correct change."},
        {"role": "user", "content": "Refactor this Express handler to async/await..."},
    ],
    temperature=1.0,          # Z.ai's recommended default -- do not lower it
    top_p=1.0,                # 0.95 for reasoning-heavy prompts
    max_tokens=32000,
    extra_body={
        "thinking": {"type": "enabled"},
        "reasoning_effort": "max",
    },
)
print(resp.choices[0].message.content)

Three more conventions worth knowing:

  • Tool calling uses the standard OpenAI tools and tool_choice fields, and structured output works through JSON Schema in response_format. No vendor-specific tool syntax to learn — this is why GLM-5.2 drops into existing agent harnesses cleanly.
  • System prompts should specify output shape explicitly. Z.ai's own evaluation harness uses a rigid template for exact-answer tasks: "Your response should be in the following format:\nExplanation: {explanation}\nExact Answer: {answer}\nConfidence: {0-100%}". The model follows format instructions reliably; it is less reliable at inferring an unstated one.
  • Front-load context, do not chunk it. The 1M window plus $0.26/M cached input means the economically correct pattern is to paste the whole service into the prompt and cache it, rather than building a retrieval layer. A cached 200K-token codebase costs about five cents per call.

How does GLM-5.2 score on benchmarks?

Z.ai published no benchmark numbers in the initial launch post, which is unusual for a flagship release. The figures below combine Z.ai's later first-party model-card table with independent evaluations.

BenchmarkGLM-5.2Claude Opus 4.8GPT-5.5
Terminal-Bench 2.1 (agentic shell)81.085.084.0
SWE-bench Pro (coding)62.169.258.6
FrontierSWE74.475.172.6
PostTrainBench34.337.228.4
AA Intelligence Index v4.1.153
GDPval-AA v2 (agentic Elo)15241514
MCP-Atlas (tool use)77.077.875.3

Benchmark rows one to four are from Z.ai's own launch blog; index and Elo figures from Artificial Analysis (17 June 2026); MCP-Atlas via The Decoder.

The honest reading in August 2026: GLM-5.2 beats GPT-5.5 on SWE-bench Pro, FrontierSWE, PostTrainBench and MCP-Atlas, and trails Claude Opus 4.8 on all of them — narrowly on FrontierSWE and MCP-Atlas, more clearly on SWE-bench Pro. It was the leading open-weights model on the Artificial Analysis Intelligence Index at launch, but is no longer: Kimi K3 and GLM-5.3 both score 60 to GLM-5.2's 53, with Claude Opus 5 leading everything at 63. GLM-5.2 is now the strongest open-weights model you can actually download today, which is a meaningfully different claim.

One efficiency caveat worth planning around: Artificial Analysis measures GLM-5.2 consuming roughly 43,000 output tokens per task in its harness, against ~24,000 for MiniMax-M3 and ~35,000 for Kimi K2.6. At $4.40/M that is still cheap in absolute terms, but it lands as latency in interactive agents and as real money at agent-fleet scale.

How do you run GLM-5.2 yourself?

Three paths, lowest to highest operational lift.

Path 1 — the Z.ai API or a gateway

Lowest friction, and correct for most teams. Point an OpenAI SDK at https://api.z.ai/api/paas/v4 with model id glm-5.2, or route through OpenRouter as z-ai/glm-5.2 if you already have keys there. For coding-agent-heavy usage, the GLM Coding Plan subscription almost always beats metered billing — though remember it now serves GLM-5.3 for GLM-5.2 requests.

Path 2 — quantised GGUF on your own hardware

Unsloth publishes dynamic GGUF quants that compress the 1.51 TB BF16 checkpoint dramatically:

QuantDisk sizeMemory required (RAM + VRAM)
UD-IQ1_S (1-bit dynamic)217 GB~223 GB
UD-IQ2_M (2-bit dynamic)239 GB~245 GB
4-bit372–475 GB
8-bit~810 GB
Full BF161.51 TB

Unsloth reports the 2-bit dynamic quant retaining roughly 82% of BF16 accuracy across its evaluation set while being 84% smaller, with throughput in the 3–9 tokens/second range on consumer hardware depending on memory bandwidth and offloading strategy. Workable configurations: a 256 GB unified-memory Mac fits the 2-bit quant directly; a single 24 GB GPU plus 256 GB system RAM works with MoE offloading; multi-GPU rigs such as 4×3090 land inside the same throughput envelope per community reports. One caveat for local runs: mainline llama.cpp still falls back to dense attention because the sparse DSA path is unsupported (issue #24730), so long-context throughput sits below the advertised numbers. Our step-by-step walkthrough is in how to run GLM-5.2 locally.

Path 3 — vLLM or SGLang for production serving

For high-QPS, low-latency, or data-residency-constrained deployments, vLLM with the FP8 checkpoint is the canonical route. vLLM's own recipe recommends the FP8 checkpoint on 8×H200 or H20 with tensor parallelism of 8, and enabling GLM-5.2's five-token MTP draft path via --speculative-config.num_speculative_tokens 5. NVFP4 and AMD Quark MXFP4 builds also exist. Weight memory at FP8 is roughly 744 GB and BF16 roughly 1.49 TB before KV cache and runtime overhead. On vLLM, expert parallelism is --enable-expert-parallel; on SGLang it is --enable-moe-ep.

Cluster sizing, KV-cache tuning, and the vLLM-versus-SGLang decision for MoE workloads are covered across model families in our self-hosting LLMs guide.

How does GLM-5.2 compare to other open-weights models?

ModelParams (total / active)ContextLicenseAA IndexWeights available?
GLM-5.2~744B / ~40B1MMIT53Yes
GLM-5.3~744B / ~40B1MMIT (promised)60Not yet
Kimi K3~1T-class MoERevenue-tiered60Yes
DeepSeek V4 Pro1.6T / 49B1MMIT44Yes
MiniMax-M3Open weights44Yes
Claude Opus 5 (closed, for reference)Proprietary63No

The practical heuristic as of August 2026:

  • You need MIT-licensed weights on disk today, for agentic coding. GLM-5.2 is the answer, and it is not close.
  • You want the highest open-weights score and can accept a revenue-tiered license. Kimi K3 at 60 is the current ceiling — check whether its revenue thresholds apply to you before committing.
  • You are cost-sensitive at high volume. DeepSeek V4 Flash is the cheap workhorse; you trade real quality for it. Head-to-head detail in our GLM-5.2 vs DeepSeek V4 comparison.
  • You just want the best model and licensing is irrelevant. Claude Opus 5 leads the index at 63; nothing open matches it yet.

The wider field, including Llama 4 and the long tail, is mapped in our open-source LLMs landscape.

What are GLM-5.2's limitations?

  • No vision modality. Text in, text out. Multimodal pipelines still need a vision-capable model in the chain. Fast.ai co-founder Jeremy Howard, who assessed GLM-5.2 as "at least as good as Opus 4.8 and GPT 5.5" for his own use in June 2026, named the missing vision support as the main gap.
  • Token-hungry on long agent runs. ~43K output tokens per task in Artificial Analysis's harness, versus ~24K for MiniMax-M3. Cheap per token, expensive in wall-clock latency.
  • It sometimes claims to be Claude. A well-documented quirk across GLM-series and other Chinese open-weights models. The common explanation is training-data contamination from Claude outputs, but no published technical audit confirms it. Harmless for code correctness — but do not build guardrails that depend on model self-identification.
  • Thin first-party documentation. Z.ai shipped no benchmark report at launch and the numbers on its model card arrived later. Most technical detail in circulation still comes from third parties, which can be a procurement friction in regulated environments.
  • Superseded on quality, though not on availability. GLM-5.3 scores seven index points higher at identical price. If you are not self-hosting, GLM-5.2 is no longer the right default.

FAQ

How many parameters does GLM-5.2 have?

GLM-5.2 has approximately 744 billion total parameters with about 40 billion active per token. It is a Mixture-of-Experts model with 256 routed experts plus one shared expert per sparse layer, selecting 8 routed experts per token across 78 transformer layers. Z.ai's model card and Artificial Analysis both round the total to 753B, and vLLM computes 743B / 39B from the config — the spread reflects different counting conventions for embedding and MTP parameters.

Is GLM-5.3 out?

Yes. Z.ai launched GLM-5.3 on 14 August 2026 through its API and the GLM Coding Plan. However, as of 23 August 2026 the weights have not been published — there is still no GLM-5.3 repository under huggingface.co/zai-org. Z.ai committed to releasing them roughly two weeks after launch, around 28 August, following an extended safety review. Until then GLM-5.2 remains the newest self-hostable GLM.

How much does GLM-5.2 cost?

The Z.ai metered API charges $1.40 per million input tokens, $0.26 per million cached input tokens, and $4.40 per million output tokens. The throughput-optimised GLM-5.2-Fast tier costs $2.29 input and $8.00 output for the same weights and identical quality. The GLM Coding Plan subscription starts at $18/month for the Lite tier and is usually cheaper for agent-heavy workloads.

Is GLM-5.2 open source?

The weights are published under the MIT license at zai-org/GLM-5.2 on Hugging Face, with no revenue thresholds and no regional restrictions on commercial use. The training code and a full technical report were not released, so "open weights" is the more precise description than "open source" in the strict OSI sense. An FP8 variant is also published as zai-org/GLM-5.2-FP8.

Can I run GLM-5.2 locally?

Yes, using quantised GGUF builds. Unsloth's 2-bit dynamic quant is 239 GB on disk and needs about 245 GB of combined RAM and VRAM, which fits a 256 GB unified-memory Mac or a single 24 GB GPU paired with 256 GB of system RAM. Expect 3–9 tokens per second on consumer hardware. Full BF16 at 1.51 TB requires server-class hardware, typically 8×H200 with FP8 weights.

GLM-5.2 vs DeepSeek V4 — which is better for coding?

GLM-5.2 is the stronger coding model. It scores 53 on the Artificial Analysis Intelligence Index against DeepSeek V4 Pro's 44, and leads on long-horizon coding benchmarks including SWE-bench Pro and FrontierSWE. Both are MIT-licensed with 1M context. DeepSeek V4 Flash wins on inference cost at high volume, so pick DeepSeek when token spend dominates and GLM-5.2 when output quality does.

What temperature should I use with GLM-5.2?

Use temperature 1.0. Z.ai's model card recommends 1.0 for both reasoning and general use, varying only top-p — 0.95 for reasoning-heavy prompts and 1.0 for general evaluation and coding. Lowering temperature to 0 or 0.2 out of GPT-era habit measurably degrades GLM-5.2's reasoning quality, because its post-training assumes full-entropy sampling.

What context window does GLM-5.2 support?

GLM-5.2 supports a native 1,048,576-token context window, five times GLM-5.1's 200K. Maximum output is 128K tokens through the Z.ai API. The window is made economically practical by DeepSeek Sparse Attention, which retains only the top 2,048 tokens per query, combined with IndexShare, which reuses the token-selection index across every four attention layers for a claimed 2.9× reduction in per-token FLOPs at full context.

Which GLM should you actually run?

The decision collapses to one question: do you need the weights on your own disk?

If you do not, use GLM-5.3 — same price, seven index points better, and if you are on a Coding Plan you are already using it whether or not you changed your model string. If you do, GLM-5.2 is the correct and only choice today, and it remains a strong one: the best MIT-licensed agentic coding model that exists as a downloadable artifact, with a 1M context window that makes retrieval layers optional for most codebases. Watch huggingface.co/zai-org for the 5.3 drop, but build against 5.2 now — the base model is identical, so the migration will be a checkpoint swap rather than a re-architecture.

Standing GLM-5.2 up in production is mostly not a model problem. It is MoE-aware KV-cache tuning, expert-parallel sharding across a multi-GPU cluster, agent loops that use the 1M window without burning it, and evals that reflect your codebase rather than someone else's leaderboard. If you want senior engineers who have shipped self-hosted inference and agent stacks before, Codersera can extend your team.