Skip to content

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

Memory Llama 3.1 8B needs at each precision and context length
PrecisionWeightsWith 8KWith 32KWith 128K
16-bit15.0 GB16.8 GB19.8 GB31.8 GB
8-bit7.9 GB9.8 GB12.8 GB24.8 GB
6-bit6.1 GB8.0 GB11.0 GB23.0 GB
5-bit5.3 GB7.1 GB10.1 GB22.1 GB
4-bit4.5 GB6.4 GB9.4 GB21.4 GB
3-bit3.7 GB5.5 GB8.5 GB20.5 GB
2-bit2.8 GB4.6 GB7.6 GB19.6 GB
1.6-bit1.5 GB3.4 GB6.4 GB18.4 GB

One conversation, 16-bit context cache, runtime overhead included.

What runs it

The best way Llama 3.1 8B runs on common GPUs, Macs and AI boxes
MachineBest fitContextSpeedFirst reply
RTX 3060 12 GB8-bit20K31 tok/s1.2 s
RTX 4060 Ti 16 GB8-bit48K25 tok/s0.7 s
RTX 30908-bit112K76 tok/s0.4 s
RTX 40908-bit112K82 tok/s0.2 s
RTX 50908-bit128K137 tok/s0.1 s
2× RTX 30908-bit128K76 tok/s0.3 s
RTX PRO 6000 Blackwell8-bit128K137 tok/s0.1 s
M4 Max 128 GB8-bit128K40 tok/s2.5 s
M5 Max 128 GB8-bit128K44 tok/s0.7 s
Ryzen AI Max+ 395 128 GB8-bit128K19 tok/s1.4 s
DGX Spark 128 GB8-bit128K23 tok/s0.5 s
M3 Ultra 256 GB8-bit128K57 tok/s1.4 s
M5 Ultra 512 GB8-bit128K78 tok/s0.4 s
H100 SXM8-bit128K229 tok/s0.1 s
DGX Station GB3008-bit128K390 tok/s0.1 s
8× H200 NVL8-bit128K300 tok/s0.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.

More models