Can I run Llama 3.1 8B on an RTX 4070 12GB?

Yes: Llama 3.1 8B needs about 9.88 GB at Q4_K_M with 32K tokens of context, which fits the RTX 4070 12GB with 2.12 GB to spare. At 32K the RTX 4070 holds up to Q5_K_M (10.7 GB), and Q4_K_M runs up to 43K tokens.

Yes Q4_K_M with 32K tokens of context

Q4_K_M, 32K
9.88 GB
RTX 4070
12 GB, 504 GB/s
To spare
2.12 GB
Tokens/s
29–40 tokens/s

At Q4_K_M with 32K tokens of context it writes about 29–40 tokens/s for one request on an RTX 4070 12GB.

Best precision for Llama 3.1 8B on an RTX 4070 12GB

The most precise setting that leaves at least 0.5 GB free; one that fits with less is marked tight.

ContextBest fitMemoryFreeTokens/s
8K Q8_0 10.3 GB 1.66 GB 28–39
32K Q5_K_M 10.7 GB 1.27 GB 27–37
128K (full) Nothing fits — — —

Llama 3.1 8B on the RTX 4070 as the context fills

One request, FP16 KV cache, 0.5 GB plus 10% overhead; a minus sign is memory missing, and tight is less than 0.5 GB free.

Context Q4_K_MFreeTokens/sQ8_0FreeTokens/s
4K 6.03 GB 5.97 GB 48–68 9.79 GB 2.21 GB 29–41
8K 6.58 GB 5.42 GB 44–62 10.3 GB 1.66 GB 28–39
16K 7.68 GB 4.32 GB 37–53 11.4 GB 573 MB 25–35
32K 9.88 GB 2.12 GB 29–40 13.6 GB −1.64 GB —
64K 14.3 GB −2.28 GB — 18.0 GB −6.04 GB —
128K (full) 23.1 GB −11.1 GB — 26.8 GB −14.8 GB —

Llama 3.1 8B on more than one RTX 4070

CardsBest at 32KTokens/sQ4_K_M longestQ4_K_M tokens/s
2× (24 GB) BF16 25–35 127K 50–75
4× (48 GB) BF16 46–68 128K (full) 85–136

Tensor parallel with the combined bandwidth, as in vLLM; llama.cpp splits layers by default and runs at about one card's speed.

Other options

Run Llama 3.1 8B on the RTX 4070 with llama-server

llama-server -hf bartowski/Meta-Llama-3.1-8B-Instruct-GGUF:Q4_K_M -c 44032

Meta-Llama-3.1-8B-Instruct-Q4_K_M.gguf, 4.9 GB, from bartowski/Meta-Llama-3.1-8B-Instruct-GGUF (checked 2026-09-29). At -c 44032 on the RTX 4070: 11.5 GB of 12 GB, 560 MB free.

Questions

Can I run Llama 3.1 8B on an RTX 4070 12GB?

Yes: Llama 3.1 8B needs about 9.88 GB at Q4_K_M with 32K tokens of context, which fits the RTX 4070 12GB with 2.12 GB to spare. At 32K the RTX 4070 holds up to Q5_K_M (10.7 GB), and Q4_K_M runs up to 43K tokens.

How fast is Llama 3.1 8B on an RTX 4070 12GB?

At Q4_K_M with 32K tokens of context it writes about 29–40 tokens/s for one request on an RTX 4070 12GB.

What does a second RTX 4070 12GB change for Llama 3.1 8B?

Two RTX 4070 12GB cards (24 GB in one tensor-parallel group) hold Llama 3.1 8B at BF16 with 32K, and Q4_K_M up to 127K tokens, at about 50–75 tokens/s.

Try other settings in the VRAM calculator or the speed calculator. See also Llama 3.1 8B VRAM requirements, what LLMs an RTX 4070 12GB can run and every pair, or detect your own GPU. Model data checked .