Gemma 4 12B in Q4_K_M with an 8k context takes 8.3 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 | 22.2 | 23.9 | 24.3 | 25.8 | Tesla V100 Super 32 GB |
| Q8_0 | 11.8 | 13.5 | 13.9 | 15.4 | RTX 4070 Ti Super 16 GB |
| Q6_K | 9.1 | 10.8 | 11.2 | 12.7 | RTX 3060 12 GB |
| Q5_K_M | 7.8 | 9.5 | 9.9 | 11.4 | RTX 3080 10 GB |
| Q4_K_M | 6.6 | 8.3 | 8.7 | 10.2 | RTX 3080 10 GB |
| Q3_K_M | 5.3 | 7.0 | 7.4 | 8.9 | RTX 4060 8 GB |
| UD-Q2_K_XL | 4.3 | 6.0 | 6.4 | 7.9 | RTX 4060 8 GB |
How much memory the cache takes per request in FP16. A Q8 cache is about half. 16 KB per token + 1024 × 320 KB.
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.
For 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.