Gemma 4 31B in Q4_K_M with an 8k context takes 19.7 GB of GPU memory. The cheapest option right now is 2× RTX 3060 12 GB, from $0.174/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 | 57.2 | 59.9 | 61.7 | 69.2 | RTX PRO 5000 72 GB |
| Q8_0 | 30.4 | 33.1 | 34.9 | 42.4 | A100 PCIe 40 GB |
| Q6_K | 23.5 | 26.1 | 28.0 | 35.5 | Tesla V100 32 GB |
| Q5_K_M | 20.2 | 22.8 | 24.7 | 32.2 | RTX 3090 24 GB |
| Q4_K_M | 17.1 | 19.7 |
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.
| 21.6 |
| 29.1 |
| RTX 3090 24 GB |
| Q3_K_M | 13.7 | 16.4 | 18.3 | 25.8 | RTX 4000 Ada 20 GB |
| UD-Q2_K_XL | 11.0 | 13.6 | 15.5 | 23.0 | RTX A4000 16 GB |
How much memory the cache takes per request in FP16. A Q8 cache is about half. 80 KB per token + 1024 × 800 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.