How much VRAM does GLM-5.1 754B (MoE) need at Q4_K_M? Zhipu 200K frontier
By TechCompare · Updated · How we check
Self-hosting GLM-5.1 in resident mode needs about 531 GB. That takes at least 7 datacenter cards of 80 GB with NVLink, or 4 H200 cards of 141 GB. For typical applications, the official API is usually the cheaper starting point.
Calculator
Estimated VRAM required
531 GB
754B params at Q4_K_M, 200,000 token context, batch 1, inference.
Estimate accuracy: Weights within ~3% of most GGUF files from Q4_K_M up, ~7% for Q3_K_M and Q2_K. KV cache within ~5% for standard GQA models, ~10% for MLA or hybrid state estimates. Real VRAM may vary with framework (vLLM vs llama.cpp vs Transformers), Flash Attention, and driver overhead.
Hardware that fits
Unified memory machines show a model budget, not their installed memory. We hold back 8 GB for the system, or use the vendor's GPU limit when that's lower. It's a planning estimate, not a hard limit.
No single card or machine in our catalog has enough memory. The multi-GPU setups below do.
Multi-GPU setups
Pooled cards show up once a model outgrows the biggest single card of that kind. Each card past the first keeps about 1 GB for its own buffers, and that's counted here. Your inference engine has to support the split, and speed also depends on how the cards connect.
Just barely too small
GLM-5.1 754B at Q4_K_M with native 200K context needs about 531 GB of VRAM with all experts resident in GPU memory. That's the baseline you'll size production cluster deployments against. This giant Mixture of Experts from Zhipu activates 40B parameters per token from its 754B total parameter pool.
That doesn't shrink what has to stay loaded, because different tokens pick different experts.
How this is calculated
Zhipu built GLM-5.1 with 78 layers and hidden size 6144. Each layer stores a compressed latent instead of full keys and values. The 754B parameter pool at Q4_K_M requires 460 GB of weights regardless of routing. At the maximum native context window of 200K tokens, the FP16 key-value cache uses 22 GB of memory. Standard activation and software overhead scale with model size, adding about 49 GB. You'll need high-bandwidth hardware to run this MoE at acceptable speeds.
Verdict
The FP16 KV cache at the 200K native context holds 704 values per token in each of the 78 layers: a 512 value MLA latent, a 64 value rope key and a 128 value index key for sparse attention. The 40B active count doesn't shrink the 531 GB resident total, because any token can route to any expert.
Capping context is the lever you control: at 64K the cache falls to about 8 GB. The full 200K resident case is for serious infrastructure budgets and rarely beats the hosted API on cost.
More GLM scenarios
Related guides
Frequently asked questions
What hardware is best to run GLM-5.1 in full resident mode?
Can I run this model on consumer hardware?
Can I run GLM-5.1 754B on consumer hardware?
What does expert offload feel like in practice?
Related tools
RAM Latency Calculator
Convert DDR3/DDR4/DDR5 timings (CL, tRCD, tRP, tRAS) into true latency in nanoseconds.
Use toolPower Cost Estimator
Estimate annual electricity costs for your PC, Server, or TV.
Use toolData Transfer Calculator
Calculate file transfer time or the speed you need over USB, Wi-Fi or Ethernet, with latency.
Use toolMemory and Storage Throughput Visualizer
Visualize the large speed gap between CPU cache, RAM, and storage.
Use tool