GLM-5: The Open-Source Frontier Model You Can Self-Host
On February 11, 2026, Z.ai (formerly Zhipu AI) released GLM-5 on Hugging Face under an MIT license. That single decision changed the landscape of open-source AI. For the first time, a model that competes directly with GPT-5.2 and Claude Opus 4.5 on major benchmarks is available for anyone to download, modify, fine-tune, and deploy commercially with zero restrictions or royalty fees.
GLM-5 is a 744-billion-parameter Mixture of Experts model with only 40 billion active parameters per inference. It was pre-trained on 28.5 trillion tokens, supports a 200K context window, and can generate outputs up to 131,072 tokens. It ranks in the top five on nearly every major frontier benchmark, and its successor GLM-5.1 (released April 7, 2026) has already claimed the number one spot on SWE-Bench Pro.
This guide covers what GLM-5 is, how it performs against proprietary competitors, what it costs to run via API or self-hosted, and how to deploy it yourself with vLLM and Docker.
If you are evaluating the broader self-hosting vs cloud API tradeoff, see our detailed cost and performance comparison. For open-source developer tooling more broadly, our best open-source AI tools guide covers the full ecosystem.
What Is GLM-5 and Why Does It Matter?
GLM-5 is the fifth-generation large language model from Z.ai, a Chinese AI lab that rebranded from Zhipu AI. The model is specifically designed for complex systems engineering and long-horizon agentic tasks: advanced reasoning, coding, tool use, web browsing, terminal operations, and multi-step agentic workflows.
Technical Specifications
| Specification | Value |
|---|---|
| Total Parameters | 744B |
| Active Parameters (MoE) | 40B |
| Architecture | Mixture of Experts with DeepSeek Sparse Attention (DSA) |
| Expert Count | 256 experts, 8 activated per token (5.9% sparsity) |
| Pre-training Data | 28.5T tokens |
| Context Window | 200K tokens |
| Max Output Length | 131,072 tokens |
| License | MIT |
| Release Date | February 11, 2026 |
| Training Hardware | 100,000 Huawei Ascend 910B chips |
The architecture incorporates DeepSeek's Multi-head Latent Attention (MLA) combined with Dynamic Sparse Attention (DSA). This pairing substantially reduces deployment cost while preserving the model's ability to process extremely long contexts. In practical terms, the DSA mechanism allows GLM-5 to handle 200K-token sequences without the computational overhead of traditional dense attention.
One notable detail: GLM-5 was trained entirely on 100,000 Huawei Ascend 910B accelerator chips with zero NVIDIA hardware involved.
The MIT license means no commercial restrictions. You can download, modify, fine-tune, and redistribute GLM-5 without paying royalties or seeking permission. For enterprises that need full control over their model stack, this is the most permissive license available at this performance tier.
Benchmark Comparison: GLM-5 vs GPT-5.2, Claude Opus 4.5, and Peers
The following table uses official scores from the GLM-5 Hugging Face model card and covers the major frontier evaluation suites as of April 2026.
Frontier Benchmark Scores
| Benchmark | GLM-5 | Claude Opus 4.5 | GPT-5.2 | Gemini 3 Pro | Kimi K2.5 | DeepSeek-V3.2 |
|---|---|---|---|---|---|---|
| HLE | 30.5 | 28.4 | 35.4 | 37.2 | 31.5 | 25.1 |
| HLE (w/ Tools) | 50.4 | 43.4 | 45.5 | 45.8 | 51.8 | 40.8 |
| AIME 2026 I | 92.7 | 93.3 | -- | 90.6 | 92.5 | 92.7 |
| GPQA-Diamond | 86.0 | 87.0 | 92.4 | 91.9 | 87.6 | 82.4 |
| SWE-bench Verified | 77.8 | 80.9 | 80.0 | 76.2 | 76.8 | 73.1 |
| SWE-bench Multilingual | 73.3 | 77.5 | 72.0 | 65.0 | 73.0 | 70.2 |
| Terminal-Bench 2.0 | 56.2 | 59.3 | 54.0 | 54.2 | 50.8 | 39.3 |
| BrowseComp | 62.0 | 37.0 | -- | 37.8 | 60.6 | 51.4 |
| BrowseComp (w/ Context) | 75.9 | 67.8 | 65.8 | 59.2 | 74.9 | 67.6 |
| tau-2-Bench | 89.7 | 91.6 | 85.5 | 90.7 | 80.2 | 85.3 |
| MCP-Atlas (Public) | 67.8 | 65.2 | 68.0 | 66.6 | 63.8 | 62.2 |
| CyberGym | 43.2 | 50.6 | -- | 39.9 | 41.3 | 17.3 |
| Tool-Decathlon | 38.0 | 43.5 | 46.3 | 36.4 | 27.8 | 35.2 |
What the Numbers Tell Us
Where GLM-5 leads: BrowseComp is the standout -- GLM-5 scores 62.0 (75.9 with context management) versus Claude Opus 4.5 at 37.0 (67.8). The model also excels on HLE with tools (50.4 vs Claude's 43.4 and GPT-5.2's 45.5) and MCP-Atlas (67.8 vs Claude's 65.2). These benchmarks measure agentic capabilities: web browsing, tool use, and multi-step task completion.
Where GLM-5 is competitive but trails slightly: On SWE-bench Verified, GLM-5 scores 77.8 against Claude Opus 4.5 at 80.9 and GPT-5.2 at 80.0. The gap is narrow enough that the model is viable for real-world coding tasks. AIME 2026 I shows the same pattern: 92.7 for GLM-5 versus 93.3 for Claude.
Where GLM-5 falls short: GPQA-Diamond (86.0 vs GPT-5.2's 92.4) and Tool-Decathlon (38.0 vs GPT-5.2's 46.3) show meaningful gaps. For use cases demanding the absolute best on scientific reasoning or complex tool orchestration, proprietary models still have an edge.
The successor, GLM-5.1 (released April 7, 2026) pushes further. It claims the number one spot on SWE-Bench Pro at 58.4, surpassing GPT-5.4 (57.7) and Claude Opus 4.6 (57.3). Terminal-Bench 2.0 jumps to 69.0. For an open-source model to lead the most challenging software engineering benchmark is unprecedented.
The family kept iterating after that. Z.ai released GLM-5.2 on June 13, 2026, extending the context window to 1M tokens while keeping the 744B MoE architecture and MIT license, and reporting a higher SWE-Bench Pro score than GLM-5.1. The setup workflow below stays valid across these point releases — only the model tag and minimum framework version change — but check the relevant Hugging Face model card for the exact version you deploy.
API Pricing: How Much Does GLM-5 Cost to Use?
GLM-5 is available through multiple API providers if you prefer not to self-host.
Official API Pricing
| Provider | Input (per 1M tokens) | Output (per 1M tokens) |
|---|---|---|
| Z.ai (official) | $1.00 | $3.20 |
| OpenRouter (Ambient, FP8) | $0.72 | $2.30 |
For context, here is how this compares to proprietary alternatives:
| Model | Input (per 1M tokens) | Output (per 1M tokens) |
|---|---|---|
| GLM-5 (Z.ai official) | $1.00 | $3.20 |
| GPT-5 (OpenAI) | $1.25 | $10.00 |
| Claude Opus 4.6 (Anthropic) | $5.00 | $25.00 |
| Claude Sonnet 4.6 (Anthropic) | $3.00 | $15.00 |
GLM-5's output pricing is significantly lower than every proprietary frontier model. At $3.20 per million output tokens, it costs roughly one-third of GPT-5 and one-eighth of Claude Opus 4.6 on output-heavy workloads. One caveat affects the real bill: the GLM family runs long reasoning traces, so output-token counts per task tend to sit above more terse models. Independent profiling on Artificial Analysis is the place to check current token-per-task figures before you model your spend, because verbosity partially offsets the per-token savings on reasoning-heavy work.
Through OpenRouter, prices drop further to $0.72/$2.30 via third-party providers running FP8 quantized variants.
How to Self-Host GLM-5 with vLLM and Docker
Self-hosting gives you full control over your data, zero per-token costs after hardware investment, and the ability to fine-tune for your use case. The primary deployment path uses vLLM, which provides an OpenAI-compatible API. If you are deciding between serving engines for a model this size, our comparison of vLLM, SGLang, and TGI covers the throughput and latency tradeoffs in more depth.
Hardware Requirements
GLM-5 in BF16 needs approximately 860 GB of VRAM. The practical minimum is 8x NVIDIA H200 GPUs (141 GB each, totaling 1,128 GB). For the FP8 quantized variant, 8x H100 (80 GB each, 640 GB total) is sufficient. To size a smaller model or a different precision for your own hardware, try our free LLM VRAM calculator.
For quantized GGUF versions from Unsloth, the requirements drop substantially:
| Quantization | Disk Size | Approx RAM/VRAM Needed |
|---|---|---|
| Full BF16 | 1.65 TB | 860+ GB VRAM |
| Dynamic 2-bit GGUF | 241 GB | ~256 GB RAM |
| Dynamic 1-bit GGUF | 176 GB | ~180 GB RAM |
Option 1: vLLM Direct Serve
Install the required dependencies first:
pip install "vllm==0.19.0" --torch-backend=auto
pip install "transformers>=5.4.0"
Then serve the model:
vllm serve zai-org/GLM-5-FP8 \
--tensor-parallel-size 8 \
--gpu-memory-utilization 0.85 \
--speculative-config.method mtp \
--speculative-config.num_speculative_tokens 1 \
--tool-call-parser glm47 \
--reasoning-parser glm45 \
--enable-auto-tool-choice \
--served-model-name glm-5-fp8
Option 2: Docker Deployment
For production deployments, Docker provides isolation and reproducibility:
docker run --gpus all \
-p 8000:8000 \
--ipc=host \
-v ~/.cache/huggingface:/root/.cache/huggingface \
vllm/vllm-openai:glm51 zai-org/GLM-5-FP8 \
--tensor-parallel-size 8 \
--tool-call-parser glm47 \
--reasoning-parser glm45 \
--enable-auto-tool-choice \
--served-model-name glm-5-fp8
If your CUDA version is 13 or higher, use the vllm/vllm-openai:glm51-cu130 image instead.
Option 3: SGLang
SGLang is an alternative serving framework that supports GLM-5 from version 0.5.10:
sglang serve \
--model-path zai-org/GLM-5 \
--tp-size 8 \
--tool-call-parser glm47 \
--reasoning-parser glm45 \
--speculative-algorithm EAGLE \
--speculative-num-steps 3 \
--speculative-eagle-topk 1 \
--speculative-num-draft-tokens 4 \
--mem-fraction-static 0.85 \
--served-model-name glm-5
Testing Your Deployment
Once the server is running, test it with the OpenAI Python client:
from openai import OpenAI
client = OpenAI(
base_url="http://localhost:8000/v1",
api_key="not-needed"
)
response = client.chat.completions.create(
model="glm-5-fp8",
messages=[
{"role": "user", "content": "Explain the MoE architecture in GLM-5."}
],
temperature=0.7
)
print(response.choices[0].message.content)
The vLLM server exposes an OpenAI-compatible API, so any tool or library that works with the OpenAI SDK works with your self-hosted instance without code changes.
Supported Frameworks Summary
| Framework | Minimum Version |
|---|---|
| vLLM | 0.19.0+ |
| SGLang | 0.5.10+ |
| KTransformers | 0.5.3+ |
| Transformers | 5.4.0+ |
| xLLM | 0.8.0+ |
Running GLM-5 Locally with Quantized Models
Not everyone has a rack of H200 GPUs. Unsloth provides quantized GGUF versions of GLM-5 on Hugging Face (unsloth/GLM-5-GGUF) that trade some accuracy for dramatically lower resource requirements.
What Quantization Gives Up
The full BF16 model requires 1.65 TB of disk space. The dynamic 2-bit GGUF brings this down to 241 GB (an 85% reduction), while the 1-bit variant drops to 176 GB (89% reduction). You can run the 1-bit variant on a system with around 180 GB of system RAM using llama.cpp -- no GPU required, though inference will be slower.
For a middle ground, the 2-bit quantization with MoE offloading works on a system with a single 24 GB GPU plus 256 GB of system RAM. Active experts run on the GPU while inactive ones stay in system memory.
Running with llama.cpp
# Download the quantized model
huggingface-cli download unsloth/GLM-5-GGUF \
--include "GLM-5-UD-Q2_K_XL.gguf" \
--local-dir ./models
# Serve with llama.cpp
./llama-server \
-m ./models/GLM-5-UD-Q2_K_XL.gguf \
--host 0.0.0.0 \
--port 8080 \
-ngl 99 \
-c 8192
Quantized models show degraded performance on reasoning-heavy benchmarks. For production agentic workloads, the full FP8 or BF16 model is recommended.
Self-Hosting Failure Modes and How to Avoid Them
A 744B model does not fail gracefully. Most of the pain in a GLM-5 deployment is predictable, and every failure below traces to a spec already documented in this guide. Use this as a pre-flight checklist before you burn GPU hours.
| Failure mode | What actually happens | Root cause | Fix |
|---|---|---|---|
| CUDA out-of-memory on load | Server crashes before serving a single token | BF16 needs ~860 GB VRAM; a single-node 8x A100 (640 GB) cannot hold it | Serve the FP8 variant on 8x H100, or use 8x H200 for BF16; size with the VRAM calculator first |
| Tool calls silently ignored | Model replies in prose instead of emitting tool calls | Missing or wrong --tool-call-parser glm47 / --reasoning-parser glm45 flags |
Set both parsers and --enable-auto-tool-choice exactly as shown in the vLLM command above |
| Server won't start after upgrade | vLLM/SGLang rejects the model config | Framework older than the minimum (vLLM 0.19.0+, SGLang 0.5.10+, Transformers 5.4.0+) | Pin the versions in the framework table; a GLM point release can raise the floor |
| Wrong Docker image for the driver | Container fails to initialize GPUs | CUDA 13+ host paired with the default glm51 image |
Use the vllm/vllm-openai:glm51-cu130 image on CUDA 13+ hosts |
| Token bill higher than projected | API/self-host cost overshoots the estimate | GLM's long reasoning traces inflate output-token counts versus terse models | Model the bill on measured per-task tokens from Artificial Analysis, not a terse-model baseline |
| Throughput below expectations | Sustained generation feels slow under load | GLM-5 (Reasoning) runs ~68.5 output tokens/sec, below the open-weight median of 78.3 t/s | Budget for the lower sustained rate, or scale replicas; time-to-first-token (~1.36s) stays competitive |
| Quantized model reasons worse | 1-bit/2-bit GGUF drops accuracy on reasoning tasks | Aggressive quantization trades precision for footprint | Reserve GGUF for experimentation; run FP8/BF16 for production agentic work |
The pattern across every row: the model works, but only if the serving flags, framework versions, and hardware envelope match the model card. Treat the GLM-5 model card as the source of truth for the exact tag you deploy.
When to Use GLM-5 vs When to Skip It
Before the full decision breakdown below, here is the fast version.
Use GLM-5 when data has to stay on your infrastructure, your workload is agentic (browsing, tool use, long-horizon tasks), your API bill is dominated by output tokens, or you need to fine-tune on proprietary data. These are the cases where the MIT license and agentic benchmark lead pay for the operational cost.
Skip GLM-5 when you have no GPU capacity and no appetite to manage an 8-GPU node, your workload lives or dies on peak coding accuracy or scientific reasoning (Claude Opus 4.5 and GPT-5.2 still lead there), or sustained low latency is a hard SLA. In those cases the Z.ai or OpenRouter API — or a proprietary model — is the pragmatic call, not a self-hosted 744B stack.
The section below expands each side with the specific benchmarks and cost figures behind the call.
When to Choose GLM-5 Over Proprietary Models
The decision depends on your constraints and use case.
Choose GLM-5 When
- Data sovereignty is non-negotiable. Self-hosting means your data never leaves your infrastructure. For regulated industries (healthcare, finance, defense), this eliminates an entire category of compliance risk.
- You need agentic capabilities at scale. GLM-5 leads on BrowseComp and MCP-Atlas, the benchmarks that measure real-world tool use and web interaction. If you are building agents that browse, use tools, and operate autonomously, GLM-5 is purpose-built for this.
- Output-heavy workloads are driving your API bill. At $3.20 per million output tokens versus $25.00 for Claude Opus 4.6, the cost difference is enormous on workloads that generate long outputs (code generation, report writing, document processing).
- You want to fine-tune. The MIT license and available weights mean you can fine-tune GLM-5 on your proprietary data. No proprietary frontier model offers this.
Choose Proprietary Models When
- You need peak coding accuracy. Claude Opus 4.6 (80.9 SWE-bench Verified) and GPT-5.2 (80.0) still lead GLM-5 (77.8) on code-specific benchmarks by a meaningful margin.
- Scientific reasoning is critical. GPT-5.2 scores 92.4 on GPQA-Diamond versus GLM-5's 86.0. For research and academic applications, this gap matters.
- You do not want to manage GPU infrastructure. Self-hosting a 744B-parameter model requires significant operational expertise and hardware investment. If your team does not have this capability, API access is the pragmatic choice.
- Latency is paramount. Artificial Analysis measures GLM-5 (Reasoning) at about 68.5 output tokens per second — below the open-weight median of 78.3 t/s — with a competitive 1.36-second time to first token. Time to first token is good, but sustained output speed trails peers, and proprietary providers with dedicated infrastructure often deliver more consistent latency guarantees at scale. Check the provider you actually plan to use, since speed varies widely between hosts.
GLM-5 Adoption Checklist
Run through these questions before committing GLM-5 to a workload. Answering them in order keeps the decision tied to your constraints rather than the leaderboard.
- Define the workload. Is it agentic (browsing, tool use, long-horizon tasks) or code-accuracy-first? GLM-5 leads on the former and trails Claude Opus 4.5 and GPT-5.2 on SWE-bench Verified. Pick the model that wins your category, not the highest average.
- Decide API vs self-host. If you cannot dedicate at least 8x H100 (FP8) or 8x H200 (BF16), start on the Z.ai or OpenRouter API and revisit self-hosting only when per-token cost or data residency forces it.
- Model the real token bill. Multiply your expected output tokens by the verbose-reasoning tendency above, not by a terse-model baseline. Confirm current per-task token counts on Artificial Analysis before signing off on a budget.
- Pin versions. Choose GLM-5, 5.1, or 5.2 deliberately and record the exact Hugging Face tag plus the minimum vLLM/SGLang version. A point release can change the required serving image.
- Set a quality gate. Run your own held-out task set against GLM-5 and your current model on the same prompts. Adopt only if GLM-5 matches or beats it on your metric — vendor and third-party benchmarks do not prove performance on your data.
- Plan the exit. Because everything ships under MIT, confirm you can fine-tune and redeploy in-house if a provider changes terms. That portability is the actual reason to prefer an open-weight frontier model.
If you would rather have that quality gate run and documented as a citable evidence package — fixed task set, pass criteria defined up front, model IDs and costs published — the Proof Studio method is built for exactly that comparison.
What Effloow Added
Z.ai's release is a model card and an API price. A team weighing self-hosting versus the API needs the cost-and-hardware reality, with the headline numbers traceable. We added that:
- Benchmark scores tied to the official HF model card, compared against GPT-5.2 and Claude Opus 4.5 so the "competes with frontier" claim is checkable, not asserted.
- A pricing table across Z.ai and OpenRouter next to proprietary alternatives, making the cost gap concrete — with a note to verify current rates, since model pricing moves and a 744B model's API price is not static.
- A self-host-with-vLLM reality check plus a when-to-choose-GLM-5-over-proprietary section, so the MIT license becomes a deployment decision rather than a talking point.
- Independent performance numbers from Artificial Analysis (output speed and time to first token) instead of vendor throughput claims, so the latency picture is third-party rather than self-reported.
- A six-step adoption checklist that turns the comparison into a repeatable decision: define the workload, model the real token bill, pin the version, and gate on your own held-out task set before adopting.
- A self-hosting failure-mode table that maps the seven most common deployment failures — OOM on load, ignored tool calls, version mismatches, token-bill overruns — to their root cause and fix, each traceable to a spec in the model card.
The value is the self-host-vs-API decision with sources attached, not a restatement of the leaderboard.
Primary sources checked (current as of 2026-06-29):
- GLM-5 Hugging Face model card: https://huggingface.co/zai-org/GLM-5
- GLM-5.1 Hugging Face model card: https://huggingface.co/zai-org/GLM-5.1
- GLM-5.2 Hugging Face model card: https://huggingface.co/zai-org/GLM-5.2
- Z.ai API pricing: https://z.ai
- Artificial Analysis GLM-5 performance and price analysis: https://artificialanalysis.ai/models/glm-5
Key Takeaways
-
GLM-5 is the first MIT-licensed model to genuinely compete with GPT-5.2 and Claude Opus 4.5 across major benchmarks. With 744B total parameters (40B active) and pre-training on 28.5T tokens, it delivers frontier-tier performance.
-
Benchmark performance is strong but not universally leading. GLM-5 excels on agentic benchmarks (BrowseComp, HLE with tools, MCP-Atlas) but trails on GPQA-Diamond and SWE-bench Verified. Its successor GLM-5.1 already leads SWE-Bench Pro.
-
API pricing undercuts proprietary competitors significantly. At $1.00/$3.20 per million tokens (input/output) through Z.ai, it costs a fraction of Claude Opus 4.6 ($5.00/$25.00) and less than GPT-5 ($1.25/$10.00) on output.
-
Self-hosting requires serious hardware. The full model needs 8x H200 GPUs (860+ GB VRAM). FP8 quantization brings this to 8x H100. Unsloth's 2-bit GGUF enables CPU-only inference at 241 GB, but with accuracy tradeoffs.
-
Deployment is straightforward with vLLM or Docker. A single
vllm serveordocker runcommand with tensor parallelism gets you an OpenAI-compatible API endpoint. SGLang, KTransformers, and xLLM are also supported. -
The MIT license is the real differentiator. Beyond benchmark scores, the freedom to modify, fine-tune, and commercially deploy without restrictions makes GLM-5 uniquely valuable for enterprises building proprietary AI products.
-
Watch GLM-5.1 closely. Released April 7, 2026, it claims number one on SWE-Bench Pro (58.4) and substantially improves Terminal-Bench 2.0 scores. The GLM model family is iterating fast.
Conclusion
GLM-5 represents a genuine inflection point for open-source AI. Previous open-weight models competed well on specific tasks but never across the full range of frontier benchmarks simultaneously. GLM-5 does, under the most permissive license available.
For teams evaluating self-hosted AI infrastructure, the calculus has changed. You no longer need to accept a significant performance penalty to gain data sovereignty and fine-tuning capability. The gap between open-source and proprietary frontier models has narrowed to single-digit percentage points on most benchmarks, and on agentic tasks like BrowseComp, GLM-5 actually leads.
The practical barriers remain real: 860 GB of VRAM is not trivial. But with FP8 quantization, Docker deployment, and multiple serving frameworks, the path from download to production API endpoint is more accessible than ever.
Whether you deploy via the Z.ai API or self-host on your own GPUs, GLM-5 has earned its place in the evaluation set for any AI infrastructure decision in 2026.
Get the next one
in your inbox.
One short weekly dispatch with new guides, tools, and what we tested. No spam, unsubscribe anytime.
Get weekly AI tool reviews & automation tips
Join our newsletter. No spam, unsubscribe anytime.
More in Articles
Step-by-step guide to self-hosting RAGFlow v0.25 with Docker Compose — deep document understanding, chunking strategies, MCP server, and the Python SDK.
MiMo-V2.5-Pro: MIT-licensed 1T-param MoE model matching Claude Opus 4.6 on SWE-bench at 8x lower API cost. Benchmarks, API setup, and self-hosting guide.
DeepSeek V4-Pro (1.6T MoE, 1M context) and V4-Flash released April 2026. Migrate before the July 24 deadline. Full API guide, benchmarks, pricing.
Learn to fine-tune LLMs with LoRA and QLoRA in 2026. VRAM requirements, dataset prep, Unsloth/Axolotl setup, hyperparameters, and evaluation.
Tools you can use
Free calculator: compare the monthly cost of an LLM API against self-hosting on your own GPU, and find the token volume where self-hosting starts to win.
Compare AI models side-by-side: pricing, context windows, multimodal support, and speed. Interactive matrix for Claude, GPT, Gemini, Llama, and more.