GPU Memory by Model Size
| Model size | 16-bit (FP16 / BF16) | 8-bit | 4-bit |
|---|---|---|---|
| 8B | about 20 GB | about 10 GB | about 6 GB |
| 14B | about 34 GB | about 17 GB | about 11 GB |
| 32B | about 77 GB | about 39 GB | about 24 GB |
| 70B | about 168 GB | about 84 GB | about 51 GB |
These are estimates for one user with a moderate context. Real builds vary: mixture-of-experts models need memory for all their parameters even though only some run for each word, and a vision model adds its image encoder.
What Uses the Memory
- Weights: the model itself, fixed by its size and precision.
- KV cache: the memory of the conversation so far. It grows with context length and with every user served at once, and for long contexts it can rival the weights.
- Runtime: CUDA, the inference engine and its working buffers, typically one to a few GB.
vLLM reserves most of the GPU's memory at start-up and uses what the weights leave for the KV cache, so more spare memory means more users at once rather than an error.
Common GPUs and Their Memory
| GPU | Memory | At 4-bit, fits about |
|---|---|---|
| RTX 4090 | 24 GB | 32B |
| RTX 5090 | 32 GB | 32B with room for context |
| L40S / RTX 6000 Ada | 48 GB | 32B with a long context |
| A100 80 GB / H100 | 80 GB | 70B with room for context |
No GPU? Models also run on the processor from system memory, more slowly: see running an LLM on a CPU server. To set one up, start with the NVIDIA drivers and then serve it with vLLM or Ollama.