Zhipu AI's GLM-4-9B-Chat Shrinks From 18.8 GB to Fit Any Consumer GPU
A full spread of imatrix quantizations lets you run Zhipu's 128K-context, Llama-3-beating 9B chat model locally, from 3GB up to 19GB.
ProTakeaways
- Full GGUF quant ladder for GLM-4-9B-Chat, from 1-bit (3.1GB) to BF16 (18.8GB).
- Base GLM-4-9B-Chat beats Llama-3-8B on MMLU, C-Eval, GSM8K, HumanEval.
- Supports 128K context, function calling, code execution, and 26 languages.
- One-line install via Ollama, llama.cpp, LM Studio, vLLM, or Docker.
- IMatrix calibration applied only to lower-bit quants where it actually helps.
- Over 870,000 downloads make it the de-facto local build of GLM-4-9B.
GLM-4-9B-Chat is a capable 9B Chinese-English chat model from Zhipu AI, but its BF16 checkpoint weighs in at 18.8 GB — enough to scare off anyone without a workstation GPU. The legraphista/glm-4-9b-chat-IMat-GGUF repository fixes that with a full imatrix quantization ladder covering 1-bit through 16-bit precision, and with over 870,000 downloads on the Hub, it has become one of the most-used conversions available.
What the repo contains
These are llama.cpp imatrix quantizations of the original BF16 weights. The "IMat" in the name refers to an importance matrix — a calibration file derived from a text dataset that tells the quantizer which weights carry the most signal, reducing the quality loss from aggressive compression. The IMatrix is applied only to lower-precision quants; community testing on HellaSwag-style benchmarks shows higher quants see negligible benefit from it.
The quant ladder is unusually complete. Here are the levels most developers will reach for:
| Quant | Size | Typical use |
|---|---|---|
| BF16 / FP16 | 18.8 GB | Reference quality |
| Q8_0 | 9.99 GB | Near-lossless |
| Q6_K | 8.26 GB | High quality, smaller footprint |
| Q4_K | 6.25 GB | Fits 8 GB GPUs comfortably |
| Q3_K | 5.06 GB | 6 GB VRAM territory |
| Q2_K | 3.99 GB | Very small hardware |
| IQ1_S | 3.10 GB | Experimental; expect quality loss |
Why GLM-4-9B is worth your disk space
GLM-4-9B is Zhipu AI's latest open-source pre-trained model in the GLM-4 series. Its chat-tuned variant, GLM-4-9B-Chat, scores 6.61 on AlignBench-v2, 8.35 on MT-Bench, 72.4 on MMLU, 75.6 on C-Eval, 79.6 on GSM8K, 50.6 on MATH, and 71.8 on HumanEval — beating Llama-3-8B-Instruct and ChatGLM3-6B across all those categories.
Beyond benchmarks, the chat variant ships capabilities still uncommon at this scale: multi-round conversation, web browsing, code execution, function calling, and a 128K context window. This generation also added support for 26 languages, including Japanese, Korean, and German. A separate GLM-4-9B-Chat-1M variant extends context to one million tokens.
Running it
The repo integrates directly with most local runtimes. For llama.cpp:
llama serve -hf legraphista/glm-4-9b-chat-IMat-GGUF:Q4_K_S
For Ollama:
ollama run hf.co/legraphista/glm-4-9b-chat-IMat-GGUF:Q4_K_S
LM Studio, Jan, vLLM, Docker Model Runner, and Unsloth Desktop are all supported. To pull a specific file manually:
pip install -U "huggingface_hub[cli]"
huggingface-cli download legraphista/glm-4-9b-chat-IMat-GGUF \
--include "glm-4-9b-chat.Q4_K.gguf" --local-dir ./
GLM uses its own chat template with [gMASK]<sop> and <|user|> / <|assistant|> tokens rather than Llama or ChatML style. If your inference wrapper does not auto-apply it, the model will receive malformed prompts and respond accordingly.
Strengths and limits
Chinese is the obvious standout: GLM-4-9B scores 81.5% on C-Eval, among the highest for open 9B-class models on Chinese-language benchmarks. English math and code performance are also strong for the size class, and the 128K context window can realistically hold a full codebase or a long PDF. Quality can degrade on very long contexts in practice, despite the official 128K ceiling. The very low-bit quants — IQ1 and IQ2 — are curiosities rather than deployment targets; even with imatrix calibration, they hallucinate and lose instruction-following reliability.
Choosing your quant
- 12 GB or more of VRAM: Q6_K or Q8_0 for near-reference quality.
- 6–8 GB GPU or Apple Silicon with modest RAM: Q4_K_S is the standard choice.
- Chinese-heavy workloads, function calling, or long-context RAG on a single machine: this is arguably the most capable 9B option that fits on consumer hardware.
- English-only reasoning or coding: benchmark against Qwen 2.5 7B and Llama 3.1 8B before committing.
The workflow itself is now routine: a lab releases weights, community contributors produce a calibrated quant ladder within days, and it lands directly into Ollama, LM Studio, and vLLM without manual conversion work. Boring, in the best possible way.