GLM-4 9B
ToolsZhipu AI · 9B · Dense
Multilingual model supporting 26 languages with 128K context
199.2K
703
2024-06
128K tokens
Use cases
Your hardware
16 GB Reference Desktop
Quantization options
What is quantization?| Quant | Bits | VRAM | Disk | Quality | Status |
|---|---|---|---|---|---|
| Q2_K | 2 | 3.4 GB | 2.8 GB | low | Runs great · ~59 t/s |
| Q3_K_M | 3 | 4.5 GB | 3.9 GB | moderate | Runs well · ~45 t/s |
| Q4_K_M | 4 | 5.1 GB | 4.4 GB | good | Runs well · ~40 t/s |
| Q5_K_M | 5 | 6.3 GB | 5.5 GB | good | Runs well · ~32 t/s |
| Q6_K | 6 | 7.4 GB | 6.6 GB | excellent | Decent · ~27 t/s |
| Q8_0 | 8 | 9.7 GB | 8.8 GB | excellent | Tight fit · ~21 t/s |
| F16 | 16 | 18.9 GB | 17.6 GB | lossless | Barely runs · ~5 t/s |
About this model
GLM-4 9B is a 9B dense transformer from Zhipu AI in the GLM family, designed primarily for chat, multilingual, code workflows. Supports structured tool calling; use Q4_K_M or higher when strict JSON schema adherence matters. Supports up to 128K context tokens; start at 4K–8K with Q8_0 KV cache on tight GPUs.
Hardware planning baselines start at 5 GB minimum memory and 8.4 GB recommended memory. At Q4_K_M, weights plus baseline runtime overhead use roughly 5.1 GB of RAM/VRAM and 4.4 GB of disk space. As a 9B dense checkpoint, every parameter participates in each token forward pass, meaning decoding speed scales linearly with GPU memory bandwidth and drops sharply if layers spill over PCIe into host DDR5 RAM.
Deploy GLM-4 9B locally via Ollama (`glm4:9b`), Ollama with Flash Attention enabled. Under GLM-4 Model License, review official weight cards before commercial redistribution.
Highlights
- Local Fit Baseline5 GB minimum and 8.4 GB recommended RAM/VRAM.
- Primary QuantQ4_K_M targets 5.1 GB memory and 4.4 GB disk.
- Context & Capabilities128K max context · Dense · Tool calling.
System requirements by device
Memory planning targets 5 GB minimum RAM/VRAM and 8.4 GB recommended memory. The baseline quant is Q4_K_M, estimated at 5.1 GB memory and 4.4 GB disk. Actual runtime usage shifts with context length, KV cache precision, and OS background overhead.
| Device | Notes |
|---|---|
| Mac (Apple silicon) | Use unified memory headroom (~75% physical RAM max) as the primary fit signal. Start with Q4_K_M and close heavy browser tabs first. |
| Windows / Linux GPU | Keep weights plus KV cache inside dedicated VRAM so Windows WDDM does not spill layers over PCIe into Shared GPU Memory. |
| Android | Feasible on 8–16 GB phones via AI Edge Gallery or PocketPal when keeping context short (2K–4K) and closing background apps. |
| iPhone / iPad | Target 8 GB+ Pro iPhones or M-series iPads with Q4_K_M and 2K–4K context so allocations stay below iOS Jetsam ceilings. |
Start with a short session and leave memory for the operating system. A file fitting on disk does not guarantee that it will load in memory.
Estimated memory by quantization
These are rough estimates, not tested minimum requirements. Check the actual file and runtime documentation; context, offloading and operating-system overhead can change the memory needed.
| Quant Tier | Estimated memory | Disk Size | Quality |
|---|---|---|---|
| Q2_K | 3.4 GB | 2.8 GB | low |
| Q3_K_M | 4.5 GB | 3.9 GB | moderate |
| Q4_K_M | 5.1 GB | 4.4 GB | good |
| Q5_K_M | 6.3 GB | 5.5 GB | good |
| Q6_K | 7.4 GB | 6.6 GB | excellent |
| Q8_0 | 9.7 GB | 8.8 GB | excellent |
| F16 | 18.9 GB | 17.6 GB | lossless |
How to run GLM-4 9B on your device
Start with a short prompt and the smallest quant that still gives the quality you need. A clean first run is more useful than loading a larger file with no memory headroom.
Run GLM-4 9B on Mac
- Install Ollama or LM Studio on macOS Apple Silicon.
- Pull Q4_K_M (5.1 GB) first and confirm it stays below ~75% of your Mac's unified memory.
- Enable Flash Attention and cap initial context at 8K until memory pressure stays below 8.4 GB.
- Consult the Mac guide for Activity Monitor tuning and Metal offload tips.
Run GLM-4 9B on Windows
- Install LM Studio for Windows for visual VRAM inspection, or Ollama when you want a localhost API endpoint.
- Load Q4_K_M (~5.1 GB) and verify Dedicated GPU Memory stays within VRAM without spilling into Shared GPU Memory.
- Reserve at least 5 GB memory minimum and target 8.4 GB for comfortable context growth.
- Enable Q8_0 KV cache or drop one quant tier if generation slows down over PCIe.
Run GLM-4 9B on Android
- Use AI Edge Gallery or PocketPal AI on an Android phone with at least 8–12 GB RAM.
- Select Q4_K_M or a smaller mobile-sized quant (~5.1 GB) and keep context at 2K–4K.
- Close background camera and browser apps before loading so Android LMK does not kill the process.
- Consult the Android guide for SoC thermal and NPU/GPU delegate tips.
Run GLM-4 9B on iPhone or iPad
- Install PocketPal or a Metal-enabled llama.cpp iOS client on an 8 GB+ iPhone or M-series iPad.
- Import Q4_K_M via Files and keep initial context at 2048 tokens to stay beneath iOS Jetsam limits.
- Test one short text prompt before running multi-turn chats.
- Move to a Mac if iOS terminates the app due to memory pressure.
GLM-4 9B vs alternatives
| Model | Params | Context | Min RAM | License |
|---|---|---|---|---|
| GLM-4 9B | 9B | 128K | 5 GB | GLM-4 |
| GLM-4.5 Air | 106B (12B active) | 128K | 59.2 GB | MIT |
| GLM-4.6 | 357B (32B active) | 195K | 199.5 GB | MIT |
| GLM-5 | 744B (40B active) | 128K | 415.7 GB | MIT |
| GLM-5.2 | 753B (40B active) | 1M | 420.8 GB | MIT |
| GLM-5.3 | 753B (40B active) | 1M | 420.8 GB | MIT |
Use this table to choose the smallest nearby model that still matches the job. A related model with lower RAM can be the better local choice when the current page fits only at the edge of available memory.
Frequently asked questions
- What is GLM-4 9B?
- GLM-4 9B is a 9B dense transformer from Zhipu AI, supporting up to 128K tokens with 5 GB minimum RAM and 8.4 GB recommended RAM.
- How much VRAM or RAM does GLM-4 9B require?
- At Q4_K_M, GLM-4 9B occupies roughly 5.1 GB of active memory and 4.4 GB on disk. Add 2–6 GB of spare headroom for KV cache buffers, runtime scratch space, and OS apps (8.4 GB recommended).
- What is the best way to run GLM-4 9B locally?
- Use `ollama run glm4:9b` for a quick CLI/API setup, or load Q4_K_M in LM Studio or llama.cpp with Flash Attention enabled when you want explicit KV cache and layer control.
- Can GLM-4 9B run on Android or iPhone?
- Yes, on flagship 8–16 GB Android phones (via AI Edge Gallery or PocketPal) or 8 GB+ iPhones when capped to Q4_K_M and short 2K–4K context windows.
- How does GLM-4 9B compare to GLM-4.5 Air?
- GLM-4.5 Air (106B, 59.2 GB min RAM) sits closest in size. Compare active parameters, context ceiling (128K vs 128K), and license terms (GLM-4) before switching.