Gemma 4 31B
31.3B parameters · 256k context · apache-2.0 · released 2026-03-11
chatcodingagenticreasoningvision
In short
Gemma 4 31B is an open model from Google with 31.3B parameters. At Q4_K_M, Gemma 4 31B needs about 19 GB of memory at 8k context and 24 GB at 64k, counting the weights, the KV cache and runtime buffers. The cheapest hardware in Canada that runs Gemma 4 31B fully in memory at 64k context is the NVIDIA RTX PRO 4500 Blackwell, $6,599 at Amazon, at about 18 tok/s (estimated).
Updated . Speeds are estimates; how they are worked out.
Cheapest way to run it in Canada today
NVIDIA RTX PRO 4500 Blackwell, new at Amazon
Runs Gemma 4 31B at Q6_K fully in memory at 64k context, about 18 tok/sest.
$6,599
In stock, checked
What to run it on in Canada
Fully in memory at 64k context, priced at retailers today.
Cheapest
NVIDIA RTX PRO 4500 Blackwell18tok/sest.Q6_K
$6,599
Best value
NVIDIA GeForce RTX 509035tok/sest.Q6_K
$12,300
Fastest
NVIDIA GeForce RTX 509035tok/sest.Q6_K
$12,300
All hardware that runs it
Everything we price, best value first. Two cards split the model by layers.
2 other cards and machines we price cannot hold it at this context.
Memory needed
Weights, KV cache and runtime buffers at each context length (KV cache at fp16).
| Quant | File | @8k | @32k | @64k | @128k |
|---|---|---|---|---|---|
| Q4_K_Mgguf | 17.1 GB | 19.2 GB | 21.2 GB | 23.9 GB | 29.3 GB |
| mlx-4bitmlx | 17.1 GB | 19.3 GB | 21.3 GB | 24.0 GB | 29.4 GB |
| Q5_K_Mgguf | 20.2 GB | 22.3 GB | 24.3 GB | 27.0 GB | 32.4 GB |
| Q6_Kgguf | 23.5 GB | 25.6 GB | 27.6 GB | 30.3 GB | 35.7 GB |
| Q8_0gguf | 30.4 GB | 32.5 GB | 34.6 GB | 37.3 GB | 42.6 GB |
| mlx-8bitmlx | 31.4 GB | 33.6 GB | 35.6 GB | 38.3 GB | 43.7 GB |
Run it
Copy a command for the runtime you use.
- Q4_K_M
- Ollama
ollama run hf.co/unsloth/gemma-4-31B-it-GGUF:Q4_K_M - LM Studio
lms get unsloth/gemma-4-31B-it-GGUF@q4_k_m - llama.cpp
llama-server -hf unsloth/gemma-4-31B-it-GGUF:Q4_K_M
- Ollama
- mlx-4bit
- LM Studio
lms get mlx-community/gemma-4-31B-it-4bit - MLX
mlx_lm.server --model mlx-community/gemma-4-31B-it-4bit
- LM Studio
- Q5_K_M
- Ollama
ollama run hf.co/unsloth/gemma-4-31B-it-GGUF:Q5_K_M - LM Studio
lms get unsloth/gemma-4-31B-it-GGUF@q5_k_m - llama.cpp
llama-server -hf unsloth/gemma-4-31B-it-GGUF:Q5_K_M
- Ollama
- Q6_K
- Ollama
ollama run hf.co/unsloth/gemma-4-31B-it-GGUF:Q6_K - LM Studio
lms get unsloth/gemma-4-31B-it-GGUF@q6_k - llama.cpp
llama-server -hf unsloth/gemma-4-31B-it-GGUF:Q6_K
- Ollama
- Q8_0
- Ollama
ollama run hf.co/unsloth/gemma-4-31B-it-GGUF:Q8_0 - LM Studio
lms get unsloth/gemma-4-31B-it-GGUF@q8_0 - llama.cpp
llama-server -hf unsloth/gemma-4-31B-it-GGUF:Q8_0
- Ollama
- mlx-8bit
- LM Studio
lms get mlx-community/gemma-4-31B-it-8bit - MLX
mlx_lm.server --model mlx-community/gemma-4-31B-it-8bit
- LM Studio
Questions
- How much VRAM does Gemma 4 31B need?
- At Q4_K_M, Gemma 4 31B needs about 19 GB of memory at 8k context and 24 GB at 64k, counting the weights, the KV cache and runtime buffers.
- What is the best GPU for running Gemma 4 31B locally?
- The cheapest hardware in Canada that runs Gemma 4 31B fully in memory at 64k context is the NVIDIA RTX PRO 4500 Blackwell, $6,599 at Amazon, at about 18 tok/s (estimated). The best value is the NVIDIA GeForce RTX 5090 (about 35 tok/s for $12,300). The fastest we price is the NVIDIA GeForce RTX 5090, at about 35 tok/s.
- What is the cheapest way to run Gemma 4 31B in Canada today?
- The NVIDIA RTX PRO 4500 Blackwell, $6,599 new at Amazon, in stock: it runs Gemma 4 31B at Q6_K fully in memory at 64k context, at about 18 tok/s (estimated).
- Can I run Gemma 4 31B on a 16 GB GPU?
- Only partly: at 64k context it does not fit in 16 GB, so part of it runs from system RAM and it slows to about 4 tok/s on the AMD Radeon RX 9060 XT 16GB (estimated).
- Can I run Gemma 4 31B on a 24 GB GPU?
- Only partly: at 64k context it does not fit in 24 GB, so part of it runs from system RAM and it slows to about 16 tok/s on the AMD Radeon RX 7900 XTX (estimated).
- How do I run Gemma 4 31B locally?
- With Ollama: ollama run hf.co/unsloth/gemma-4-31B-it-GGUF:Q4_K_M (the Q4_K_M build). LM Studio and llama.cpp commands are on this page.
- What licence is Gemma 4 31B released under?
- apache-2.0, which allows commercial use.