zai-org · text · mixture of experts

GLM-5

zai-org/GLM-5

GLM-5 at Q4_K_M is exactly 455,879,275,712 bytes (424.57 GiB / 455.88 GB) — an effective 4.838 bits per weight, not the nominal 4. Its KV cache at 32K is 2.74 GiB.

From the file· summed from 11 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
UD-TQ1_0164.05 GiB176,142,433,1841.869unsloth
UD-IQ1_S6 shards189.71 GiB203,699,011,1682.162unsloth
UD-IQ1_M6 shards208.48 GiB223,855,224,4162.376unsloth
UD-IQ2_XXS6 shards224.52 GiB241,073,170,0162.558unsloth
UD-IQ2_M7 shards237.27 GiB254,763,378,3362.704unsloth
Q2_K7 shards257.00 GiB275,953,473,2162.928unsloth
Q2_K_L7 shards257.21 GiB276,176,500,4482.931unsloth
UD-IQ3_XXS8 shards283.62 GiB304,536,467,7443.232unsloth
Q3_K_S8 shards303.87 GiB326,276,833,5683.462unsloth
Q3_K_M9 shards335.56 GiB360,308,302,3043.824unsloth
IQ4_XS10 shards375.23 GiB402,895,582,2724.276unsloth
IQ4_NL10 shards396.67 GiB425,923,884,0324.520unsloth
Q4_010 shards397.81 GiB427,145,999,3604.533unsloth
Q4_K_S10 shards398.95 GiB428,368,114,6884.546unsloth
Q4_K_M11 shards424.57 GiB455,879,275,7124.838unsloth
Q4_111 shards440.24 GiB472,704,107,7445.016unsloth
Q5_K_S12 shards484.04 GiB519,738,348,8005.516unsloth
Q5_K_M12 shards498.42 GiB535,169,914,1125.679unsloth
Q6_K14 shards576.84 GiB619,377,928,3526.573unsloth
Q8_018 shards746.31 GiB801,344,964,6088.504unsloth
BF1633 shards1404.42 GiB1,507,979,369,82416.003unsloth

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 424.57 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 need?
Q4_K_M is exactly 455,879,275,712 bytes (424.57 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'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 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 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.