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 Canada that runs Llama 3.1 8B fully in memory at 128k context is the AMD Radeon RX 7900 XTX, $2,041 at Amazon, at about 23 tok/s (estimated).
Updated . Speeds are estimates; how they are worked out.
Cheapest way to run it in Canada today
AMD Radeon RX 7900 XTX, new at Amazon
Runs Llama 3.1 8B at Q5_K_M fully in memory at 128k context, about 23 tok/sest.
$2,041
In stock, checked
What to run it on in Canada
Fully in memory at 128k context, priced at retailers today.
Cheapest
AMD Radeon RX 7900 XTX23tok/sest.Q5_K_M
$2,041
Best value
AMD Radeon RX 7900 XTX23tok/sest.Q5_K_M
$2,041
Fastest
NVIDIA GeForce RTX 509047tok/sest.Q6_K
$12,300
Mac
Mac Studio M3 Ultra 512GB22tok/sest.Q6_K
$28,000
All hardware that runs it
Everything we price, best value first. Two cards split the model by layers.
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).
| Quant | File | @8k | @32k | @64k | @128k |
|---|---|---|---|---|---|
| Q4_K_Mgguf | 4.6 GB | 6.3 GB | 9.5 GB | 13.7 GB | 22.0 GB |
| mlx-4bitmlx | 4.2 GB | 6.0 GB | 9.1 GB | 13.3 GB | 21.7 GB |
| Q5_K_Mgguf | 5.3 GB | 7.1 GB | 10.2 GB | 14.4 GB | 22.8 GB |
| Q6_Kgguf | 6.1 GB | 7.9 GB | 11.0 GB | 15.2 GB | 23.6 GB |
Run it
Copy a command for the runtime you use.
- Q4_K_M
- Ollama
ollama run hf.co/unsloth/Llama-3.1-8B-Instruct-GGUF:Q4_K_M - LM Studio
lms get unsloth/Llama-3.1-8B-Instruct-GGUF@q4_k_m - llama.cpp
llama-server -hf unsloth/Llama-3.1-8B-Instruct-GGUF:Q4_K_M
- Ollama
- mlx-4bit
- LM Studio
lms get mlx-community/Llama-3.1-8B-Instruct-4bit - MLX
mlx_lm.server --model mlx-community/Llama-3.1-8B-Instruct-4bit
- LM Studio
- Q5_K_M
- Ollama
ollama run hf.co/unsloth/Llama-3.1-8B-Instruct-GGUF:Q5_K_M - LM Studio
lms get unsloth/Llama-3.1-8B-Instruct-GGUF@q5_k_m - llama.cpp
llama-server -hf unsloth/Llama-3.1-8B-Instruct-GGUF:Q5_K_M
- Ollama
- Q6_K
- Ollama
ollama run hf.co/unsloth/Llama-3.1-8B-Instruct-GGUF:Q6_K - LM Studio
lms get unsloth/Llama-3.1-8B-Instruct-GGUF@q6_k - llama.cpp
llama-server -hf unsloth/Llama-3.1-8B-Instruct-GGUF:Q6_K
- Ollama
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 Canada that runs Llama 3.1 8B fully in memory at 128k context is the AMD Radeon RX 7900 XTX, $2,041 at Amazon, at about 23 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 Canada today?
- The AMD Radeon RX 7900 XTX, $2,041 new at Amazon, 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 AMD Radeon RX 9060 XT 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.