zai-org · text · mixture of experts

GLM-5.1

zai-org/GLM-5.1

GLM-5.1 at Q4_K_M is exactly 459,676,727,616 bytes (428.11 GiB / 459.68 GB) — an effective 4.878 bits per weight, not the nominal 4. Its KV cache at 32K is 2.74 GiB.

From the file· summed from 12 file(s)From the file· KV per layer
Parameters
754B
total, not active
Architecture
glm-dsa
78 layers
Context
202,752
native (config.json)
License
mit

Shipped quantizations

exact bytes, summed from published files
QuantSizeExact bytesEffective bpwTensorsPublisher
IQ1_S4 shards147.30 GiB158,162,527,5521.678bartowski
IQ1_M5 shards163.93 GiB176,020,432,3521.868bartowski
IQ2_XXS6 shards189.92 GiB203,929,724,4802.164bartowski
UD-IQ1_M6 shards191.42 GiB205,540,357,8242.181unsloth
UD-IQ2_XXS6 shards205.49 GiB220,639,852,2242.341unsloth
IQ2_XS6 shards211.04 GiB226,599,413,2802.405bartowski
IQ2_S6 shards215.49 GiB231,381,882,4642.455bartowski
UD-IQ2_M6 shards219.96 GiB236,185,450,1762.506unsloth
IQ2_M7 shards237.40 GiB254,907,209,3762.705bartowski
Q2_K7 shards247.56 GiB265,814,742,7202.821bartowski
Q2_K_L7 shards248.43 GiB266,753,325,7602.831bartowski
UD-IQ3_XXS7 shards249.84 GiB268,266,198,8802.847unsloth
UD-IQ3_S7 shards260.39 GiB279,590,819,6482.967unsloth
UD-Q3_K_S8 shards291.94 GiB313,470,212,0003.326unsloth
IQ3_XXS9 shards293.34 GiB314,973,771,7123.342bartowski
Q3_K_S9 shards305.77 GiB328,314,834,2403.484bartowski
UD-Q3_K_M8 shards315.19 GiB338,434,709,4723.591unsloth
IQ3_XS9 shards320.32 GiB343,937,043,7763.650bartowski
Q3_K_M9 shards320.96 GiB344,630,349,1203.657bartowski
Q3_K_L10 shards334.23 GiB358,874,992,1283.808bartowski
IQ3_M10 shards335.52 GiB360,261,996,0323.823bartowski
UD-IQ4_XS9 shards336.51 GiB361,324,439,6483.834unsloth
UD-IQ4_NL9 shards343.54 GiB368,874,186,8163.914unsloth
IQ4_XS11 shards375.69 GiB403,395,547,2644.281bartowski
IQ4_NL11 shards397.30 GiB426,600,740,9924.527bartowski
Q4_011 shards398.24 GiB427,612,092,5444.538bartowski
UD-Q4_K_S10 shards404.10 GiB433,902,676,0964.605unsloth
Q4_K_S12 shards411.10 GiB441,415,416,0644.684bartowski
Q4_K_M12 shards428.11 GiB459,676,727,6164.878bartowski
Q4_K_L12 shards428.77 GiB460,382,980,4164.886bartowski
UD-Q4_K_M11 shards432.60 GiB464,504,318,3044.929unsloth
Q4_113 shards440.26 GiB472,724,474,2405.016bartowski
Q5_K_S14 shards484.36 GiB520,080,579,0725.519bartowski
UD-Q5_K_S12 shards489.83 GiB525,947,500,9285.581unsloth
Q5_K_M14 shards501.62 GiB538,612,685,2805.716bartowski
UD-Q5_K_M13 shards520.11 GiB558,461,745,6965.926unsloth
UD-Q6_K14 shards578.66 GiB621,333,543,7126.594unsloth
Q6_K17 shards607.66 GiB652,470,732,1286.924bartowski
Q8_017 shards746.31 GiB801,344,965,4728.504unsloth
Q8_021 shards746.31 GiB801,344,965,9208.504bartowski

KV cache by context

computed per layer
ContextKV cache (f16)Flat formulaOverstated byFull / windowed / recurrent
4,0960.34 GiB19.50 GiB56.89×78 / 0 / 0
8,1920.69 GiB39.00 GiB56.89×78 / 0 / 0
16,3841.37 GiB78.00 GiB56.89×78 / 0 / 0
32,7682.74 GiB156.00 GiB56.89×78 / 0 / 0
65,5365.48 GiB312.00 GiB56.89×78 / 0 / 0
131,07210.97 GiB624.00 GiB56.89×78 / 0 / 0

This model uses multi-head latent attention. No V cache is allocated at all, and the K cache stores a 512-wide latent plus 64 rope dimensions — so reading num_key_value_heads from config.json and multiplying, as every calculator does, overstates the cache by well over an order of magnitude.

Compare with

same modality, comparable size

Will it run on your card?

full quant x context sweep

Why other calculators give a different number

A parameters × bits ÷ 8 estimate puts Q4_K_M at roughly 394.93 GiB. The real file is 428.11 GiB, because a quantization is a mixture and some tensors are always kept at higher precision. The larger discrepancy is the cache: this model allocates no value cache at all, so any formula reading num_key_value_heads overstates it by more than an order of magnitude.

Architecture

from config.json
Layers
78
Attention heads
64
KV heads
64
Head dim
256
Hidden size
6144
Vocab
154,880
Sliding window
none
SWA period
MLA
yes
Experts
256
Experts per token
8
use_sliding_window

Questions people ask

How much VRAM does GLM-5.1 need?
Q4_K_M is exactly 459,676,727,616 bytes (428.11 GiB) in weights. Add the KV cache, which depends on your context length, plus roughly half a gigabyte of runtime overhead.
How large is GLM-5.1's KV cache?
2.74 GiB at 32K context with an f16 cache, computed per layer. Quantizing the cache to q8_0 roughly halves it, which is often the difference between a context length fitting and not.
Is GLM-5.1 a mixture-of-experts model?
Yes — 256 experts, 8 routed per token. Every expert must be resident, but only the routed ones are read per token, which is why its memory requirement and its speed behave very differently.
Which quantization of GLM-5.1 should I use?
Q4_K_M is the usual default. Pick the largest quantization that fits your card at the context you actually need — the table above gives exact sizes for every one published.