GLM model — Open-source AI built for long-term tasks with one million context

GLM-5.2 is the flagship open-source GLM AI model: with a stable context of one million tokens, non-thinking/medium/high/three levels of thinking intensity, it reports scores of 81.0 on Terminal-Bench 2.1 and 74.4 on FrontierSWE. Below, you can compare each GLM model — or experience the free AI sandbox first.

1M
Token Context
Improved from 200K, maintaining stability under agent load
81.0
Terminal-Bench 2.1
GLM-5.2 scores, an improvement over GLM-5.1's 63.5.
MIT
Open Source License
Open Weights, No Geographical Restrictions

Free AI Experience Center — Experience real-time open-source large language models

No registration required, no account required, no quota required. Real-time streaming responses can be obtained by entering prompt words.

The reply will be streamed out here...

This experience uses the GLM large language model, and real-time streaming responses can be obtained by entering prompt words.

Core capabilities of the GLM model family

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

Stable Million Contexts

A context of one million tokens is not only available but also maintains quality: GLM-5.2 has been trained on long context encoding agent trajectories such as large-scale implementation, automated research, and complex debugging.

Flexible Thinking Strength

Non-thinking, high, and highest three levels allow you to weigh between delay and capability for tasks — on the agent programming evaluation, about 63% (~35K output tokens) to 74% (~83K).

IndexShare architecture

Every four sparse attention layers share a lightweight indexer, reducing the FLOPs per token by 2.9 times under a context length of one million, while maintaining long-distance quality without loss.

MIT Open Source Weights

Open-source GLM models under the MIT license: weights are published on HuggingFace and ModelScope, without regional restrictions, and support local deployment through transformers, vLLM, SGLang, xLLM, and ktransformers.

GLM 5.2 Benchmark Test: Long-term Results

All the following data are the results of GLM-5.2 and comparative models published by the model authors. glmmodel.net only provides reports and does not run these evaluations.

First Open Source Model
74.4%

FrontierSWE

Task duration can reach 20 hours

GLM-5.274.4
Opus 4.875.1
GPT-5.572.6
Gemini 3.1 Pro39.6
Overall Second Rank
34.3%

PostTrainBench

Up to 10 hours on a single H100 card

GLM-5.234.3
Opus 4.837.2
Opus 4.728.6
GPT-5.525.0
Second only to the Opus series
13.0%

SWE-Marathon

Ultra-long cycle software engineering, up to 10 hours

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

In three long-term benchmark tests, GLM-5.2 is the highest-ranking open-source model — proving that its million-token context can be converted into actual output, not just an acceptable number of tokens. On FrontierSWE, it is only one point behind Opus 4.8 and one point ahead of GPT-5.5, and eleven points ahead of the previous generation Opus 4.7.

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's scores in 17 benchmark tests

Published GLM model benchmark results, covering 17 evaluations of 8 models.

Published GLM model benchmark results, covering each evaluation and model
Benchmark TestGLM-5.2GLM-5.1Qwen3.7-MaxMiniMax M3DeepSeek-V4-ProClaude Opus 4.8GPT-5.5Gemini 3.1 Pro
Inference
HLE40.531.041.437.037.749.8*41.4*45.0
HLE (With Tools)54.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 November 202594.494.095.084.494.496.596.594.8
HMMT February 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
Programming
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 Framework)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
Agent
MCP-Atlas (public dataset)76.871.876.474.273.677.875.369.2
Tool-Decathlon48.240.752.859.955.648.8

* Scores are based on complete datasets.

Strength of thought: non-thinking, high, and highest

GLM models are not just one speed. Think force control allows you to allocate more computing resources only when needed.

Non-Thinking

~63%

~35K average tokens

Scenarios where latency is more important than depth, such as quick editing, template code, and routine refactoring.

Most Used

High

~72%

~43K average tokens

The default choice for most agent programming: approaching the highest quality with about half the token consumption.

Highest

~74%

~83K average tokens

Difficult long-term problems — allocate additional computing resources only when the task truly requires it.

The data comes from the average of Terminal-Bench 2.1, DeepSWE, and SWE-Atlas QnA, evaluated on Claude Code 2.1.167. Reported by the model authors. Under similar token budgets, GLM-5.2's performance is between Claude Opus 4.7 and Opus 4.8.

How does the GLM model achieve a million contexts?

Increasing the context limit from 200K to one million tokens is an engineering issue rather than a configuration parameter. Three modifications are key.

IndexShare sparse attention

Every four Transformer layers share a lightweight indexer. It is located at the first layer among the four, and its top-k index is reused by the other three layers — eliminating the dot product and top-k calculation in three-quarters of the layers. Result: Each token's FLOPs is reduced by 2.9 times under a context length of one million. IndexShare was introduced starting from a sequence length of 128K during the training mid-phase.

GLM model layer sharing and IndexShare Layer N+3 Layer N+2 Layer N+1 Layer N Shared Indexer

MTP combined with IndexShare and KVShare

The multi-token prediction layer runs the indexer once in the first draft step and reuses it in subsequent steps, eliminating the mismatch between the training/inference KV cache of the previous generation. Combined with rejection sampling and end-to-end TV loss, the accepted length increases from 4.56 to 5.47 — about 20% — across 7 MTP steps.

MTP Acceptance Length Ablation Experiment
Baseline4.56
+ IndexShare + KVShare5.10
+ Reject Sampling5.29
+ End-to-End TV Loss5.47 (+20%)

Efficient Service for Million Contexts

After more than a few tens of thousands of tokens, the bottleneck is no longer computation, but the KV cache capacity, long context kernel, and CPU overhead. Three fixes: fine-grained memory management and parallelization based on LayerSplit, kernel optimization for context length scaling coordinated with the cache transfer pipeline, and CPU-side cache management, request scheduling, and runtime path optimization. The throughput advantage expands with the growth of context.

Normalized Throughput Advantage

Agent Reinforcement Learning Training

The training stack (slime) combines white-box and black-box rollouts, compact trajectories, and sub-agent workflows. Parallel OPD training merges more than a dozen expert models in about two days, and FP8 KV caching ensures that rollout memory does not exceed the budget.

Anti-Reward Hacker

Long-term RL can induce shortcuts, so suspicious actions are first passed through a rule-based recall filter, and then checked for accuracy by the LLM judge. Confirmed malicious actions are intercepted online and responded with virtual tool results, allowing rollouts to continue rather than be discarded. Based on Critic's PPO, compressible sub-traces are maintained for training on a single rollout.

Scenarios where long-cycle GLM models excel

Large-Scale Implementation

Multi-file functionality beyond a single context window: the model keeps the entire repository state in view, rather than re-reading it every few rounds.

Automated Research

Several hours of experimental cycles, agents need to plan, run, read results, and correct — this is exactly the workload designed to be evaluated by FrontierSWE and PostTrainBench.

Performance Optimization

Complete call graphs, analyzer outputs, and keeping the kernel and system work on the same track as previous attempts are required.

Complex Debugging

Long-term reproducibility tracking, unstable testing, and cross-service failures; truncating the context is the reason for losing bugs.

All the above scenarios can be run on your own hardware — MIT weights, transformers · vLLM · SGLang · xLLM · ktransformers.How to run the GLM model locally →

Common Questions about GLM Model

GLM is a family of open-weight large language models, with the current flagship being GLM-5.2. The product line ranges from GLM-4.5-Air and GLM-4.7 to GLM-5, GLM-5-Turbo, GLM-5.1, and now GLM-5.2, including voice and visual variants. Each core GLM model is released under the MIT license, with weights fully open.

GLM-5.2 raises the limit from 200K to a stable one million tokens, with an output token limit of up to 128K. 'Stable' is the keyword: the model has been trained on long coding agent trajectories, so the quality remains consistent throughout the window rather than degrading as the running becomes more complex.

The published results include Terminal-Bench 2.1 scores of 81.0, SWE-bench Pro scores of 62.1, FrontierSWE scores of 74.4, PostTrainBench scores of 34.3, DeepSWE scores of 46.2, MCP-Atlas scores of 76.8, and AIME 2026 scores of 99.2 — the highest-ranking open-source models in three long-term evaluations. The complete table is shown above.

The results depend on the task. GLM-5.2 leads GPT-5.5 on FrontierSWE, PostTrainBench, and Terminal-Bench 2.1, and outperforms Gemini 3.1 Pro on almost all programming lines. Claude Opus 4.8 still leads on SWE-bench Pro, NL2Repo, and SWE-Marathon. Under the Claude Code framework, GLM-5.2 scores 82.7, and Opus 4.8 scores 78.9.

They control how much computational resources the model consumes on each task. In the agent programming evaluation, the reported curves are about 63% (~35K output tokens, non-thinking), 72% (~43K, high), and 74% (~83K, highest). High is the practical default choice; the highest is used for truly difficult long-term problems.

Yes. The core GLM model weights are under the MIT license, without regional restrictions, and have been released on HuggingFace and ModelScope. It supports local inference through transformers, vLLM, SGLang, xLLM, and ktransformers, allowing you to run GLM models on your own hardware.

IndexShare allows every four sparse attention layers to share a lightweight indexer, whose top-k index is calculated only once and then reused. This eliminates the work of the indexer in three-quarters of the layers, reducing each token's FLOPs by 2.9 times under a million-token context — a key change that makes a million-token window feasible at the service level.

Free open-source large language models provided through OpenRouter — not GLM-5.2, and not using GLM weights. Its existence is to allow you to test real-time models immediately when reading published GLM model data. All GLM benchmark data on this site are the results reported by the model authors, not measured here.

Free Real-time AI Model Experience — No account required

Read the GLM model benchmark tests, and then let the real model start working. The sandbox above is free and requires no information; if you want a more complete AI toolkit, the free package from the partners starts here.