zai-org · text · mixture of experts

GLM-4.7-Flash

zai-org/GLM-4.7-Flash

GLM-4.7-Flash at Q4_K_M is exactly 18,132,721,120 bytes (16.89 GiB / 18.13 GB) — an effective 4.646 bits per weight, not the nominal 4. Its KV cache at 32K is 1.65 GiB.

From the file· summed from 1 file(s)From the file· KV per layer
Parameters
31.2B
total, not active
Architecture
deepseek2
47 layers
Context
202,752
native (config.json)
License

Shipped quantizations

exact bytes, summed from published files
QuantSizeExact bytesEffective bpwTensorsPublisher
UD-TQ1_07.76 GiB8,331,004,2562.135unsloth
UD-IQ1_S8.61 GiB9,247,983,9682.370unsloth
UD-IQ1_M9.13 GiB9,808,507,2322.513unsloth
UD-IQ2_XXS9.79 GiB10,513,625,4402.694unsloth
UD-IQ2_M10.24 GiB10,991,776,0962.817unsloth
Q2_K10.57 GiB11,344,720,2242.907unsloth
Q2_K_L10.63 GiB11,419,062,6242.926unsloth
UD-IQ3_XXS12.02 GiB12,907,368,8003.307unsloth
Q3_K_S12.38 GiB13,288,618,3363.405unsloth
Q3_K_M13.61 GiB14,614,624,6083.745844unsloth
IQ4_XS15.15 GiB16,271,360,3524.169844unsloth
IQ4_NL15.99 GiB17,165,033,8244.398unsloth
Q4_016.03 GiB17,216,676,1924.412844unsloth
Q4_K_S16.08 GiB17,268,318,5604.425unsloth
Q4_K_M16.89 GiB18,132,721,1204.646lmstudio-community
Q4_K16.99 GiB18,244,193,9204.675ggml-org
Q4_K_M17.05 GiB18,312,339,8084.692844unsloth
Q4_117.67 GiB18,972,205,4084.861unsloth
Q5_K_S19.39 GiB20,817,813,8565.334unsloth
Q5_K_M19.94 GiB21,408,850,2725.486844unsloth
Q6_K22.92 GiB24,614,785,5046.307lmstudio-community
Q6_K23.00 GiB24,693,098,8486.327844unsloth
Q8_029.66 GiB31,842,799,0728.159844lmstudio-community
Q8_029.66 GiB31,842,799,2328.159844ggml-org
Q8_029.66 GiB31,842,799,9688.159unsloth
BF162 shards55.79 GiB59,908,837,69615.351unsloth

KV cache by context

computed per layer
ContextKV cache (f16)Flat formulaOverstated byFull / windowed / recurrent
4,0960.21 GiB3.67 GiB17.78×47 / 0 / 0
8,1920.41 GiB7.34 GiB17.78×47 / 0 / 0
16,3840.83 GiB14.69 GiB17.78×47 / 0 / 0
32,7681.65 GiB29.38 GiB17.78×47 / 0 / 0
65,5363.30 GiB58.75 GiB17.78×47 / 0 / 0
131,0726.61 GiB117.50 GiB17.78×47 / 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 16.36 GiB. The real file is 16.89 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
47
Attention heads
20
KV heads
20
Head dim
256
Hidden size
2048
Vocab
154,880
Sliding window
none
SWA period
MLA
yes
Experts
64
Experts per token
4
use_sliding_window

Questions people ask

How much VRAM does GLM-4.7-Flash need?
Q4_K_M is exactly 18,132,721,120 bytes (16.89 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-4.7-Flash's KV cache?
1.65 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-4.7-Flash a mixture-of-experts model?
Yes — 64 experts, 4 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-4.7-Flash 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.