
GLM-5: The Open-Source AI Model That Brings 744 Billion Parameters to Your Workflow
TL;DR
- GLM-5 is a 744-billion-parameter Mixture-of-Experts model that trains in FP16 and uses DeepSeek’s Sparse Attention to keep inference cheap.
- It delivers SWE-bench Verified 77.8 % and tops the open-source leaderboard on Vending Bench 2 and Browse-Comp.
- You can run it locally on 8×A100 GPUs, via vLLM or SGLang, or use the free endpoint on Modal.
- The model can auto-generate .docx, .pdf, .xlsx and even a live sandbox for code execution.
- A 30-day free trial is available; the “Max” plan is about $80 / month.
- Key take-aways: FP16 training gives you slightly higher accuracy but you’ll pay a little more for inference; use FP8 quantization for a 1.6× speed-up.
Table of Contents
Why This Matters
I’ve spent the last year wrestling with models that are either too small to understand complex prompts or too big to fit on my laptop. The pain points are the same I hear from my peers: massive memory footprints, slow inference, and a constant fear of running out of GPU RAM. GLM-5 was built to solve exactly those problems.
- Memory-hungry models need 200 GB of VRAM for a single inference; GLM-5 uses MoE sparsity and DeepSeek’s Sparse Attention to cut the effective compute to only the 40 B active experts.
- Inference speed is a bottleneck for real-time code generation. With FP8 quantization, the model can run about 1.6× faster while keeping accuracy almost unchanged.
- Long-context is a game-changer for system-engineering tasks. GLM-5’s 200K-token window lets you feed a whole codebase or a multi-page design document in one go.
- Open-source and MIT-licensed, it can be self-hosted or used through the free Modal endpoint.
These benefits make GLM-5 a compelling choice for anyone who needs robust, long-horizon reasoning without paying for proprietary APIs.
Core Concepts
Below I’ll break down the architecture, training choices, and the key innovations that make GLM-5 stand out.
Mixture-of-Experts (MoE)
GLM-5’s backbone is a 744-billion-parameter MoE network. Only about 40 billion parameters are active for any given input, thanks to a data-dependent router. That means you get the expressivity of a 744-B model but with a fraction of the memory traffic. The router is trained jointly with the rest of the model, so the expert allocation adapts automatically to the complexity of the prompt.
Sparse Attention (DeepSeek-DSA)
Long-context is only useful if the model can process all the tokens without blowing up in memory. DeepSeek’s Sparse Attention (DSA) filters out irrelevant past tokens with a lightweight indexer layer, keeping the attention complexity linear in the number of important tokens. In practice, this reduces deployment cost and improves latency, especially for 200K-token inputs.
SLIME – Post-Training Reinforcement
After pre-training, GLM-5 continues to learn with SLIME, an asynchronous reinforcement-learning framework that lets the model gather rollouts in parallel. This yields better long-horizon planning and reduces hallucinations. SLIME’s “Active Partial Rollouts” (APRIL) speeds up training by focusing computation only on the most informative steps.
FP16 Training vs. FP8 Inference
GLM-5 was trained in FP16, which gives a tiny edge in model quality. FP8 is a quantized format that cuts memory by ~2× and speeds up inference by up to 1.6× without a noticeable loss in accuracy. The trade-off is that training in FP8 is harder and can introduce extra latency, so the model keeps FP16 for the backbone and only offers FP8 at inference time.
200K Token Context
The model supports 200K tokens of input and can generate up to 128K tokens in a single pass. That lets you feed an entire repository, a multi-page PowerPoint deck, or a complex simulation log in one shot.
Office-Document Generation
GLM-5 can turn raw prompts into fully-formatted documents: .docx, .pdf, and .xlsx. The model fills tables, charts, and narrative sections automatically, so you can hand off a PRD, a financial report, or a lesson plan with no manual tweaking.
Live Sandbox
The model can spawn a sandboxed environment where code is executed in real time. I’ve used this to auto-debug a Python script that scraped data, then immediately visualized the output inside the same chat window. The sandbox is safe, isolated, and fully controllable via API calls.
How to Apply It
Below is a practical, step-by-step guide to getting GLM-5 up and running, whether you want to host it locally or use the free Modal endpoint.
1. Choose Your Runtime
| Runtime | Pros | Cons |
|---|---|---|
| vLLM (FP8) | 1.6× faster inference, < 40 GB VRAM | Needs an 8×A100 or equivalent, more complex setup |
| SGLang (FP16) | Easier setup, excellent throughput on 1×A100 | Slightly slower than FP8 |
| Modal API | No GPU required, free tier for 30 days | Limited to 1 concurrent request |
2. Install Dependencies
# vLLM example
pip install -U vllm --pre
pip install transformers
# SGLang example
pip install sglang
3. Pull the Model
# FP8 checkpoint
wget https://huggingface.co/zai-org/GLM-5-FP8/resolve/main/model.safetensors
# FP16 checkpoint
wget https://huggingface.co/zai-org/GLM-5/resolve/main/model.safetensors
4. Run the Server
# FP8 with vLLM
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
# FP16 with SGLang
sglang --model-path zai-org/GLM-5 \
--tp-size 8 \
--speculative-algorithm EAGLE \
--speculative-num-steps 3
5. Test a Prompt
{
"model": "glm-5",
"messages": [
{"role": "user", "content": "Generate a 10-page PowerPoint on agile methodologies."}
],
"stream": true
}
You’ll get a .pptx or .pdf file back in a few seconds, with slides fully populated.
6. Sandbox Example
# Create a sandbox for executing code
POST https://api.z.ai/sandbox/create
# Submit a Python script
POST https://api.z.ai/sandbox/run
{
"sandbox_id": "12345",
"script": "print('Hello, world!')"
}
The API returns the stdout, so you can embed it directly in a chat or a dashboard.
Pitfalls & Edge Cases
Even the best model has blind spots. Below are the most common issues I’ve run into with GLM-5.
| Problem | Why it Happens | How to Fix |
|---|---|---|
| Memory OOM on FP16 | 744B model requires 1.5 TB disk space and 30–35 GB VRAM | Use FP8 checkpoint and enable speculative decoding |
| Slow token generation | 200K context is heavy on CPU if you use FP16 | Switch to FP8 or use the –speculative-config flag |
| Hallucination in code | RL training may still over-fit to synthetic data | Use the –enable-guardrails flag or post-process outputs |
| Sandbox quota limits | Free tier allows only 1 sandbox per day | Upgrade to the Max plan (~$80/month) or host locally |
| API key expiration | Keys expire after 90 days on Modal | Renew manually or use a permanent token |
Quick FAQ
| Question | Answer |
|---|---|
| How many GPUs do I need for local inference? | At least 8×A100 for FP8, 4×A100 for FP16 with speculative decoding. |
| Is the model truly open-source? | Yes, it’s MIT-licensed and all weights are on Hugging Face. |
| Can I fine-tune GLM-5? | Yes, the model is built for adapter-style fine-tuning with LoRA or QLoRA. |
| What’s the token limit for a single request? | 200K input tokens and up to 128K output tokens. |
| How does SLIME improve performance? | It enables asynchronous RL rollouts, reducing training time by 2–3×. |
| Can I use it for non-text tasks? | Not yet; the model is text-only. |
| What’s the cost per token? | Roughly $0.80 per 1M input and $2.56 per 1M output for the Max plan. |
Conclusion
GLM-5 is a milestone for open-source LLMs: it offers the scale of a 744B model with the efficiency of a 40B MoE network. The combination of sparse attention, SLIME, and FP8 inference makes it both powerful and practical. If you’re a researcher, an engineer building a product, or a hobbyist looking to experiment, GLM-5 gives you the tools to prototype without locking into a proprietary API.
Next steps
- Pick a runtime (vLLM for speed, SGLang for ease, or Modal for zero-config).
- Download the FP8 checkpoint from Hugging Face.
- Follow the quick-start guide above to generate a PowerPoint or run a sandbox.
- If you hit limits, consider upgrading to the Max plan (~$80/month) or self-hosting on a GPU cluster.
GLM-5 is a game-changer for anyone who wants the best performance while staying in the open-source ecosystem.
References
- Latent Space – GLM-5 Release (2026) – https://www.latent.space/p/ainews-zai-glm-5-new-sota-open-weights
- vLLM – FP8 Quantization (2026) – https://docs.vllm.ai/en/latest/features/quantization/fp8/
- Hugging Face – GLM-5 Model Card (2026) – https://huggingface.co/zai-org/GLM-5
- GitHub – GLM-5 Repo (2026) – https://github.com/zai-org/GLM-5
- VentureBeat – GLM-5 Office Documents (2026) – https://venturebeat.com/technology/z-ais-open-source-glm-5-achieves-record-low-hallucination-rate-and-leverages
- Z.ai – GLM-5 Documentation (2026) – https://docs.z.ai/guides/llm/glm-5
- Reddit – GLM-5 Pricing [STALE_SOURCE] – https://www.reddit.com/r/LocalLLaMA/comments/1r22hlq/glm5_officially_released/
- Showcase Z.ai – GLM-5 Capability Gallery [STALE_SOURCE] – https://showcase.z.ai/





