zai-org · text

codegeex4-all-9b

zai-org/codegeex4-all-9b

codegeex4-all-9b at Q4_K_M is exactly 6,250,923,136 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,8242.636legraphista
IQ1_M3.00 GiB3,220,669,8242.741legraphista
IQ2_XXS3.19 GiB3,425,469,8242.915legraphista
IQ2_XS3.36 GiB3,610,281,3443.073legraphista
IQ2_S3.51 GiB3,767,698,8163.207legraphista
IQ2_M3.66 GiB3,931,538,8163.346legraphista
Q2_K_S3.69 GiB3,958,801,7923.369legraphista
Q2_K3.72 GiB3,991,897,2163.397QuantFactory
Q2_K3.72 GiB3,991,897,4723.397legraphista
Q2_K3.72 GiB3,991,898,2083.397mradermacher
IQ3_XXS3.97 GiB4,259,218,8163.625legraphista
IQ3_XS4.13 GiB4,429,645,1843.770legraphista
IQ3_XS4.13 GiB4,429,645,9203.770mradermacher
Q3_K_S4.27 GiB4,587,422,8483.904QuantFactory
IQ3_S4.27 GiB4,587,423,1043.904legraphista
Q3_K_S4.27 GiB4,587,423,1043.904legraphista
Q3_K_S4.27 GiB4,587,423,8403.904mradermacher
IQ3_S4.27 GiB4,587,423,8403.904mradermacher
IQ3_M4.48 GiB4,811,883,9044.095legraphista
IQ3_M4.48 GiB4,811,884,6404.095mradermacher
Q3_K_M4.72 GiB5,064,328,3204.310QuantFactory
Q3_K4.72 GiB5,064,328,5764.310legraphista
Q3_K_M4.72 GiB5,064,329,3124.310mradermacher
IQ4_XS4.89 GiB5,251,106,1764.469legraphista
Q3_K_L4.92 GiB5,281,449,0884.495QuantFactory
Q3_K_L4.92 GiB5,281,449,3444.495legraphista
Q3_K_L4.92 GiB5,281,450,0804.495mradermacher
IQ4_XS4.94 GiB5,303,699,5524.514mradermacher
Q4_05.08 GiB5,455,316,0964.643QuantFactory
IQ4_NL5.08 GiB5,455,316,3524.643legraphista
Q4_K_S5.36 GiB5,753,341,0564.896QuantFactory
Q4_K_S5.36 GiB5,753,341,3124.896legraphista
Q4_K_S5.36 GiB5,753,342,0484.896mradermacher
Q4_15.59 GiB6,003,983,4885.110QuantFactory
Q4_K_M5.82 GiB6,250,923,1365.320QuantFactory
Q4_K5.82 GiB6,250,923,3925.320legraphista
Q4_K_M5.82 GiB6,250,924,1285.320mradermacher
Q5_06.10 GiB6,552,650,8805.577QuantFactory
Q5_K_S6.23 GiB6,692,897,9205.696legraphista
Q5_K_S6.23 GiB6,692,897,9205.696QuantFactory

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
151,552
Sliding window
none
SWA period
MLA
no
Experts
Experts per token
use_sliding_window

Questions people ask

How much VRAM does codegeex4-all-9b need?
Q4_K_M is exactly 6,250,923,136 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 codegeex4-all-9b'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 codegeex4-all-9b 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.