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).

107Bparameters
13.4Bactive per token
214 GBBF16 weights
53.4 GB4-bit weights
188.4 KBKV per token

Part of the GLM-4.5 family: 107B · 353B

Architecture · VRAM · KV cache · Tensor shapes · Parameter count · FLOPs

Architecture

ArchitectureGlm4MoeForCausalLM
Layers (L)46
Hidden size (d)4,096
AttentionGQA (12 query heads share each KV head)
Heads96 query, 8 key/value, 128 each
Feed-forward128 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 embeddingsno: separate output head
Biaseson q, k and v
Extra normspre-norm (RMSNorm before attention and FFN)
Max context131,072 tokens
Weights in the releasebfloat16

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:

PrecisionBytes per parameterWeights
FP324427 GB398.06 GiB
BF16 / FP162214 GB199.03 GiB
INT8 / FP81107 GB99.51 GiB
INT40.553.4 GB49.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.

Memory calculator

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 memoryBF168-bit4-bit
8 GB215 GBtoo big115 GBtoo big61.6 GBtoo big
12 GB215 GBtoo big115 GBtoo big61.6 GBtoo big
16 GB215 GBtoo big115 GBtoo big61.6 GBtoo big
24 GB215 GBtoo big115 GBtoo big61.6 GBtoo big
48 GB215 GBtoo big115 GBtoo big61.6 GBtoo big
64 GB215 GBtoo big115 GBtoo big61.6 GB
80 GB215 GBtoo big115 GBtoo big61.6 GB
80 GB × n3 cards2 cardsone 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.

ContextKV cache, BF168-bit KVWeights + KV, BF16
4K772 MB386 MB214 GB
32K6.2 GB3.1 GB220 GB
128K (max)24.7 GB12.3 GB238 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).

TensorShapeParameters
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.weight128 × [1,408, 4,096]738,197,504
mlp.experts.{0…127}.up_proj.weight128 × [1,408, 4,096]738,197,504
mlp.experts.{0…127}.down_proj.weight128 × [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.

Embedding
V × d
151,552 × 4,096
= 620,756,992

2. Dense blocks (layer 0)

Attention
H·h × d + H·h + 2 × (K·h × d) + 2 × K·h + d × H·h
12,288 × 4,096 + 12,288 + 2 × (1,024 × 4,096) + 2 × 1,024 + 4,096 × 12,288
= 109,066,240
Feed-forward (SwiGLU)
2 × (f × d) + d × f
2 × (10,944 × 4,096) + 4,096 × 10,944
= 134,479,872
Norms
2 × d
2 × 4,096
= 8,192
One block
attention + feed-forward + norms
109,066,240 + 134,479,872 + 8,192
= 243,554,304

3. MoE blocks (layers 1–45), ×45

Attention
H·h × d + H·h + 2 × (K·h × d) + 2 × K·h + d × H·h
12,288 × 4,096 + 12,288 + 2 × (1,024 × 4,096) + 2 × 1,024 + 4,096 × 12,288
= 109,066,240
Mixture of experts (128 experts, 8 per token)
E × d + E + 2 × (E × (f_e × d)) + E × (d × f_e) + 2 × (f_e × d) + d × f_e
128 × 4,096 + 128 + 2 × (128 × (1,408 × 4,096)) + 128 × (4,096 × 1,408) + 2 × (1,408 × 4,096) + 4,096 × 1,408
= 2,232,418,432
Norms
2 × d
2 × 4,096
= 8,192
One block
attention + mixture of experts + norms
109,066,240 + 2,232,418,432 + 8,192
= 2,341,492,864
45 blocks
45 × block
45 × 2,341,492,864
= 105,367,178,880

4. Final norm and output head

Final norm + head
d + V × d
4,096 + 151,552 × 4,096
= 620,761,088

5. Total

Total
embedding + blocks + final
620,756,992 + 243,554,304 + 105,367,178,880 + 620,761,088
= 106,852,251,264

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.

Active
total − MoE blocks × (E − k) × expert
106,852,251,264 − 45 × 120 × 17,301,504
= 13,424,129,664

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.

MTP module 1 (layer 46): its own pieces
2 × (V × d) + 3 × d + d × 2d
2 × (151,552 × 4,096) + 3 × 4,096 + 4,096 × 8,192
= 1,275,080,704
MTP module 1: a transformer block
one block, as in MoE blocks
2,341,492,864
= 2,341,492,864
In the checkpoint
language model + MTP
106,852,251,264 + 3,616,573,568
= 110,468,824,832

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 T2NAttentionTotal per token
4K26.8 GFLOPs9.3 GFLOPs36.1 GFLOPs
32K26.8 GFLOPs74.1 GFLOPs100.9 GFLOPs
128K26.8 GFLOPs296.4 GFLOPs323.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.