GLM Model — Open 1M-Context AI Built for Long-Horizon Work

GLM-5.2 is the flagship open-weight GLM AI model: a solid 1M-token context, Non-Thinking / High / Max effort levels, and reported scores of 81.0 on Terminal-Bench 2.1 and 74.4 on FrontierSWE. Compare every GLM model below — or try the free AI playground first.

1M
token context
raised from 200K, kept stable under agent workloads
81.0
Terminal-Bench 2.1
reported for GLM-5.2, up from 63.5 on GLM-5.1
MIT
open-source license
open weights, no regional limits

Free AI Playground — Try a Live Open-Source LLM

No sign-up, no account, no credits. Type a prompt and get a streamed answer.

Response will stream here...

This playground runs a free open-source LLM via OpenRouter. It is not GLM-5.2 and does not use GLM weights — it's here so you can test a live model while you read the published GLM benchmark data below.

What the GLM Model Family Does Best

Four capabilities define the current GLM model generation — all of them reported by the model authors and reproducible from open weights.

Solid 1M Context

A 1M-token context that stays usable, not just accepted: GLM-5.2 was trained on long-context coding-agent trajectories covering large-scale implementation, automated research and complex debugging.

Flexible Effort Levels

Non-Thinking, High and Max let you trade latency for capability per task — roughly 63% at ~35K output tokens up to 74% at ~83K on agentic coding evals.

IndexShare Architecture

One lightweight indexer shared across every four sparse-attention layers cuts per-token FLOPs by 2.9× at 1M context length, with no quality trade at long range.

MIT Open Weights

An open-source GLM model under MIT: weights on HuggingFace and ModelScope, no regional limits, and local serving through transformers, vLLM, SGLang, xLLM and ktransformers.

GLM 5.2 Benchmarks: Long-Horizon Results

All figures below are results published by the model authors for GLM-5.2 and its comparison set. glmmodel.com reports them; it does not run these evaluations.

Top open-source model
74.4%

FrontierSWE

Dominance, tasks up to 20 hours

GLM-5.274.4
Opus 4.875.1
GPT-5.572.6
Gemini 3.1 Pro39.6
2nd overall
34.3%

PostTrainBench

Up to 10 hours on a single H100

GLM-5.234.3
Opus 4.837.2
Opus 4.728.6
GPT-5.525.0
2nd to the Opus series
13.0%

SWE-Marathon

Ultra-long-horizon SWE, up to 10 hours

GLM-5.213.0
Opus 4.826.0
GPT-5.512.0
Gemini 3.1 Pro4.0

Across all three long-horizon benchmarks, GLM-5.2 is the highest-ranked open-source model — evidence that its 1M context translates into delivered work, not just accepted tokens. It trails Opus 4.8 by one point on FrontierSWE, beats GPT-5.5 by one, and beats the previous-generation Opus 4.7 by eleven.

Terminal-Bench 2.1+17.5
GLM-5.281.0
Opus 4.885.0
GLM-5.163.5
SWE-bench Pro+3.7
GLM-5.262.1
Opus 4.869.2
GLM-5.158.4
NL2Repo+6.2
GLM-5.248.9
Opus 4.869.7
GLM-5.142.7
DeepSWE+28.2 (2.6×)
GLM-5.246.2
GPT-5.570.0
GLM-5.118.0
ProgramBench+12.8
GLM-5.263.7
Opus 4.871.9
GLM-5.150.9
MCP-Atlas+5.0
GLM-5.276.8
Opus 4.877.8
GLM-5.171.8
Tool-Decathlon+7.5
GLM-5.248.2
Opus 4.859.9
GLM-5.140.7
HLE+9.5
GLM-5.240.5
Opus 4.849.8
GLM-5.131.0

GLM Model Scores Across 17 Benchmarks

Published GLM model benchmark results, 17 evaluations across 8 models.

Published GLM model benchmark results across every evaluation and model
BenchmarkGLM-5.2GLM-5.1Qwen3.7-MaxMiniMax M3DeepSeek-V4-ProClaude Opus 4.8GPT-5.5Gemini 3.1 Pro
Reasoning
HLE40.531.041.437.037.749.8*41.4*45.0
HLE w/ Tools54.752.353.548.257.9*52.2*51.4*
CritPt20.94.613.43.712.920.927.117.7
AIME 202699.295.397.094.695.798.398.2
HMMT Nov. 202594.494.095.084.494.496.596.594.8
HMMT Feb. 202692.582.697.184.495.296.796.787.3
IMOAnswerBench91.083.890.089.883.581.0
GPQA-Diamond91.286.290.093.090.193.693.694.3
Coding
SWE-bench Pro62.158.460.659.055.469.258.654.2
NL2Repo48.942.747.242.135.569.750.733.4
DeepSWE46.218.018.020.08.058.070.010.0
ProgramBench63.750.947.871.970.839.5
Terminal-Bench 2.1 (Terminus-2)81.063.575.065.064.085.084.074.0
Terminal-Bench 2.1 (best harness)82.7 (Claude Code)69.0 (Claude Code)78.9 (Claude Code)83.4 (Codex)70.7 (Gemini CLI)
FrontierSWE Dominance74.430.529.075.172.639.6
PostTrainBench34.320.137.228.421.6
SWE-Marathon13.01.026.012.04.0
Agentic
MCP-Atlas (public set)76.871.876.474.273.677.875.369.2
Tool-Decathlon48.240.752.859.955.648.8

* score on the full set.

Effort Levels: Non-Thinking, High and Max

A GLM model does not have one speed. Effort level control lets you spend more computation only on the tasks that need it.

Non-Thinking

~63%

~35K avg tokens

Fast edits, boilerplate, routine refactors where latency matters more than depth.

Most used

High

~72%

~43K avg tokens

The default for most agentic coding: near-Max quality at roughly half the token spend.

Max

~74%

~83K avg tokens

Hard, long-horizon problems — allocate extra compute when a task genuinely warrants it.

Averaged over Terminal-Bench 2.1, DeepSWE and SWE-Atlas QnA, evaluated on Claude Code 2.1.167. Reported by the model authors. At comparable token budgets GLM-5.2 sits between Claude Opus 4.7 and Opus 4.8.

How the GLM Model Reaches 1M Context

Raising a context ceiling from 200K to 1M tokens is an engineering problem, not a config flag. Three changes do the work.

IndexShare for sparse attention

Every four transformer layers share one lightweight indexer. It sits on the first of the four, and its top-k indices are reused by the other three — removing the indexer dot-product and top-k work in 3 of every 4 layers. Result: 2.9× lower per-token FLOPs at 1M context length. Trained with IndexShare from mid-training at 128K sequence length.

GLM model layer sharing with IndexShareLayer N+3Layer N+2Layer N+1Layer NSharedIndexer

MTP with IndexShare and KVShare

The multi-token-prediction layer runs its indexer once on the first draft step and reuses the indices for later steps, removing the training/inference KV-cache mismatch that limited the previous generation. Combined with rejection sampling and an end-to-end TV loss, acceptance length rises from 4.56 to 5.47 — about 20% — across 7 MTP steps.

MTP acceptance length ablation
Baseline4.56
+ IndexShare + KVShare5.10
+ Rejection Sampling5.29
+ End-to-end TV Loss5.47 (+20%)

Serving 1M context efficiently

Past a few hundred thousand tokens the bottleneck stops being compute and becomes KV-cache capacity, long-context kernels and CPU overhead. Three fixes: LayerSplit-based fine-grained memory management and parallelism, context-length-scaling kernel work coordinated with the cache-transfer pipeline, and CPU-side cache management, request scheduling and runtime path tuning. The throughput advantage widens as context grows.

Normalized Throughput Advantage

Trained with agentic RL

The training stack (slime) combines white-box and black-box rollout, compact trajectories and sub-agent workflows. Parallel OPD training merged more than ten expert models in roughly two days, with FP8 KV-cache keeping rollout memory in budget.

Anti-reward-hacking

Long-horizon RL invites shortcuts, so suspect actions pass a rule-based recall filter, then an LLM-judge precision check. Confirmed hacks are blocked online and answered with a dummy tool result, letting the rollout continue instead of being thrown away. Critic-based PPO on individual rollouts keeps compaction sub-traces trainable.

Where a Long-Horizon GLM Model Earns Its Keep

Large-scale implementation

Multi-file features that outlive a single context window: the model keeps the whole repo state in view instead of re-reading it every few turns.

Automated research

Hours-long experiment loops where an agent must plan, run, read results and revise — the workload FrontierSWE and PostTrainBench were built to score.

Performance optimization

Kernel and systems work that needs the full call graph, profiler output and prior attempts held together in one trajectory.

Complex debugging

Long reproduction traces, flaky tests and cross-service failures, where truncating the context is what loses the bug.

Run any of it on your own hardware — MIT weights, transformers · vLLM · SGLang · xLLM · ktransformers. How to run a GLM model locally →

GLM Model FAQ

GLM is an open-weight large language model family whose current flagship is GLM-5.2. The line runs GLM-4.5-Air and GLM-4.7 through GLM-5, GLM-5-Turbo, GLM-5.1 and now GLM-5.2, plus speech and vision variants. Every core GLM model ships under an MIT license with weights published openly.

Try a Live AI Model Free — No Account Needed

Read the GLM model benchmarks, then put a real model to work. The playground above is free and needs nothing from you; if you want a fuller AI toolkit, our partner's free tier starts here.