GLM · Z.ai
GLM-4.5-Air
GLM-4.5-Air from Z.ai has 106,852,251,264 parameters, of which about 13.4B are used for each token (a mixture of experts). Its weights take 214 GB in BF16 and about 53.4 GB at 4-bit, and each token of context adds 188.4 KB of KV cache (6.2 GB at 32K tokens).
Part of the GLM-4.5 family: 107B · 353B
Architecture · VRAM · KV cache · Tensor shapes · Parameter count · FLOPs
Architecture
| Architecture | Glm4MoeForCausalLM |
|---|---|
| Layers (L) | 46 |
| Hidden size (d) | 4,096 |
| Attention | GQA (12 query heads share each KV head) |
| Heads | 96 query, 8 key/value, 128 each |
| Feed-forward | 128 experts of 1,408, 8 per token, plus 1 shared (SwiGLU); 1 dense layer (layer 0) with FFN 10,944 |
| Vocabulary (V) | 151,552 |
| Tied embeddings | no: separate output head |
| Biases | on q, k and v |
| Extra norms | pre-norm (RMSNorm before attention and FFN) |
| Max context | 131,072 tokens |
| Weights in the release | bfloat16 |
How much memory the weights need
Each parameter takes 4 bytes in FP32, 2 in BF16, 1 at 8 bits and half a byte at 4 bits, so the weights alone need:
| Precision | Bytes per parameter | Weights | |
|---|---|---|---|
| FP32 | 4 | 427 GB | 398.06 GiB |
| BF16 / FP16 | 2 | 214 GB | 199.03 GiB |
| INT8 / FP8 | 1 | 107 GB | 99.51 GiB |
| INT4 | 0.5 | 53.4 GB | 49.76 GiB |
GB here is 109 bytes; GiB (230) is what tools like nvidia-smi show. Real 4-bit files are a little larger: they also store scales, and some layers are often kept at higher precision. Every expert has to be in memory, not just the active ones: the router picks different experts for each token. A running model also needs its KV cache, activations and the runtime's own buffers.
On common GPUs
Whether the weights plus a 8K-token KV cache fit in 90% of the card (how this is worked out):
Smallest card: 64 GB at 4-bit; BF16 and 8-bit need more than one 80 GB card.
| GPU memory | BF16 | 8-bit | 4-bit |
|---|---|---|---|
| 8 GB | 215 GBtoo big | 115 GBtoo big | 61.6 GBtoo big |
| 12 GB | 215 GBtoo big | 115 GBtoo big | 61.6 GBtoo big |
| 16 GB | 215 GBtoo big | 115 GBtoo big | 61.6 GBtoo big |
| 24 GB | 215 GBtoo big | 115 GBtoo big | 61.6 GBtoo big |
| 48 GB | 215 GBtoo big | 115 GBtoo big | 61.6 GBtoo big |
| 64 GB | 215 GBtoo big | 115 GBtoo big | 61.6 GB |
| 80 GB | 215 GBtoo big | 115 GBtoo big | 61.6 GB |
| 80 GB × n | 3 cards | 2 cards | one is enough |
Each cell is the weights plus the 8K-token KV cache at that precision; ✓ where it fits. The 80 GB × n row divides that evenly over n cards (tensor or pipeline parallel), the best case: real splits duplicate some buffers.
KV cache
What it is: the KV cache, explained.
Every layer keeps a key and a value vector for each of its 8 KV heads, for every token in the context:
2 × L × K × h × 2 bytes = 2 × 46 × 8 × 128 × 2 = 188,416 bytes per token
Grouped-query attention is why this is small: with a KV head for each of the 96 query heads it would be 12 times larger.
| Context | KV cache, BF16 | 8-bit KV | Weights + KV, BF16 |
|---|---|---|---|
| 4K | 772 MB | 386 MB | 214 GB |
| 32K | 6.2 GB | 3.1 GB | 220 GB |
| 128K (max) | 24.7 GB | 12.3 GB | 238 GB |
For one sequence. Batching multiplies the KV cache by the number of sequences, not the weights.
Every tensor shape
The names are those in the Hugging Face checkpoint; shapes are [out, in] for weight matrices, as PyTorch stores them. One block is shown: the model repeats it 46 times (in two kinds).
| Tensor | Shape | Parameters |
|---|---|---|
| Embedding | ||
model.embed_tokens.weight | [151,552, 4,096] | 620,756,992 |
| Dense blocks (layer 0): model.layers.N.… | ||
self_attn.q_proj.weight | [12,288, 4,096] | 50,331,648 |
self_attn.q_proj.bias | [12,288] | 12,288 |
self_attn.k_proj.weight | [1,024, 4,096] | 4,194,304 |
self_attn.k_proj.bias | [1,024] | 1,024 |
self_attn.v_proj.weight | [1,024, 4,096] | 4,194,304 |
self_attn.v_proj.bias | [1,024] | 1,024 |
self_attn.o_proj.weight | [4,096, 12,288] | 50,331,648 |
mlp.gate_proj.weight | [10,944, 4,096] | 44,826,624 |
mlp.up_proj.weight | [10,944, 4,096] | 44,826,624 |
mlp.down_proj.weight | [4,096, 10,944] | 44,826,624 |
input_layernorm.weight | [4,096] | 4,096 |
post_attention_layernorm.weight | [4,096] | 4,096 |
| MoE blocks (layers 1–45): model.layers.N.… | ||
self_attn.q_proj.weight | [12,288, 4,096] | 50,331,648 |
self_attn.q_proj.bias | [12,288] | 12,288 |
self_attn.k_proj.weight | [1,024, 4,096] | 4,194,304 |
self_attn.k_proj.bias | [1,024] | 1,024 |
self_attn.v_proj.weight | [1,024, 4,096] | 4,194,304 |
self_attn.v_proj.bias | [1,024] | 1,024 |
self_attn.o_proj.weight | [4,096, 12,288] | 50,331,648 |
mlp.gate.weightthe router: one score per expert | [128, 4,096] | 524,288 |
mlp.gate.e_score_correction_biasrouting only | [128] | 128 |
mlp.experts.{0…127}.gate_proj.weight | 128 × [1,408, 4,096] | 738,197,504 |
mlp.experts.{0…127}.up_proj.weight | 128 × [1,408, 4,096] | 738,197,504 |
mlp.experts.{0…127}.down_proj.weight | 128 × [4,096, 1,408] | 738,197,504 |
mlp.shared_experts.gate_proj.weightshared expert: runs for every token | [1,408, 4,096] | 5,767,168 |
mlp.shared_experts.up_proj.weightshared expert: runs for every token | [1,408, 4,096] | 5,767,168 |
mlp.shared_experts.down_proj.weightshared expert: runs for every token | [4,096, 1,408] | 5,767,168 |
input_layernorm.weight | [4,096] | 4,096 |
post_attention_layernorm.weight | [4,096] | 4,096 |
| After the last block | ||
model.norm.weightfinal norm | [4,096] | 4,096 |
lm_head.weightscores every token in the vocabulary | [151,552, 4,096] | 620,756,992 |
The parameter count, step by step
Each line gives the formula, the numbers from config.json, and the subtotal. The symbols:
- V
- vocabulary 151,552
- d
- hidden size 4,096
- L
- layers 46
- H
- query heads 96
- K
- key/value heads 8
- h
- head size 128
- f
- FFN hidden size 10,944
- E
- routed experts 128
- k
- experts per token 8
- f_e
- expert FFN size 1,408
1. Embedding
One row of d numbers for each of the V tokens in the vocabulary.
2. Dense blocks (layer 0)
3. MoE blocks (layers 1–45), ×45
4. Final norm and output head
5. Total
6. Active parameters per token
The router sends each token to 8 of the 128 experts in each MoE block, so only those experts' weights are used, plus the shared expert, which every token uses. One routed expert is 17,301,504 parameters.
7. Multi-token prediction
The checkpoint also ships 1 multi-token-prediction module, trained to guess tokens further ahead. It is not used for ordinary decoding (it can drive speculative decoding), so it is left out of the total above but is in the files.
Hugging Face counts 110,468,824,832 parameters in the zai-org/GLM-4.5-Air-Base safetensors files. The arithmetic above matches exactly.
FLOPs per token
A forward pass costs about two floating-point operations (a multiply and an add) for every weight a token passes through: 2 × N, with N the active weights used in matrix multiplies (the embedding lookup is a read, not a multiply; the output head is a multiply). Here that is 2 × 13,424,129,664 = 26.8 GFLOPs per token.
Attention adds the work of comparing the token with every earlier one: 2 × L × T × H × (hqk + hv) for T tokens of context, which grows with the context while 2N does not.
That is for one new token at position T, as when generating. Averaged over a whole training sequence of length T, each token sees T/2 earlier ones on average, which halves it.
| Context T | 2N | Attention | Total per token |
|---|---|---|---|
| 4K | 26.8 GFLOPs | 9.3 GFLOPs | 36.1 GFLOPs |
| 32K | 26.8 GFLOPs | 74.1 GFLOPs | 100.9 GFLOPs |
| 128K | 26.8 GFLOPs | 296.4 GFLOPs | 323.2 GFLOPs |
Training costs about three times the forward pass per token (6N): the backward pass does roughly twice the forward work.
More in the glossary: FLOPs per token · quantization · parameters.
Compare
GLM-4.5-Air vs gpt-oss-120b · Compare with any model →
Close in size: Llama 4 Scout (17B-16E) 108B · gpt-oss-120b 117B · Nemotron 3 Super 120B-A12B 121B · Qwen3.5 122B-A10B 122B · Devstral 2 (123B) 125B
Source
Read from zai-org/GLM-4.5-Air-Base, fetched 2026-12-03.