How to Deploy Gemma 4 31B Locally
Gemma 4 31B is a dense model with 31.3B parameters. At Q4 it needs at least 26GB of VRAM, and 32GB is the comfortable amount for an 8K context. The cheapest card that runs it today is the Tesla V100 32GB at about $1,141, at roughly 28.5 tokens/s.
Gemma 4 31B details
How much VRAM does Gemma 4 31B need for local deployment?
| Quantization | WeightsGB | Total at 8KGB | Total at 32KGB | Total at 128KGB |
|---|---|---|---|---|
| 1-bit | 7.3est. | 15.8 | 38.3 | 128.3 |
| 2-bit | 11.8GGUF | 20.1 | 42.6 | 132.6 |
| 3-bit | 15.4GGUF | 23.5 | 46 | 136 |
| 4-bit | 18.3GGUF | 25.9 | 48.4 | 138.4 |
| 5-bit | 21.7GGUF | 29.6 | 52.1 | 142.1 |
| 8-bit | 32.6GGUF | 40.9 | 63.4 | 153.4 |
| FP16 | 61.4GGUF | 69.7 | 92.2 | 182.2 |
Total = weights + KV cache (FP16) + 1GB runtime overhead. Weights marked GGUF are measured file sizes from the repository; the rest are estimated from bytes per parameter. Contexts beyond this model's 256K limit show a dash. Each tier takes whichever file of that bit width the repository has, preferring unsloth dynamic quants, so the exact file name varies by model.
Which GPUs can run Gemma 4 31B?
AmazonJP
| Device | VRAMGB | Price | Est. t/s | Suggested context |
|---|---|---|---|---|
| 32 | $1,1413 listings | 28.5 | 8K | |
| 32 | $2,0743 listings | 12.6 | 8K | |
| 32 | $2,2446 listings | 14.7 | 8K | |
| 128 | $3,9136 listings | 5.9 | 32K | |
| 32 | $7,4899 listings | 55.6 | 8K | |
| 128 | $8,2233 listings | 8.8 | 32K | |
| 32 | —No listings | 12.6 | 8K | |
| 32 | —No listings | 23.4 | 8K | |
| 32 | —No listings | 55.6 | 8K | |
| 32 | —No listings | 27.8 | 8K | |
| 32 | —No listings | 23.3 | 8K | |
| 32 | —No listings | 13.2 | 8K | |
| 32 | —No listings | 28.4 | 8K | |
| 40 | —No listings | 48.5 | 8K | |
| 40 | —No listings | 48.6 | 8K | |
| 48 | —No listings | 31.9 | 8K | |
| 48 | —No listings | 19.7 | 8K | |
| 48 | —No listings | 42.1 | 8K | |
| 64 | —No listings | 46.6 | 32K | |
| 64 | —No listings | 36.9 | 32K | |
| 72 | —No listings | 42.1 | 32K | |
| 84 | —No listings | 48.9 | 32K | |
| 96 | —No listings | 55.6 | 32K | |
| Mac Studio M4 Max 128GB | 128 | —No listings | 13.8 | 32K |
| Mac Studio M5 Max 128GB | 128 | —No listings | 15.5 | 32K |
| MacBook Pro M4 Max 128GB | 128 | —No listings | 13.8 | 32K |
| MacBook Pro M5 Max 128GB | 128 | —No listings | 15.5 | 32K |
| Mac Studio M3 Ultra 512GB | 512 | —No listings | 20.5 | 128K |
Fits when weights + KV cache + runtime overhead is at or below usable memory, single card. "Offload" on MoE models means it runs with expert weights in system RAM (only attention layers and KV cache stay in VRAM); that speed assumes 70 GB/s RAM bandwidth. The context column is the largest tier that fits.
Deploy Gemma 4 31B locally with Ollama, llama.cpp or vLLM
The Ollama library has no official tag for it yet.
llama.cpp pulls the GGUF straight from Hugging Face; -c sets the context length.
llama-server -hf unsloth/gemma-4-31B-it-GGUF:Q4_K_M -c 8192
vLLM serves the original-precision weights, which needs far more memory than GGUF and usually more than one GPU.
vllm serve google/gemma-4-31B-it
File names follow that week's model-library snapshot; the definitions are in the methodology. Methodology
FAQ
How much VRAM does Gemma 4 31B need?
At Q4_K_M with an 8K context Gemma 4 31B needs about 26GB of VRAM; 32GB leaves comfortable headroom.
What is the cheapest GPU that runs Gemma 4 31B?
The Tesla V100 32GB: 32GB of VRAM, currently about $1,141, at roughly 28.5 tokens/s.
Can you run Gemma 4 31B with Ollama?
Not yet: the Ollama library has no official tag for it. You can load the GGUF with llama.cpp instead.