Can I run Gemma 4 31B locally?
Start here
Built for from the model card, not a ranking by Will It Run?
Coding: writing and fixing code Reasoning: working through a problem in steps Vision: looking at pictures or video Agents: a multi-step job, often with tools
Reasoning, agent workflows, coding, and understanding images.
The words after each colon are our plain-language explanation of that label. The sentence under the labels is a short paraphrase of the model card.
At the common Q4_K_M quantization it needs about 22.0 GB ESTIMATE. That figure is weights plus a 4k context, the same estimate used everywhere else on this site.
The checker asks for your GPU, Mac, or CPU and uses the same estimate. It does not rank models.
This site does not download the model. To run one yourself, use the model card and an app you install. Their docs: Ollama, LM Studio, llama.cpp. This is not a pick of one app. A memory estimate is not a promise that an app can load that file.
Gemma 4 31B has 31.27 billion parameters (Hugging Face). At the popular Q4_K_M quantization it needs roughly 22.0 GB of GPU memory ESTIMATE. It has been on Hugging Face since 2026-03-11.
Memory needed by quantization
| Quant | Weights | Total needed (est.) |
|---|---|---|
| IQ1_S | 6.1 GB | 8.5 GB |
| IQ2_XXS | 8.1 GB | 10.6 GB |
| IQ2_XS | 9.0 GB | 11.6 GB |
| IQ2_M | 10.6 GB | 13.2 GB |
| Q2_K | 12.4 GB | 15.1 GB |
| IQ3_XXS | 12.0 GB | 14.7 GB |
| Q3_K_S | 14.3 GB | 17.1 GB |
| IQ3_S | 13.4 GB | 16.2 GB |
| IQ3_M | 14.3 GB | 17.1 GB |
| Q3_K_M | 15.6 GB | 18.5 GB |
| IQ4_XS | 16.6 GB | 19.6 GB |
| Q4_0 | 17.6 GB | 20.6 GB |
| Q4_K_M | 19.0 GB | 22.0 GB |
| MXFP4 | 18.1 GB | 21.1 GB |
| Q5_K_M | 22.2 GB | 25.5 GB |
| Q6_K | 25.6 GB | 29.0 GB |
| Q8_0 | 33.2 GB | 37.0 GB |
| F16 | 62.5 GB | 67.1 GB |
KV cache by context length ESTIMATE
| Context | f16 | q8_0 | q4_0 |
|---|---|---|---|
| 4k | 1.51 GB | 0.80 GB | 0.42 GB |
| 8k | 2.18 GB | 1.16 GB | 0.61 GB |
| 16k | 3.52 GB | 1.87 GB | 0.99 GB |
| 32k | 6.21 GB | 3.30 GB | 1.75 GB |
| 64k | 11.58 GB | 6.15 GB | 3.26 GB |
| 128k | 22.31 GB | 11.85 GB | 6.28 GB |
From config.json: 10 KV-caching attention layers, 16 KV heads × 256 head dim, plus 50 sliding-window layers (1024 tokens). Max context 256k. The tables above assume 4k context.
Which GPUs and Macs can run it?
Smallest memory that fits, by our ESTIMATE, at a 4k context: Q4_K_M — 24 GB of GPU or Mac memory (14 in this list, tight), Q8_0 — 48 GB of GPU or Mac memory (6 in this list), F16 — 72 GB of GPU or Mac memory (2 in this list, tight). Where a memory size is shown, it is the smallest memory in the table where the estimate says that quantization fits. It is not the fastest card, and it is not a suggestion to buy hardware.
Sorted by memory, smallest first. ✅ fits · ⚠️ fits with little headroom · ❌ doesn't fit on this one device (multiple GPUs or RAM offload may work; check your setup). Apple Silicon uses the same macOS GPU limit as the checker and What fits my GPU?: about 67% of memory below 64 GB and about 75% at 64 GB or more. A row marked smallest Q4_K_M, Q8_0, or F16 is that smallest memory. All fit verdicts are ESTIMATE. CPU only / Intel Mac is not in this table, because the fit depends on system RAM. Check a CPU-only setup.
Smaller hardware (88)
Less memory than the table below. By our estimate, none of these fit Q4_K_M, Q8_0, or F16.
| Hardware | Memory | Q4_K_M | Q8_0 | F16 |
|---|---|---|---|---|
| RTX 2080 Ti 22GB (modded) | 22 GB | ❌ | ❌ | ❌ |
| AMD Ryzen AI Max 390/385 Strix Halo 32GB (Linux, ~24 GB for GPU) · Radeon 8050S · Framework Desktop / GMKtec EVO-X2 / HP Z2 Mini G1asmallest Q4_K_M | 24 GB | ⚠️ tight | ❌ | ❌ |
| AMD Ryzen AI Max 390/385 Strix Halo 32GB (Windows, ~24 GB for GPU) · Radeon 8050S · Framework Desktop / GMKtec EVO-X2 / HP Z2 Mini G1a | 24 GB | ⚠️ tight | ❌ | ❌ |
| AMD Ryzen AI Max+ 395 Strix Halo 32GB (Linux, ~24 GB for GPU) · Radeon 8060S · Framework Desktop / GMKtec EVO-X2 / HP Z2 Mini G1a | 24 GB | ⚠️ tight | ❌ | ❌ |
| AMD Ryzen AI Max+ 395 Strix Halo 32GB (Windows, ~24 GB for GPU) · Radeon 8060S · Framework Desktop / GMKtec EVO-X2 / HP Z2 Mini G1a | 24 GB | ⚠️ tight | ❌ | ❌ |
| Apple M2 (24 GB) | 24 GB | ❌ | ❌ | ❌ |
| Apple M3 (24 GB) | 24 GB | ❌ | ❌ | ❌ |
| Apple M4 (24 GB) | 24 GB | ❌ | ❌ | ❌ |
| Apple M4 Pro (24 GB) | 24 GB | ❌ | ❌ | ❌ |
| Apple M5 (24 GB) | 24 GB | ❌ | ❌ | ❌ |
| Apple M5 Pro (24 GB) | 24 GB | ❌ | ❌ | ❌ |
| Intel Arc Pro B60 | 24 GB | ⚠️ tight | ❌ | ❌ |
| Radeon RX 7900 XTX | 24 GB | ⚠️ tight | ❌ | ❌ |
| RTX 3090 | 24 GB | ⚠️ tight | ❌ | ❌ |
| RTX 3090 Ti | 24 GB | ⚠️ tight | ❌ | ❌ |
Show all hardware (70 more)
The rest of the list, still sorted by memory, smallest first.
Detailed GPU pages
Gemma 4 31B on RTX 3060 12GB · Gemma 4 31B on RTX 3090 · Gemma 4 31B on RTX 5090 · Gemma 4 31B on Apple M4 Pro (48 GB) · Gemma 4 31B on Apple M4 Max (128 GB)
Browse by memory: 8 GB · 12 GB · 16 GB · 24 GB · 32 GB · 48 GB · 80 GB
Will It Run? Pro NOT BUILT YET
A personal setup for your exact hardware (Ollama / llama.cpp configs ready for your coding agent), an alert when a new model fits, and a one-click cloud fallback when it doesn't.
Not built yet. Join the waitlist, $10/mo planned, no charge now. What's planned
Email only. No payment info.
Get the weekly "new models & what it takes to run them" email
Free. One email a week. Unsubscribe anytime.