Skip to content

Text model · Gemma

Gemma 4 31B: RAM and VRAM requirements

Gemma 4 31B needs about 20.5 GB to run at Q4_K_M (the Q4_K_M GGUF file is ~18.32 GB to download; KV cache and overhead add the rest), or about 34.8 GB at Q8_0. The lightest hardware that runs it is Nvidia GeForce RTX 4090 (24GB).

Gemma family · 32.7B params · released Mar 2026.

Shopping for hardware? See what runs Gemma 4 31B →

License Apache-2.0 · Commercial OK ↓ 11.9M/mo ♥ 3.4K on HuggingFace
Q4_K_M GGUF
18.32 GB
Q8_0 GGUF
32.64 GB
Memory @ Q4 (4k)
~20.5 GB
Context
256 k

Q4_K_M and Q8_0 are GGUF download (file) sizes. Memory @ Q4 includes the KV cache and overhead, so it runs larger than the file on disk.

Will it run on your device?

Gemma 4 31B runs on 13 of 40 tracked devices at Q4_K_M.

12 run well 1 tight fit 27 too small
Fit check Q4_K_M
No, not enough memory
needs 20.5 GB usable 10.5 GB
See the full breakdown

Memory breakdown

Weights (Q4_K_M)18.32 GB
+
KV cache (4k)1.4 GB
+
Overhead0.8 GB
=
Total20.5 GB

How context length changes it

4k context ~20.5 GB 32k context ~30.1 GB 128k context ~63 GB

Longer context grows the KV cache quickly: Gemma 4 31B needs ~20.5 GB at 4k but ~63 GB at 128k, which can push it past a device that fits it at a short context.

Speed drops too: every token re-reads the KV cache, so at 128k context Gemma 4 31B generates at roughly ~29% of its short-context speed. How this is estimated.

Quantization sizes

GGUF quantson disk
Quantization Size on disk
Q2_K 13.7 GB est
Q3_K_M 16 GB est
Q4_K_M (default) 18.32 GB
Q5_K_M 23.3 GB est
Q6_K 26.8 GB est
Q8_0 32.64 GB
FP16 61.41 GB

Lower quant = smaller and faster, slightly lower quality. Q4_K_M is the common default.

Run it

Ollama
$ ollama run gemma4:31b
llama.cpp
$ llama-cli -hf unsloth/gemma-4-31B-it-GGUF:Q4_K_M
LM Studio
$ lms get unsloth/gemma-4-31B-it-GGUF

Which devices can run Gemma 4 31B?

Same job, different size

Pick by what fits your memory: step down to free up VRAM, or step up if you have headroom.

Similar models

Head-to-head

FAQ

How much VRAM or RAM does Gemma 4 31B need?

At Q4_K_M, Gemma 4 31B needs about 20.5 GB (weights ~18.32 GB + KV cache + overhead) at a 4k context. At Q8_0 budget ~34.8 GB.

What is the Q4_K_M GGUF file size of Gemma 4 31B?

The Q4_K_M GGUF file is about 18.32 GB to download, and the Q8_0 GGUF is about 32.64 GB. That is the weights file on disk; to run it you also need room for the KV cache and overhead, so budget ~20.5 GB of memory at Q4_K_M.

Can Gemma 4 31B run on a laptop?

Gemma 4 31B is large; you need a 24 GB+ GPU or a 32-48 GB Mac at Q4_K_M.

Can I use Gemma 4 31B commercially?

Yes. Gemma 4 31B is licensed Apache-2.0, which permits commercial use.

Understand the numbers

Short guides to the ideas behind Gemma 4 31B's memory and quant figures.

Gemma 4 flagship dense model: 30.7B text params per the model card, 32.7B in safetensors incl. vision tower. Multimodal, 256K context. Sizes from unsloth HF repo; Ollama default pulls 20GB Q4_K_M. Successor slot to Gemma 3 27B.

Sources

Last validated 2026-08-03. Memory figures are estimates. See methodology.