Meta · released 2024-07-18
Llama 3.1 8B Instruct
Meta's 2024 8B chat model with a 128K context; old but still one of the most downloaded and fine-tuned open models.
- Parameters
- 8B
- Active / token
- 8B
- Context
- 128K
- Memory at Q4
- 6.7 GB
- License
- llama3.1
- Images
- No
- Thinking mode
- No
Cheapest ways to use it $0.02 in / $0.04 out per 1M tokens via DeepInfra (7 providers) · or free on RTX 4060 or better
Get started
1 · Try it now
Use via API from $0.02/1M on DeepInfraFree online chats are the quickest way to see if a model suits you before downloading anything.
2 · Download the files
- Official weights meta-llama/Llama-3.1-8B-Instructaccept licence first
- GGUF for Ollama, LM Studio, llama.cpp ggml-org/Meta-Llama-3.1-8B-Instruct-Q4_0-GGUF
- MLX for Macs (4-bit) mlx-community/Llama-3.1-8B-Instruct-4bit
- Licence llama3.1
You’ll need about 6.7 GB of memory at 4-bit. Check your machine →
3 · Run it on your machine
Install LM Studio, then click “Open in LM Studio” — or search for this in its Discover tab:
ggml-org/Meta-Llama-3.1-8B-Instruct-Q4_0-GGUFDownloads the file and starts a local chat server at http://localhost:8080:
llama-server -hf ggml-org/Meta-Llama-3.1-8B-Instruct-Q4_0-GGUF:Q4_0Fastest on Apple Silicon. Needs Python:
pip install mlx-lmmlx_lm.chat --model mlx-community/Llama-3.1-8B-Instruct-4bitFor a Linux GPU server, serving an OpenAI-compatible API:
vllm serve meta-llama/Llama-3.1-8B-InstructWill it run on my computer?
Llama 3.1 8B Instruct needs roughly 6.7 GB of GPU memory at the usual Q4 quality. Check your exact machine →
| Machine | Best file | Fit | Est. speed |
|---|---|---|---|
| RTX 4060 | Q5_K_M | Fits in memory | ~30 tok/s · Fast |
| RTX 3060 12GB | Q6_K | Fits in memory | ~34 tok/s · Fast |
| RTX 4060 Ti 16GB | Q6_K | Fits in memory | ~28 tok/s · Fast |
| RTX 3090 | Q6_K | Fits in memory | ~76 tok/s · Very fast |
| RTX 4090 | Q6_K | Fits in memory | ~80 tok/s · Very fast |
| RTX 5090 | Q6_K | Fits in memory | ~120 tok/s · Very fast |
| M4 · 16 GB | Q6_K | Fits in memory | ~11 tok/s · Usable |
| M4 Pro · 48 GB | Q6_K | Fits in memory | ~23 tok/s · Usable |
| M4 Max · 128 GB | Q6_K | Fits in memory | ~43 tok/s · Fast |
| M3 Ultra · 512 GB | Q6_K | Fits in memory | ~61 tok/s · Very fast |
| DGX Spark | Q6_K | Fits in memory | ~26 tok/s · Fast |
| Ryzen AI Max+ 395 | Q6_K | Fits in memory | ~20 tok/s · Usable |
PCs assume 64 GB system RAM. Estimates, not measurements — method.
Ways to run it
Use it through an API 7 providers
Heads up: providers serve this model at different compression levels (fp8, int4). 4-bit versions are cheaper to run and can be slightly worse.
| Provider | Input / 1M | Output / 1M | Stated precision | Context | |
|---|---|---|---|---|---|
| DeepInfra | $0.02 | $0.04 | fp8 | 128K | source ↗ |
| Cloudflare Workers AI | $0.045 | $0.38 | fp8 | — | source ↗ |
| Cloudflare Workers AI | $0.12 | $0.27 | int4 | — | source ↗ |
| Cloudflare Workers AI | $0.15 | $0.29 | fp8 | — | source ↗ |
| Amazon Bedrock | $0.22 | $0.22 | not stated | — | source ↗ |
| Featherless | $0.20 | $0.32 | not stated | 32K | source ↗ |
| Cloudflare Workers AI | $0.28 | $0.83 | not stated | — | source ↗ |
Prices in USD from each provider’s own pricing page, checked 2026-12-04. Cheapest highlighted.
Rent a GPU and run it yourself
| Setup | From | Per hour | File | Est. speed | Per 1M tokens* |
|---|---|---|---|---|---|
| 1× RTX A5000 24GB | RunPod community | $0.16 | 8-bit 10.4 GB | ~54 tok/s | $0.83 |
| 1× RTX 3090 24GB | Vast.ai marketplace | $0.21 | 8-bit 10.4 GB | ~63 tok/s | $0.93 |
| 1× RTX 3090 Ti 24GB | Vast.ai marketplace | $0.27 | 8-bit 10.4 GB | ~67 tok/s | $1.12 |
| 1× L4 24GB | Vast.ai marketplace | $0.32 | 8-bit 10.4 GB | ~23 tok/s | $3.84 |
*For one conversation at a time. Serving many users at once (batching, e.g. with vLLM) cuts the cost per token by 10× or more, which is how API providers get so cheap. Rental prices checked 2026-12-04. All GPU prices →
On your own machine
Free after the hardware. See the table above for which GPUs and Macs can run it, or check your exact machine. Easiest apps: Ollama and LM Studio.
Memory by quality level
| File | Quality | Weights | + 8K context | Total |
|---|---|---|---|---|
| Q3_K_M | Noticeably worse | 3.9 GB | 1.1 GB | 5.7 GB |
| Q4_K_M | Good — the usual pick | 4.8 GB | 1.1 GB | 6.7 GB |
| Q5_K_M | Very close to full | 5.7 GB | 1.1 GB | 7.5 GB |
| Q6_K | Near lossless | 6.6 GB | 1.1 GB | 8.5 GB |
| Q8_0 | Practically lossless | 8.5 GB | 1.1 GB | 10.4 GB |
| FP16 | Full precision | 16.0 GB | 1.1 GB | 18.2 GB |
Test answers
Llama 3.1 8B Instruct is queued for our test suite. See tested models →