Skip to content
Run LLM Locally

Model · Meta

Llama 3.1 8B Instruct: VRAM and hardware requirements

At Q4_K_M with an 8K context, Llama 3.1 8B Instruct needs about 6.7 GB: a GPU with 8 GB or more runs it entirely in VRAM.

  • Parameters8.03B
  • Max context128K
  • LicenseLlama 3.1 Community License

Specifications

Organization
Meta
Architecture
llama
Released
July 2024
Layers
32
Hidden size
4096
Attention heads
32
KV heads
8
Head dimension
128
Vocabulary
128,256
KV cache per 1K tokens (f16)
0.125 GB

Official specData updated 24 days agoSource: Hugging Face config.json + model card

Quantizations and memory

Llama 3.1 8B Instruct: memory by quantization at 8K context
QuantizationFile sizeMemory neededMinimum GPU memoryQuality
BF1615 GB~17.5 GB20 GBReference (unquantized)
Q8_08 GB~10.2 GB11 GBNear-lossless
Q6_K6.1 GB~8.3 GB10 GBNear-lossless
Q5_K_M5.3 GB~7.4 GB8 GBVery good
Q4_K_MMost used4.6 GB~6.7 GB8 GBGood — the usual choice
IQ4_XS4.1 GB~6.2 GB8 GBGood — the usual choice
Q3_K_M3.7 GB~5.8 GB8 GBNoticeable loss
Q2_K3 GB~5 GB8 GBSignificant loss

File sizes: not available until imported from the model repository. Memory = weights (estimated from bits per weight) + KV cache + runtime overhead + safety margin. (BF16 ≈ 16 bpw, Q8_0 ≈ 8.5 bpw, Q6_K ≈ 6.57 bpw, Q5_K_M ≈ 5.7 bpw, Q4_K_M ≈ 4.9 bpw, IQ4_XS ≈ 4.46 bpw, Q3_K_M ≈ 4 bpw, Q2_K ≈ 3.17 bpw)

Q4, Q5 or Q8: how to choose a quantization

GPUs that run Llama 3.1 8B Instruct

Llama 3.1 8B Instruct Q4_K_M · 8K context, one GPU
RTX 509032 GB · 64 GB RAM~6.7 GB · 171–269 tok/s estimateExcellent
RTX 409024 GB · 64 GB RAM~6.7 GB · 112–163 tok/s estimateExcellent
RTX 309024 GB · 64 GB RAM~6.7 GB · 106–153 tok/s estimateExcellent
RX 7900 XTX24 GB · 64 GB RAM~6.7 GB · 89–137 tok/s estimateExcellent
RTX 5060 Ti 16 GB16 GB · 64 GB RAM~6.7 GB · 57–77 tok/s estimateExcellent
RTX 5070 Ti16 GB · 64 GB RAM~6.7 GB · 102–147 tok/s estimateExcellent
RTX 508016 GB · 64 GB RAM~6.7 GB · 108–156 tok/s estimateExcellent
RTX 4060 Ti 16 GB16 GB · 64 GB RAM~6.7 GB · 38–50 tok/s estimateExcellent
RTX 4070 Ti SUPER16 GB · 64 GB RAM~6.7 GB · 80–113 tok/s estimateExcellent
RX 9070 XT16 GB · 64 GB RAM~6.7 GB · 66–97 tok/s estimateExcellent
RTX 3060 12 GB12 GB · 64 GB RAM~6.7 GB · 46–63 tok/s estimateExcellent
RTX 407012 GB · 64 GB RAM~6.7 GB · 63–86 tok/s estimateExcellent
RTX 507012 GB · 64 GB RAM~6.7 GB · 80–113 tok/s estimateExcellent
RTX 40608 GB · 64 GB RAM~6.7 GB · 36–48 tok/s estimateCompatible

Macs that run Llama 3.1 8B Instruct

Llama 3.1 8B Instruct Q4_K_M · 8K context
M3 Ultra (80-core GPU) · 512 GBMac Studio~6.4 GB · 76–139 tok/s estimateExcellent
M4 Max (40-core GPU) · 128 GBMacBook Pro 14, MacBook Pro 16~6.4 GB · 55–92 tok/s estimateExcellent
M3 Max (40-core GPU) · 128 GBMacBook Pro 14, MacBook Pro 16~6.4 GB · 42–68 tok/s estimateExcellent
M4 Pro (20-core GPU) · 64 GBMac mini, MacBook Pro 14~6.4 GB · 30–46 tok/s estimateExcellent
M4 Max (32-core GPU) · 36 GBMacBook Pro 14, MacBook Pro 16~6.4 GB · 43–69 tok/s estimateExcellent
M4 · 32 GBMacBook Air, MacBook Pro 14~6.4 GB · 14–20 tok/s estimateExcellent
M5 · 32 GBMacBook Pro 14~6.4 GB · 18–26 tok/s estimateExcellent
M3 · 24 GBMacBook Air, MacBook Pro 14~6.4 GB · 12–17 tok/s estimateExcellent

EstimateData updated 24 days agoSource: Run LLM Locally engine

Limits in plain words

The KV cache grows with context: at 32K it adds about 4 GB on top of the weights.

With under 8 GB of VRAM, use a smaller quantization or a smaller model of the same family.

Where to buy

Prices and links follow the market you choose.

GeForce RTX 4060

NVIDIA

CompatibleRuns Llama 3.1 8B Instruct Q4_K_M entirely in memory

Price not available

Availability unknown

View on amazon.com

Affiliate link

Radeon RX 7600 XT

AMD

ExcellentRuns Llama 3.1 8B Instruct Q4_K_M entirely in memory

Price not available

Availability unknown

View on amazon.com

Affiliate link

AMD Ryzen AI Max+ 395

Unified memory PC

ExcellentRuns Llama 3.1 8B Instruct Q4_K_M entirely in memory

Price not available

Availability unknown

View on amazon.com

Affiliate link

No current offer imported for this market: the link opens a marketplace search.

Frequently asked questions

How much VRAM does Llama 3.1 8B Instruct need?
About 6.7 GB at Q4_K_M with an 8K context, including the KV cache and runtime overhead. At Q8_0 it needs about 10.2 GB. A longer context adds more: about 4 GB of KV cache at 32K.
Can Llama 3.1 8B Instruct run on a Mac?
Yes on a Mac whose GPU can use at least 6.4 GB, e.g. M3 24 GB. macOS lets the GPU use about two thirds to three quarters of unified memory by default.
How fast is Llama 3.1 8B Instruct?
On a RTX 4090, we estimate 112–163 tok/s at Q4_K_M. This is an estimate from memory bandwidth (confidence low) until benchmarks are imported.