Can I run Llama 3.1 8B on the GeForce RTX 4090?
Runs greatQ4_K_M fits in VRAM with 16.8 GB to spare: Runs great, 91.0 tok/s measured at 4k context (1 run; 8k estimate 117.7 tok/s, 103.6–131.8, calibrated estimate ±12%).
24 GB VRAM · 1,008.0 GB/s · FP16 82.6 TFLOPS. Assumes 32 GB of DDR5-5600 system RAM, Windows with this GPU driving the display, 8k context and an f16 KV cache. The GeForce RTX 3090 Ti has the same memory setup (24 GB, 1,008.0 GB/s), so its generation-speed estimate is the same; only prompt processing differs. Prompt processing: about 11,564 tok/s (6,938–16,190, rough estimate ±40%) here vs about 5,600 tok/s (3,360–7,840, rough estimate ±40%) on the GeForce RTX 3090 Ti.
Every quant of Llama 3.1 8B on the GeForce RTX 4090
| Quant | File size | Verdict | Speed | Memory | Runs as | Notes |
|---|---|---|---|---|---|---|
| Q2_K | 3.18 GB | Runs great | est. 165.9 tok/s146.0–185.8calibrated estimate ±12% | 5.4 / 24.0 GB | Full GPU | — |
| IQ4_XS | 4.45 GB | Runs great | est. 127.7 tok/s112.4–143.1calibrated estimate ±12% | 6.7 / 24.0 GB | Full GPU | — |
| Q4_K_Mbaseline | 4.92 GB | Runs great | 91.0 tok/s8k estimate 117.7 tok/s (103.6–131.8, calibrated estimate ±12%)measured (1 run, 4k context) | 7.2 / 24.0 GB | Full GPU | — |
| Q8_0 | 8.54 GB | Runs great | est. 73.4 tok/s64.6–82.2calibrated estimate ±12% | 10.8 / 24.0 GB | Full GPU | — |
Where the memory goes at Q4_K_M
- Weights
- 4.9 GB
- KV cache
- 1.1 GB
- Compute buffer
- 0.6 GB
- OS reserve
- 0.6 GB
- Free
- 16.8 GB
Context length vs. KV cache
| Context | KV f16 | KV q8_0 | KV q4_0 |
|---|---|---|---|
| 4k | 6.0 GBRuns great est. 129.3 tok/s113.8–144.8calibrated estimate ±12% | 5.7 GBRuns great est. 135.5 tok/s119.2–151.8calibrated estimate ±12% | 5.6 GBRuns great est. 139.1 tok/s122.4–155.8calibrated estimate ±12% |
| 8k | 6.6 GBRuns great 91.0 tok/s8k estimate 117.7 tok/s (103.6–131.8, calibrated estimate ±12%)measured (1 run, 4k context) | 6.1 GBRuns great est. 128.4 tok/s113.0–143.8calibrated estimate ±12% | 5.8 GBRuns great est. 135.0 tok/s118.8–151.2calibrated estimate ±12% |
| 16k | 7.7 GBRuns great est. 99.8 tok/s87.9–111.8calibrated estimate ±12% | 6.7 GBRuns great est. 116.3 tok/s102.3–130.2calibrated estimate ±12% | 6.2 GBRuns great est. 127.5 tok/s112.2–142.9calibrated estimate ±12% |
| 32k | 10.0 GBRuns great est. 76.6 tok/s67.4–85.8calibrated estimate ±12% | 8.0 GBRuns great est. 97.8 tok/s86.0–109.5calibrated estimate ±12% | 6.9 GBRuns great est. 114.8 tok/s101.1–128.6calibrated estimate ±12% |
| 64k | 14.6 GBRuns great est. 52.2 tok/s46.0–58.5calibrated estimate ±12% | 10.6 GBRuns great est. 74.2 tok/s65.3–83.1calibrated estimate ±12% | 8.5 GBRuns great est. 95.8 tok/s84.3–107.3calibrated estimate ±12% |
| 128k | 23.8 GBRuns well est. 14.5 tok/s11.6–17.4calibrated estimate ±20% | 15.8 GBRuns great est. 50.0 tok/s44.0–56.0calibrated estimate ±12% | 11.5 GBRuns great est. 71.9 tok/s63.3–80.5calibrated estimate ±12% |
S = Runs great · A = Runs well · B = Runs slowly · F = Won't run
At Q4_K_M the verdict stays Runs great up to 64k context with an f16 KV cache, and up to 128k with q8_0.
Estimated speed
- Generation
- 91.0 tok/s measured at 4k context (1 run; 8k estimate 117.7 tok/s, 103.6–131.8, calibrated estimate ±12%)
- Prompt processing
- about 11,564 tok/s (6,938–16,190, rough estimate ±40%)
Measured on this exact combination
Public benchmarks we calibrate against. Their conditions (context, backend, flags) can differ from the estimates above.
| Hardware | Quant | Backend | Context | Prompt (tok/s) | Generation (tok/s) | Flags | Source | Measured |
|---|---|---|---|---|---|---|---|---|
| GeForce RTX 4090 | Q4_K_M | llama.cpp | 4k | 6,697.0 | 91.0 | ctx-weighted | localscore.ai | 2026-08-09 |
If this is not enough
A larger model that also runs well on the GeForce RTX 4090
Runs greatQwen3.5 35B-A3B: Runs great, est. 220.6 tok/s (176.5–264.7, calibrated estimate ±20%)
A larger quant that still runs great
Runs greatQ8_0 (8.54 GB): Runs great, est. 73.4 tok/s (64.6–82.2, calibrated estimate ±12%)
How to run it
Commands for the Q4_K_M file. Both tools download from Hugging Face on first run.
File: Meta-Llama-3.1-8B-Instruct-Q4_K_M.gguf (4.92 GB) from bartowski/Meta-Llama-3.1-8B-Instruct-GGUF.
llama-server -hf bartowski/Meta-Llama-3.1-8B-Instruct-GGUF:Q4_K_M -c 8192 -ngl all -fa on- -ngl all loads every layer on the GPU.
- -fa on enables flash attention (needed for KV cache quantization).
- --cache-type-k q8_0 --cache-type-v q8_0 shrinks the KV cache to 0.57 GB at 8k context.
PowerShell (quit the Ollama tray app first):
$env:OLLAMA_CONTEXT_LENGTH="8192"; ollama serve
ollama run hf.co/bartowski/Meta-Llama-3.1-8B-Instruct-GGUF:Q4_K_M- Ollama defaults to 4k context on GPUs under 24 GB. Set OLLAMA_CONTEXT_LENGTH when starting the server, or /set parameter num_ctx inside the chat.
/set parameter num_ctx 8192
Related pages
Guide: How much VRAM do local LLMs need? 8–32 GB tiers (2026)
Other models on the GeForce RTX 4090
Llama 3.1 8B on other hardware
Frequently asked questions
Can I run Llama 3.1 8B on the GeForce RTX 4090?
Q4_K_M fits in VRAM with 16.8 GB to spare: Runs great, 91.0 tok/s measured at 4k context (1 run; 8k estimate 117.7 tok/s, 103.6–131.8, calibrated estimate ±12%). Q4_K_M needs 6.6 GB at 8k context; this setup has 23.4 GB of usable memory and 28.0 GB of free system RAM.
How much context can Llama 3.1 8B use on the GeForce RTX 4090?
At Q4_K_M the verdict stays Runs great up to 64k context with an f16 KV cache (8.6 GB of KV) and up to 128k with a q8_0 KV cache (9.2 GB). The model supports up to 128k.
Which quant should I use, and how fast is it?
Q4_K_M (4.92 GB) is the recommended balance: Runs great, 91.0 tok/s measured at 4k context (1 run; 8k estimate 117.7 tok/s, 103.6–131.8, calibrated estimate ±12%). The largest tracked file that still gets Runs great is Q8_0 (8.54 GB), est. 73.4 tok/s (64.6–82.2, calibrated estimate ±12%).
Speeds are estimates from memory bandwidth, calibrated against public benchmarks, and each one comes with an error band and a confidence label. Real results vary with drivers, backend, context length and thermals.