How to Deploy Llama 3.1 8B Locally
Llama 3.1 8B is an 8B model that Meta released in July 2024, and by today's standards it is old. But its ecosystem is the biggest: Hugging Face has more than 3,000 fine-tunes built directly on it. At 4-bit with 8K it takes about 7 GB, so an 8GB card can run it. Its weakness is that long context eats VRAM: the full 128K needs 23.2 GB, twice what Qwen3.5 9B needs.
Llama 3.1 8B details
- Min VRAM at 4-bit8 GB · 8K
- Parameters8B
- Max context128K
- Architecture
- Dense
- License
- Llama 3.1 Community License
- Launch date
- Jul 23, 2024
- Vendor
- Meta AI
- Hugging Face repo
- meta-llama/Llama-3.1-8B-Instruct
- NVFP4 repo (Blackwell)
- nvidia/Llama-3.1-8B-Instruct-NVFP4
- MLX repo (Apple)
- mlx-community/Llama-3.1-8B-Instruct-4bit
- Ollama tag
- llama3.1:8b
- Layers
- 32
- Hidden size
- 4,096
- KV heads
- 8
- Head dim
- 128
How much VRAM does Llama 3.1 8B need for local deployment?
| Quantization | WeightsGB | 8K contextGB | 32K contextGB | 128K context (max)GB |
|---|---|---|---|---|
| 1-bit | 2est. | 4.2 | 7.4 | 20.3 |
| 2-bit | 3.7GGUF | 5.8 | 9.1 | 22 |
| 3-bit | 4.8GGUF | 6.9 | 10.2 | 23.1 |
| 4-bit | 4.9GGUF | 7 | 10.3 | 23.2 |
| 5-bit | 5.7GGUF | 7.8 | 11.1 | 24 |
| 8-bit | 8.5GGUF | 10.6 | 13.9 | 26.8 |
| BF16/FP16 | 16.9est. | 19 | 22.2 | 35.1 |
Full calculation rules are on the Methodology page.
Can a single GPU run Llama 3.1 8B?
Yes. An 8GB card handles 4-bit with 8K of context (about 7 GB), which covers everyday chat. The part worth planning is context: the more text the model has to keep track of, the more VRAM it takes, and 4-bit at the full 128K needs 23.2 GB. On a 12GB or 16GB card, decide how much context you actually want first, then pick the highest quant that still fits; a 16GB card at 8-bit still gets you past 50K. If you want 8-bit and long documents, a 24GB RTX 3090 is the sweet spot, with room for about 120K and speed to spare.
| Device | Price | Speed t/s | Max context |
|---|---|---|---|
| $37024 listings | 132.9 | 92K | |
| $86958 listings | 73 | 92K | |
| $89518 listings | 132.9 | 128K | |
| Radeon RX 7900 XTX24 GB | $1,25029 listings | 140 | 128K |
| $1,799107 listings | 137.2 | 128K | |
| $3,75868 listings | 145.6 | 128K | |
| Ryzen AI Max+ 395 128GBWhole system · 128 GB | $4,46420 listings | 43.6 | 128K |
| $4,89916 listings | 116.6 | 128K | |
| Mac Studio M5 Ultra 96GBWhole system · 96 GB | $7,27412 listings | 169.9 | 128K |
| MacBook Pro M5 Max 128GBWhole system · 128 GB | $7,54920 listings | 96.4 | 128K |
| $8,24022 listings | 46.3 | 128K | |
| $8,395123 listings | 223.4 | 128K | |
| $22,50011 listings | 223.4 | 128K |
| Device | Price | Speed t/s | Max context |
|---|---|---|---|
| $37024 listings | 107.9 | 83K | |
| $86958 listings | 58.1 | 83K | |
| $89518 listings | 107.9 | 128K | |
| Radeon RX 7900 XTX24 GB | $1,25029 listings | 114 | 128K |
| $1,799107 listings | 111.6 | 128K | |
| $3,75868 listings | 118.7 | 128K | |
| Ryzen AI Max+ 395 128GBWhole system · 128 GB | $4,46420 listings | 34.4 | 128K |
| $4,89916 listings | 94.2 | 128K | |
| Mac Studio M5 Ultra 96GBWhole system · 96 GB | $7,27412 listings | 139.7 | 128K |
| MacBook Pro M5 Max 128GBWhole system · 128 GB | $7,54920 listings | 77.4 | 128K |
| $8,24022 listings | 36.6 | 128K | |
| $8,395123 listings | 186.9 | 128K | |
| $22,50011 listings | 186.9 | 128K |
| Device | Price | Speed t/s | Max context |
|---|---|---|---|
| $37024 listings | 69 | 56K | |
| $86958 listings | 36.1 | 56K | |
| $89518 listings | 69 | 128K | |
| Radeon RX 7900 XTX24 GB | $1,25029 listings | 73.2 | 120K |
| $1,799107 listings | 71.5 | 120K | |
| $3,75868 listings | 76.4 | 120K | |
| Ryzen AI Max+ 395 128GBWhole system · 128 GB | $4,46420 listings | 21.1 | 128K |
| $4,89916 listings | 59.8 | 128K | |
| Mac Studio M5 Ultra 96GBWhole system · 96 GB | $7,27412 listings | 91.1 | 128K |
| MacBook Pro M5 Max 128GBWhole system · 128 GB | $7,54920 listings | 48.6 | 128K |
| $8,24022 listings | 22.5 | 128K | |
| $8,395123 listings | 125.5 | 128K | |
| $22,50011 listings | 125.5 | 128K |
Only common GPUs and systems are listed, one set for models under 50B and another for larger ones, sorted by price from low to high.
What to know before running Llama 3.1 8B locally
Choose quantization by how much context you need
Between 4-bit (4.9 GB) and 8-bit (8.5 GB), pick the highest level that still fits the context you want. Every extra 1K tokens of context adds about 0.13 GB of cache, so 4-bit at 32K already needs 10.3 GB. Its native context is only 8K; the 128K comes from RoPE scaling.
What the license requires of fine-tunes
The Llama 3.1 Community License requires that when you distribute it or a model based on it, you prominently display “Built with Llama.” If you release a model trained or fine-tuned using it or its outputs, the name must begin with “Llama,” and companies with more than 700 million monthly active users need a separate license from Meta. Fine-tunes based on it are bound by the same license.
Tool calling
Llama 3.1 was trained with a tool-calling format and also knows three built-in tool names:
brave_search,wolfram_alphaandcode_interpreter. llama.cpp's llama-server recognizes them when you add--jinja. For sampling, stick with Meta's defaults:temperature0.6 andtop_p0.9.Where it shows its age
Its knowledge cutoff is December 2023, and it handles text only. It officially supports 8 languages: English, German, French, Italian, Portuguese, Hindi, Spanish and Thai. Chinese isn't among them, and Meta explicitly advises against using it to chat in unsupported languages without fine-tuning. For Chinese, look at Qwen3.5 9B instead.
Launch commands
Ollama
- Windows
- macOS
- Linux
ollama run llama3.1:8bllama.cpp
- NVIDIA
- AMD
- Mac
- CPU
llama-server -hf bartowski/Meta-Llama-3.1-8B-Instruct-GGUF:Q4_K_M \ -c 8192
vLLM
- Linux
- NVIDIA
- AMD
vllm serve meta-llama/Llama-3.1-8B-InstructBlackwell GPUs (RTX 50 series, RTX PRO 6000, B200) run NVFP4 weights natively, at about 30% of the original size.
vllm serve nvidia/Llama-3.1-8B-Instruct-NVFP4MLX
- Apple Silicon
On a Mac, pip install mlx-lm first; this command downloads the MLX weights from Hugging Face and starts an OpenAI-compatible server.
mlx_lm.server --model mlx-community/Llama-3.1-8B-Instruct-4bitFile names follow that week's model-library snapshot; the definitions are in the methodology. Methodology
Other models in the Meta family
| Model | Total params | Active params | 4-bit size |
|---|---|---|---|
| 3.2B | 3.2B | 2 GB | |
| 70.6B | 70.6B | 42.5 GB | |
| 108.6B | 17B | 65.4 GB | |
| 816B | 42B | 505.5 GB |