GLM-4.7 Flash Guide: A 30B-A3B Agent Model You Can Run Locally
GLM-4.7 Flash is a 30B-total, 3B-active MoE with MIT weights, a 200K context and a free tier on Z.ai. Its benchmarks, local setup, and when to step up.
Small open models used to be good at chat and bad at agents. They could answer a question but fell apart when asked to call tools across a dozen turns. GLM-4.7 Flash is interesting because its published numbers are concentrated precisely on the agent side, where models of its size have historically been weakest.
It is a 30B-class model that runs on hardware a developer might own, ships under MIT, and is served free on Z.ai's own API. OpenRouter lists it from January 2026. This guide covers what it is, how to read its benchmark table, how to run it, and when to move up to the full GLM-4.7.
30B total, 3B active
Z.ai's model card describes GLM-4.7 Flash as a 30B-A3B mixture-of-experts model: about 30B total parameters, about 3B active per token. That ratio is the reason it is fast. Each token costs roughly the compute of a 3B dense model, while the full 30B is available to the router. Mixture of experts explained covers why that works.
The memory requirement still follows the total, not the active count. You need room for all 30B parameters, which is why quantised builds matter so much for local use.
Z.ai's documentation lists a 200K context window and a 128K maximum output, text only. The model card recommends turning on Preserved Thinking, which keeps reasoning from earlier turns, for multi-turn agent tasks.
Reading the benchmark table carefully
The model card compares GLM-4.7 Flash with Qwen3-30B-A3B-Thinking-2507 and GPT-OSS-20B, two models of similar size:
- SWE-bench Verified: 59.2, against 22.0 and 34.0
- tau2-Bench: 79.5, against 49.0 and 47.7
- BrowseComp: 42.8, against 2.29 and 28.3
- GPQA: 75.2, against 73.4 and 71.5
- AIME 25: 91.6, against 85.0 and 91.7
- LiveCodeBench v6: 64.0, against 66.0 and 61.0
Two observations. First, the reasoning rows are close: GPT-OSS-20B edges it on AIME 25 and Qwen3 leads on LiveCodeBench. The large gaps are all on agentic benchmarks, which is consistent with what Z.ai says it optimised for. Second, these are vendor-run numbers, and agent benchmarks are especially sensitive to the harness. A 59.2 on SWE-bench Verified from a 3B-active model is a strong claim; verify it on your own tasks before relying on it. How to benchmark LLMs on your own work shows how.
Running it locally
The weights are on Hugging Face, and the card points to several routes:
- Docker Model Runner:
docker model run hf.co/zai-org/GLM-4.7-Flash - llama.cpp, Ollama and LM Studio through community quantisations listed on the Hugging Face page
- vLLM, which at release needed a nightly build and the Transformers main branch, with MTP speculative decoding and a
glm47tool-call parser - SGLang, with EAGLE speculative decoding; Blackwell GPUs need extra flags
For agent use, make sure your server enables the tool-call parser. Without it the model's tool calls arrive as plain text, and the client sees no calls at all. That is a common reason a local model looks bad at agents when it is not. Where quantised models lose quality is worth reading before picking a 4-bit build for tool-heavy work.
Settings that change results
The card gives different settings per job, and they are not cosmetic:
- General use: temperature 1.0, top-p 0.95.
- SWE-bench and Terminal Bench style coding: temperature 0.7, top-p 1.0, max new tokens 16,384.
- tau2-Bench style tool use: temperature 0, max new tokens 16,384.
- Multi-turn agent tasks: enable preserved thinking, so reasoning from earlier turns is kept rather than regenerated.
The published scores were produced with these settings. If your agent runs with different sampling or with preserved thinking off, do not expect to reproduce them; match the card first, then change one setting at a time.
Free, FlashX, or a paid host
Z.ai serves GLM-4.7 Flash free on its API and offers a faster FlashX tier at $0.07 per million input tokens and $0.40 output. OpenRouter listed GLM-4.7 Flash at about $0.06 input and $0.40 output at the time of writing. Free tiers come with rate and concurrency limits that change, so do not build a production dependency on one; free AI API tiers compared covers what to check.
When to step up to GLM-4.7
Z.ai claims open-source state-of-the-art scores among models of comparable size on SWE-bench Verified and tau2-Bench, and positions Flash as a lightweight option, not as a replacement for GLM-4.7. The full model reports 73.8% on SWE-bench Verified, well above Flash's 59.2, at $0.60 input and $2.20 output on Z.ai.
- Use Flash for local or offline work, privacy-sensitive code, high-volume bounded tasks, and as the first tier in a routing setup.
- Use GLM-4.7 for long unattended runs and tasks where a failed attempt costs more than the tokens.
For coding agents, a test suite makes a natural escalation trigger: let Flash attempt the change, and hand the task to GLM-4.7 only when the tests still fail. Both are served through the same Z.ai API, so the switch is a model-id change.
Common questions
How big is GLM-4.7 Flash?
Z.ai describes it as a 30B-A3B mixture-of-experts model: about 30B total parameters with about 3B active per token. Memory needs follow the 30B total.
Is GLM-4.7 Flash free?
It is free on Z.ai's own API, subject to rate limits, and the weights are MIT-licensed for self-hosting. Paid hosts and Z.ai's faster FlashX tier charge a few cents per million input tokens.
Can I run GLM-4.7 Flash with Ollama?
Yes. The model card points to community quantisations for llama.cpp, Ollama and LM Studio, plus Docker Model Runner. Check that your runtime parses tool calls before using it in an agent.