Llama 3.1 8B

8B parameters · 128k context · llama3.1 · released 2024-07-18

chat

In short

Llama 3.1 8B is an open model from Meta with 8B parameters. At Q4_K_M, Llama 3.1 8B needs about 6 GB of memory at 8k context and 22 GB at 128k, counting the weights, the KV cache and runtime buffers. The cheapest hardware in the UK that runs Llama 3.1 8B fully in memory at 128k context is the NVIDIA GeForce RTX 3090, £1,330 at Amazon, at about 25 tok/s (estimated).

Updated . Speeds are estimates; how they are worked out.

Cheapest way to run it in the UK today

AMD Radeon RX 7900 XTX, used at eBay

Runs Llama 3.1 8B at Q5_K_M fully in memory at 128k context, about 23 tok/sest.

£999

In stock, checked

What to run it on in the UK

Fully in memory at 128k context, priced at retailers today.

All hardware that runs it

Everything we price, best value first. Two cards split the model by layers.

HardwareQuantFitsDecodePricetok/s per 1,000
NVIDIA Tesla P40Q5_K_Mfits9 tok/s£78012.1
Intel Arc Pro B60Q5_K_Mfits10 tok/s£94410.6
NVIDIA GeForce RTX 3090Q5_K_Mfits25 tok/s£1,33019.0
AMD Radeon RX 7900 XTXQ5_K_Mfits23 tok/s£1,39916.4
Intel Arc Pro B70Q6_Kfits13 tok/s£1,4229.0
AMD Radeon AI PRO R9700Q6_Kfits15 tok/s£1,6009.3
NVIDIA GeForce RTX 3090 TiQ5_K_Mfits27 tok/s£2,19912.4
Mac Studio M4 Max 64GBQ6_Kfits15 tok/s£3,2994.5
Mac mini M4 Pro 64GBQ6_Kfits8 tok/s£3,3492.2
GMKtec EVO-X2 Ryzen AI Max+ 395 128GBQ6_Kfits6 tok/s£3,5001.7
NVIDIA RTX PRO 4500 BlackwellQ6_Kfits23 tok/s£4,5875.1
Mac Studio M3 Ultra 96GBQ6_Kfits22 tok/s£4,9494.5
NVIDIA GeForce RTX 5090Q6_Kfits47 tok/s£5,0009.3
NVIDIA GeForce RTX 4090Q5_K_Mfits27 tok/s£5,0915.4
ASUS Ascent GX10 128GBQ6_Kfits7 tok/s£5,2991.3
AMD Radeon PRO W7900Q6_Kfits20 tok/s£5,7853.5
Lenovo ThinkStation PGX GB10 128GBQ6_Kfits7 tok/s£5,9441.2
NVIDIA RTX PRO 5000 Blackwell 48GBQ6_Kfits35 tok/s£7,3004.8
Mac Studio M3 Ultra 256GBQ6_Kfits22 tok/s£8,2492.7
NVIDIA RTX A6000Q6_Kfits20 tok/s£9,0002.2
NVIDIA RTX 6000 Ada GenerationQ6_Kfits25 tok/s£11,2632.2
NVIDIA RTX PRO 6000 BlackwellQ6_Kfits47 tok/s£13,5873.4
Mac Studio M4 Max 128GBQ6_Kfits15 tok/s––
Framework Desktop Ryzen AI Max+ 395 128GBQ6_Kfits6 tok/s––
Mac Studio M3 Ultra 512GBQ6_Kfits22 tok/s––
NVIDIA DGX Spark 128GBQ6_Kfits7 tok/s––
Mac mini M4 Pro 48GBQ6_Kfits8 tok/s––
Framework Desktop Ryzen AI Max+ 395 64GBQ6_Kfits6 tok/s––
NVIDIA RTX PRO 4000 BlackwellQ5_K_Mfits18 tok/s––
NVIDIA RTX PRO 4000 Blackwell SFF EditionQ5_K_Mfits12 tok/s––
Minisforum MS-S1 Max Ryzen AI Max+ 395 128GBQ6_Kfits6 tok/s––
NVIDIA RTX PRO 5000 Blackwell 72GBQ6_Kfits35 tok/s––
Dell Pro Max with GB10 128GBQ6_Kfits7 tok/s––
Beelink GTR9 Pro Ryzen AI Max+ 395 128GBQ6_Kfits6 tok/s––
Intel Arc A770 16GBQ4_K_Moffload5 tok/s£36414.3
NVIDIA GeForce RTX 4060Q4_K_Moffload3 tok/s£3797.9
NVIDIA GeForce RTX 5050Q4_K_Moffload3 tok/s£3808.2
Intel Arc B570Q4_K_Moffload3 tok/s£3968.3
NVIDIA GeForce RTX 5060Q4_K_Moffload3 tok/s£4008.0
NVIDIA GeForce RTX 3060 12GBQ4_K_Moffload4 tok/s£4009.5
NVIDIA GeForce RTX 4060 Ti 8GBQ4_K_Moffload3 tok/s£4077.4
NVIDIA GeForce RTX 5060 Ti 8GBQ4_K_Moffload3 tok/s£4756.7
NVIDIA GeForce RTX 4070Q4_K_Moffload4 tok/s£5687.2
NVIDIA GeForce RTX 3080 10GBQ4_K_Moffload4 tok/s£5916.3
AMD Radeon RX 9060 XT 16GBQ4_K_Moffload5 tok/s£6307.1
AMD Radeon RX 9070Q4_K_Moffload6 tok/s£6808.2
NVIDIA GeForce RTX 5060 Ti 16GBQ4_K_Moffload5 tok/s£6907.8
Intel Arc B580Q4_K_Moffload4 tok/s£7005.4
NVIDIA GeForce RTX 5070Q4_K_Moffload4 tok/s£7006.0
Intel Arc Pro B50Q4_K_Moffload4 tok/s£7445.0
AMD Radeon RX 9070 XTQ4_K_Moffload6 tok/s£7507.5
AMD Radeon RX 7800 XTQ4_K_Moffload6 tok/s£8006.9
AMD Radeon RX 7900 XTQ4_K_Moffload10 tok/s£82911.8
NVIDIA RTX PRO 2000 BlackwellQ4_K_Moffload5 tok/s£8505.4
NVIDIA GeForce RTX 4060 Ti 16GBQ4_K_Moffload5 tok/s£9774.7
NVIDIA GeForce RTX 4070 SuperQ4_K_Moffload4 tok/s£9834.2
NVIDIA GeForce RTX 5070 TiQ4_K_Moffload6 tok/s£1,0006.3
NVIDIA GeForce RTX 4070 Ti SuperQ4_K_Moffload6 tok/s£1,3294.4
NVIDIA GeForce RTX 4080 SuperQ4_K_Moffload6 tok/s£1,4304.2
NVIDIA GeForce RTX 5080Q4_K_Moffload6 tok/s£1,4704.3
AMD Radeon RX 7600 XTQ4_K_Moffload4 tok/s––

2 other cards and machines we price cannot hold it at this context.

Memory needed

Weights, KV cache and runtime buffers at each context length (KV cache at fp16).

QuantFile@8k@32k@64k@128k
Q4_K_Mgguf4.6 GB6.3 GB9.5 GB13.7 GB22.0 GB
mlx-4bitmlx4.2 GB6.0 GB9.1 GB13.3 GB21.7 GB
Q5_K_Mgguf5.3 GB7.1 GB10.2 GB14.4 GB22.8 GB
Q6_Kgguf6.1 GB7.9 GB11.0 GB15.2 GB23.6 GB

Run it

Copy a command for the runtime you use.

  • Q4_K_M
    • Ollamaollama run hf.co/unsloth/Llama-3.1-8B-Instruct-GGUF:Q4_K_M
    • LM Studiolms get unsloth/Llama-3.1-8B-Instruct-GGUF@q4_k_m
    • llama.cppllama-server -hf unsloth/Llama-3.1-8B-Instruct-GGUF:Q4_K_M
  • mlx-4bit
    • LM Studiolms get mlx-community/Llama-3.1-8B-Instruct-4bit
    • MLXmlx_lm.server --model mlx-community/Llama-3.1-8B-Instruct-4bit
  • Q5_K_M
    • Ollamaollama run hf.co/unsloth/Llama-3.1-8B-Instruct-GGUF:Q5_K_M
    • LM Studiolms get unsloth/Llama-3.1-8B-Instruct-GGUF@q5_k_m
    • llama.cppllama-server -hf unsloth/Llama-3.1-8B-Instruct-GGUF:Q5_K_M
  • Q6_K
    • Ollamaollama run hf.co/unsloth/Llama-3.1-8B-Instruct-GGUF:Q6_K
    • LM Studiolms get unsloth/Llama-3.1-8B-Instruct-GGUF@q6_k
    • llama.cppllama-server -hf unsloth/Llama-3.1-8B-Instruct-GGUF:Q6_K

Questions

How much VRAM does Llama 3.1 8B need?
At Q4_K_M, Llama 3.1 8B needs about 6 GB of memory at 8k context and 22 GB at 128k, counting the weights, the KV cache and runtime buffers.
What is the best GPU for running Llama 3.1 8B locally?
The cheapest hardware in the UK that runs Llama 3.1 8B fully in memory at 128k context is the NVIDIA GeForce RTX 3090, £1,330 at Amazon, at about 25 tok/s (estimated). The fastest we price is the NVIDIA GeForce RTX 5090, at about 47 tok/s.
What is the cheapest way to run Llama 3.1 8B in the UK today?
The AMD Radeon RX 7900 XTX, £999 used at eBay, in stock: it runs Llama 3.1 8B at Q5_K_M fully in memory at 128k context, at about 23 tok/s (estimated).
Can I run Llama 3.1 8B on a 16 GB GPU?
Only partly: at 128k context it does not fit in 16 GB, so part of it runs from system RAM and it slows to about 5 tok/s on the Intel Arc A770 16GB (estimated).
Can I run Llama 3.1 8B on a 24 GB GPU?
Yes: at Q5_K_M it fits fully in 24 GB at 128k context. On the NVIDIA GeForce RTX 3090 Ti it runs at about 27 tok/s (estimated).
How do I run Llama 3.1 8B locally?
With Ollama: ollama run hf.co/unsloth/Llama-3.1-8B-Instruct-GGUF:Q4_K_M (the Q4_K_M build). LM Studio and llama.cpp commands are on this page.
What licence is Llama 3.1 8B released under?
llama3.1, which allows commercial use.

More hardware for local AI