zai-org · text

glm-4-9b-chat

zai-org/glm-4-9b-chat

glm-4-9b-chat at Q4_K_M is exactly 6,250,926,848 bytes (5.82 GiB / 6.25 GB) — an effective 5.320 bits per weight, not the nominal 4. Its KV cache at 32K is 20.00 GiB.

From the file· summed from 1 file(s)From the file· KV per layer
Parameters
9.4B
Architecture
chatglm
40 layers
Context
native (config.json)
License
other

Shipped quantizations

exact bytes, summed from published files
QuantSizeExact bytesEffective bpwTensorsPublisher
IQ1_S2.89 GiB3,097,789,8562.636legraphista
IQ1_M3.00 GiB3,220,669,8562.741legraphista
IQ2_XXS3.19 GiB3,425,469,8562.915legraphista
IQ2_XS3.36 GiB3,610,281,3763.073legraphista
IQ2_S3.51 GiB3,767,698,8483.207legraphista
IQ2_M3.66 GiB3,931,538,8483.346legraphista
IQ2_M3.66 GiB3,931,542,2723.346bartowski
Q2_K_S3.69 GiB3,958,801,8243.369legraphista
Q2_K3.72 GiB3,991,897,2803.397legraphista
Q2_K3.72 GiB3,991,897,5363.397legraphista
Q2_K3.72 GiB3,991,900,9283.397bartowski
IQ3_XXS3.97 GiB4,259,218,8483.625legraphista
IQ3_XS4.13 GiB4,429,644,9923.770legraphista
IQ3_XS4.13 GiB4,429,645,2163.770legraphista
IQ3_XS4.13 GiB4,429,648,6403.770bartowski
Q3_K_S4.27 GiB4,587,422,9123.904legraphista
IQ3_S4.27 GiB4,587,422,9123.904legraphista
Q3_K_S4.27 GiB4,587,423,1363.904legraphista
IQ3_S4.27 GiB4,587,423,1363.904legraphista
Q3_K_S4.27 GiB4,587,426,5603.904bartowski
Q2_K_L4.28 GiB4,598,108,9283.913bartowski
IQ3_M4.48 GiB4,811,883,7124.095legraphista
IQ3_M4.48 GiB4,811,883,9364.095legraphista
IQ3_M4.48 GiB4,811,887,3604.095bartowski
Q3_K4.72 GiB5,064,328,3844.310legraphista
Q3_K4.72 GiB5,064,328,6404.310legraphista
Q3_K_M4.72 GiB5,064,332,0324.310bartowski
IQ4_XS4.89 GiB5,251,106,2084.469legraphista
IQ4_XS4.89 GiB5,251,109,6324.469bartowski
Q3_K_L4.92 GiB5,281,449,1524.495legraphista
Q3_K_L4.92 GiB5,281,449,3764.495legraphista
Q3_K_L4.92 GiB5,281,452,8004.495bartowski
IQ4_XS4.94 GiB5,303,698,6244.514legraphista
IQ4_NL5.08 GiB5,455,316,3844.643legraphista
IQ4_NL5.13 GiB5,507,908,8004.688legraphista
Q4_K_S5.36 GiB5,753,341,1204.896legraphista
Q4_K_S5.36 GiB5,753,341,3444.896legraphista
Q4_K_S5.36 GiB5,753,344,7684.896bartowski
Q4_K5.82 GiB6,250,923,2005.320legraphista
Q4_K5.82 GiB6,250,923,4565.320legraphista

KV cache by context

computed per layer
ContextKV cache (f16)Flat formulaOverstated byFull / windowed / recurrent
4,0962.50 GiB2.50 GiB40 / 0 / 0
8,1925.00 GiB5.00 GiB40 / 0 / 0
16,38410.00 GiB10.00 GiB40 / 0 / 0
32,76820.00 GiB20.00 GiB40 / 0 / 0
65,53640.00 GiB40.00 GiB40 / 0 / 0
131,07280.00 GiB80.00 GiB40 / 0 / 0

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 4.92 GiB. The real file is 5.82 GiB, because a quantization is a mixture and some tensors are always kept at higher precision.

Architecture

from config.json
Layers
40
Attention heads
32
KV heads
32
Head dim
128
Hidden size
4096
Vocab
Sliding window
none
SWA period
MLA
no
Experts
Experts per token
use_sliding_window

Questions people ask

How much VRAM does glm-4-9b-chat need?
Q4_K_M is exactly 6,250,926,848 bytes (5.82 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-9b-chat's KV cache?
20.00 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.
Which quantization of glm-4-9b-chat 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.