Llama 3.1 8B in Q4_K_M with an 8k context takes 6.6 GB of GPU memory. The cheapest option right now is RTX 3060 12 GB, from $0.084/h.
The weight file and the total GPU memory with the context cache. One GPU, one request.
| Quantisation | File | 8K context | 32K context | 128K context | Fits on |
|---|---|---|---|---|---|
| BF16 | 15.0 | 17.0 | 20.0 | 32.0 | RTX 4000 Ada 20 GB |
| Q6_K | 6.1 | 8.1 | 11.1 | 23.1 | RTX 3080 10 GB |
| Q5_K_M | 5.3 | 7.3 | 10.3 | 22.3 | RTX 4060 8 GB |
| Q4_K_M | 4.6 | 6.6 | 9.6 | 21.6 | RTX 4060 8 GB |
| Q3_K_M | 3.7 | 5.7 | 8.7 | 20.7 | RTX A2000 6 GB |
| Q2_K | 3.0 | 5.0 | 8.0 | 20.0 | RTX A2000 6 GB |
How much memory the cache takes per request in FP16. A Q8 cache is about half. 128 KB per token.
GPUs from the catalog the model fits on, by price per hour.
The price is the cheapest GPU of the model × the GPU count. A 2–8 GPU server can cost a little more per GPU.
In the Ollama template the model is one command away:
ollama run llama3.1:8bFor an API under load there is the vLLM template with an OpenAI-compatible API.
File sizes checked against Hugging Face on 2026-10-19. 1 GB here is 1024³ bytes, like GPU memory. Hugging Face lists decimal gigabytes, so its numbers are 7% larger.