How LLM memory works

Three guides to the terms that decide how much GPU memory a language model needs. Each works through real models, and every number in them is computed by the same engine as the calculator.

KV cache size: the formula, with real models

The formula, a worked example, per-token figures for popular models, and why concurrency multiplies it while weight quantization leaves it alone.

GQA, MQA and MLA: how attention decides the KV cache

Four ways to arrange attention heads, why they change the cache by an order of magnitude, and how DeepSeek's latent attention takes the head count out of the formula.

Quantization and VRAM: BF16, FP8, INT8 and INT4

Bytes per parameter from FP32 to INT4, the formats you will meet, why 4-bit is not exactly half a byte, and why it leaves the KV cache alone.