Llama 3.1 8B VRAM Requirements
Llama 3.1 8B needs about 6.3 GB of VRAM at Q4_K_M with an 8K context: 4.5 GB for weights, 1.0 GB for the KV cache and 0.8 GB of runtime overhead. At Q8_0 it needs 9.8 GB and at full FP16 precision 16.8 GB. The smallest GPU that runs it fully is the RTX 3050 8GB.
6.3 GB VRAM
Llama 3.1 8B at Q4_K_M with 8K context and the KV cache in FP16.
- Weights 4.5 GB
- KV cache 1.0 GB
- Runtime overhead 0.8 GB
Which GPUs can run it
- RTX 3060 12GBFits~43 tok/s
- RTX 4060 Ti 16GBFits~34 tok/s
- RTX 3090 24GBFits~109 tok/s
- Radeon RX 7900 XTX 24GBFits~95 tok/s
- RTX 4090 24GBFits~117 tok/s
- RTX 5090 32GBFits~202 tok/s
- RTX 6000 Ada 48GBFits~111 tok/s
- A100 80GBFits~227 tok/s
- H100 80GB SXMFits~357 tok/s
- Ryzen AI Max+ 395 128GBFits~28 tok/s
- Apple M4 Max 128GBFits~64 tok/s
- Apple M5 Max 128GBFits~72 tok/s
- RTX PRO 6000 Blackwell 96GBFits~202 tok/s
- NVIDIA DGX Spark 128GBFits~30 tok/s
- Apple M3 Ultra 512GBFits~95 tok/s
Llama 3.1 8B VRAM by quantization
Total memory with an FP16 KV cache. "Smallest tier" is the smallest standard VRAM size with a 6% safety margin at 8K.
| Quantization | Bits/weight | Weights | Total at 8K | Total at 32K | Smallest tier |
|---|---|---|---|---|---|
| Q4_K_M | 4.85 | 4.5 GB | 6.3 GB | 9.3 GB | 8 GB |
| Q5_K_M | 5.69 | 5.3 GB | 7.1 GB | 10.1 GB | 8 GB |
| Q6_K | 6.59 | 6.2 GB | 8.0 GB | 11.0 GB | 10 GB |
| Q8_0 | 8.50 | 7.9 GB | 9.8 GB | 12.8 GB | 12 GB |
| FP16 / BF16 | 16.00 | 15.0 GB | 16.8 GB | 19.8 GB | 20 GB |
| Q3_K_M | 3.91 | 3.7 GB | 5.5 GB | 8.5 GB | 6 GB |
| Q2_K | 3.00 | 2.8 GB | 4.6 GB | 7.6 GB | 6 GB |
VRAM by context length
At Q4_K_M. The KV cache grows linearly with context: 0.13 GB per 1,000 tokens in FP16.
| Context | KV cache (FP16) | KV cache (Q8_0) | Total, FP16 cache | Total, Q8_0 cache |
|---|---|---|---|---|
| 4K tokens | 0.5 GB | 0.3 GB | 5.8 GB | 5.6 GB |
| 8K tokens | 1.0 GB | 0.5 GB | 6.3 GB | 5.9 GB |
| 32K tokens | 4.0 GB | 2.1 GB | 9.3 GB | 7.5 GB |
| 128K tokens | 16.0 GB | 8.5 GB | 21.3 GB | 13.8 GB |
GPUs that can run Llama 3.1 8B
At Q4_K_M with 8K context. "Best quant" is the highest-quality format that fits fully; "max context" is at Q4_K_M.
| GPU | Usable memory | Status | Best quant | Max context | Speed |
|---|---|---|---|---|---|
| RTX 3050 8GB | 8.0 GB | Fits | Q5_K_M | 17K | ~27 tok/s |
| RTX 4060 8GB | 8.0 GB | Fits | Q5_K_M | 17K | ~32 tok/s |
| RTX 4060 Ti 8GB | 8.0 GB | Fits | Q5_K_M | 17K | ~34 tok/s |
| Radeon RX 7600 8GB | 8.0 GB | Fits | Q5_K_M | 17K | ~29 tok/s |
| RTX 3060 Ti 8GB | 8.0 GB | Fits | Q5_K_M | 17K | ~53 tok/s |
| RTX 3070 8GB | 8.0 GB | Fits | Q5_K_M | 17K | ~53 tok/s |
| RTX 5060 8GB | 8.0 GB | Fits | Q5_K_M | 17K | ~53 tok/s |
| RTX 5060 Ti 8GB | 8.0 GB | Fits | Q5_K_M | 17K | ~53 tok/s |
| RTX 3070 Ti 8GB | 8.0 GB | Fits | Q5_K_M | 17K | ~71 tok/s |
| Intel Arc B570 10GB | 10.0 GB | Fits | Q6_K | 32K | ~35 tok/s |
| RTX 3080 10GB | 10.0 GB | Fits | Q6_K | 32K | ~89 tok/s |
| Apple M4 16GB | 10.7 GB | Fits | Q8_0 | 37K | ~14 tok/s |
| RTX 2080 Ti 11GB | 11.0 GB | Fits | Q8_0 | 39K | ~72 tok/s |
| RTX 2060 12GB | 12.0 GB | Fits | Q8_0 | 47K | ~40 tok/s |
About Llama 3.1 8B
The default local model for most people. Grouped-query attention with 8 KV heads keeps the cache at 128 KB per token in FP16, so a full 128K context adds 16 GB on top of the weights. Fine-tunes of this model are among the most common on Hugging Face.
| Spec | Value |
|---|---|
| Parameters | 8.03B |
| Layers | 32 |
| Hidden size | 4096 |
| Attention heads / KV heads | 32 / 8 |
| Head dimension | 128 |
| Vocabulary | 128,256 |
| Max context (used here) | 128K tokens |
| KV cache per token (FP16) | 128 KB |
| Released | 2024-07 |
| License | Llama 3.1 Community License |
Llama 3.1 8B VRAM: common questions
Can Llama 3.1 8B run on an 8GB GPU?
Yes, at Q4_K_M with up to about 16K context. At Q8_0 the weights alone are about 8 GB, so an 8 GB card needs CPU offload.
How much VRAM does Llama 3.1 8B need for 128K context?
About 16 GB for the KV cache alone in FP16, so roughly 21 GB total at Q4_K_M. Quantizing the cache to Q8_0 cuts that cache to about 8.5 GB.
How much VRAM does Llama 3.1 8B need?
About 6.3 GB at Q4_K_M with an 8K context, 9.8 GB at Q8_0 and 16.8 GB at FP16. Longer contexts add 0.13 GB per 1,000 tokens with an FP16 cache.
What is the cheapest GPU that can run Llama 3.1 8B?
The smallest listed device that fits it fully at Q4_K_M with 8K context is the RTX 3050 8GB (8.0 GB usable).