How much VRAM does Llama 3.1 8B need?
Llama 3.1 8B needs 4.5 GB for its weights at 4-bit, 6.4 GB with an 8K context and 9.4 GB with 32K. At 8-bit, 9.8 GB.
- Parameters
- 8B
- Longest context
- 128K
- Released
- Jul 2024
- License
- Llama 3.1 Community
- Strongest at
- Chat, Coding, Agents, Docs
Memory at each precision
| Precision | Weights | With 8K | With 32K | With 128K |
|---|---|---|---|---|
| 16-bit | 15.0 GB | 16.8 GB | 19.8 GB | 31.8 GB |
| 8-bit | 7.9 GB | 9.8 GB | 12.8 GB | 24.8 GB |
| 6-bit | 6.1 GB | 8.0 GB | 11.0 GB | 23.0 GB |
| 5-bit | 5.3 GB | 7.1 GB | 10.1 GB | 22.1 GB |
| 4-bit | 4.5 GB | 6.4 GB | 9.4 GB | 21.4 GB |
| 3-bit | 3.7 GB | 5.5 GB | 8.5 GB | 20.5 GB |
| 2-bit | 2.8 GB | 4.6 GB | 7.6 GB | 19.6 GB |
| 1.6-bit | 1.5 GB | 3.4 GB | 6.4 GB | 18.4 GB |
One conversation, 16-bit context cache, runtime overhead included.
What runs it
| Machine | Best fit | Context | Speed | First reply |
|---|---|---|---|---|
| RTX 3060 12 GB | 8-bit | 20K | 31 tok/s | 1.2 s |
| RTX 4060 Ti 16 GB | 8-bit | 48K | 25 tok/s | 0.7 s |
| RTX 3090 | 8-bit | 112K | 76 tok/s | 0.4 s |
| RTX 4090 | 8-bit | 112K | 82 tok/s | 0.2 s |
| RTX 5090 | 8-bit | 128K | 137 tok/s | 0.1 s |
| 2× RTX 3090 | 8-bit | 128K | 76 tok/s | 0.3 s |
| RTX PRO 6000 Blackwell | 8-bit | 128K | 137 tok/s | 0.1 s |
| M4 Max 128 GB | 8-bit | 128K | 40 tok/s | 2.5 s |
| M5 Max 128 GB | 8-bit | 128K | 44 tok/s | 0.7 s |
| Ryzen AI Max+ 395 128 GB | 8-bit | 128K | 19 tok/s | 1.4 s |
| DGX Spark 128 GB | 8-bit | 128K | 23 tok/s | 0.5 s |
| M3 Ultra 256 GB | 8-bit | 128K | 57 tok/s | 1.4 s |
| M5 Ultra 512 GB | 8-bit | 128K | 78 tok/s | 0.4 s |
| H100 SXM | 8-bit | 128K | 229 tok/s | 0.1 s |
| DGX Station GB300 | 8-bit | 128K | 390 tok/s | 0.1 s |
| 8× H200 NVL | 8-bit | 128K | 300 tok/s | 0.1 s |
Best fit is the highest quality, up to 8-bit, that leaves 16K of context. First reply is the wait for a 2K prompt. Speeds are rough, plus or minus 25%.
How to run it
- Ollama
ollama run llama3.1:8b- llama.cpp
llama-server -hf unsloth/Llama-3.1-8B-Instruct-GGUF- vLLM
vllm serve meta-llama/Llama-3.1-8B-Instruct- MLX (Mac)
mlx_lm.chat --model mlx-community/Llama-3.1-8B-Instruct-4bit
Questions
How much VRAM does Llama 3.1 8B need?
Llama 3.1 8B needs 4.5 GB for its weights at 4-bit, 6.4 GB with an 8K context and 9.4 GB with 32K. At 8-bit, 9.8 GB.
Can Llama 3.1 8B run on an RTX 4090?
Yes. At 8-bit it holds 112K of context and writes about 82 tokens a second.