Gemma 4 VRAM
VRAM is the memory on a graphics card. Gemma 4 needs between 2.9 GB and 17.5 GB of it for the model at 4-bit, and then more for the conversation: the longer the chat or document, the more memory it takes. This page has Google's figures, a calculator that adds the two together, and what EmbeddingGemma 2 needs.
Model figures are Google's; conversation figures are this site's estimates · checked October 8, 2026
VRAM calculator
Pick a model, how compressed it is, how long your conversations are and how many run at once.
The model figure is Google's and already includes about 20% for loading overhead. The conversation cache is this site's estimate, worked out from each model's published configuration and assuming a 16-bit cache; your app may use somewhat more or less. "Fits" leaves at least 1 GB of the card free. See how it is calculated. On a Mac, read "VRAM" as total memory and see the Mac page.
Memory for the model
Google's published figures for loading each size.
| Model | Full precision BF16 | 8-bit SFP8 | 4-bit Q4_0 | Mobile format |
|---|---|---|---|---|
| Gemma 4 E2B | 11.4 GB | 5.7 GB | 2.9 GB | 1.1 GB |
| Gemma 4 E4B | 17.9 GB | 8.9 GB | 4.5 GB | 2.5 GB |
| Gemma 4 12B | 26.7 GB | 13.4 GB | 6.7 GB | - |
| Gemma 4 26B A4B | 57.7 GB | 28.8 GB | 14.4 GB | - |
| Gemma 4 31B | 69.9 GB | 34.9 GB | 17.5 GB | - |
What the figures include
Google says they cover the static model weights plus about 20% overhead for loading, and may vary with your tools.
The 26B A4B loads in full
It activates about 4 billion parameters per token, but all 26 billion must be in memory. It is quick to run, not small to load.
Edge models are bigger than their names
"E" means effective parameters. Their per-layer embedding tables make the memory needed higher than 2B or 4B suggests.
From Google's Gemma 4 overview. Google also lists text-only mobile figures of 0.84 GB for E2B and 2.2 GB for E4B. The official 4-bit builds are explained on the QAT page; fine-tuning needs far more memory than the figures here.
Memory for the conversation
As it reads, the model keeps a cache of what it has seen so it does not start again with every word. Google's guidance: "Larger context windows require significantly more VRAM on top of the base model weights."
| Conversation length | 31B | 26B A4B | 12B |
|---|---|---|---|
| 4K | 1.2 GB | 0.3 GB | 0.4 GB |
| 8K | 1.5 GB | 0.4 GB | 0.5 GB |
| 16K | 2.2 GB | 0.5 GB | 0.6 GB |
| 32K | 3.5 GB | 0.9 GB | 0.9 GB |
| 64K | 6.2 GB | 1.6 GB | 1.4 GB |
| 128K | 11.6 GB | 2.9 GB | 2.5 GB |
| 256K | 22.3 GB | 5.6 GB | 4.6 GB |
The 31B pays most for length
At the full 256K it needs about 22 GB of cache, four times the 26B A4B's 5.6 GB and nearly five times the 12B's 4.6 GB.
Compression stops helping
At 4-bit and 256K, the 31B's cache (22 GB) is larger than the model (17.5 GB). Cutting context saves more than compressing further.
Most layers barely add to it
Five layers in six only look back 1,024 tokens, so their cache stops growing. The rest see everything and carry almost all the cost.
Each conversation has its own
Serving eight people at once means eight caches. The model itself is loaded only once.
Estimates for one conversation with a 16-bit cache, calculated by this site from the models' configuration files; they are not measurements. E2B and E4B are left out: they share cached data between layers, which keeps their cache small, and this site has not put a figure on it. How the attention pattern works is on the features page and in the specs.
Which graphics card for which model
At 4-bit, with a 32K-token conversation unless stated.
| Card memory | Best fit | Notes | Out of reach |
|---|---|---|---|
| 8 GB | E4B | E2B for more headroom | 12B |
| 12 GB | 12B | About 7.6 GB at 32K context | 26B A4B |
| 16 GB | 12B, with long context | 26B A4B is a tight fit: about 15.3 GB at 32K | 31B |
| 24 GB | 26B A4B | 31B fits at 32K (about 21 GB) but not at long context | 31B with a very long context |
| 32 GB | 31B | About 29 GB at 128K context | 31B at the full 256K |
| 48 GB | 31B, any context | About 40 GB at 256K; or 8-bit builds of the 12B | 31B at full precision |
| 80 GB | 31B at 8-bit, or 26B A4B at full precision | The usual server card | 31B at full precision with long context |
This site's guidance, from Google's model figures plus the cache estimates above. If a model does not fit, most apps move part of it to ordinary memory and the processor, which works but is much slower. For the whole machine, not only the graphics card, see system requirements; to pick an app, the runtime selector.
How to use less VRAM
Shorten the context
The biggest saving on long work. Set the context length to what you need; in Ollama, /set parameter num_ctx 32768. In vLLM, --max-model-len.
Use a 4-bit QAT build
About a quarter of the full-precision memory, trained by Google for that format.
Pick the 26B A4B or 12B for long documents
Both need far less cache than the 31B at the same length.
Compress the cache on servers
vLLM's --kv-cache-dtype fp8 stores it more compactly; the vLLM recipes put the saving at about 50%.
Start a fresh chat
A long conversation keeps everything. A new one, with a short summary pasted in, starts small.
Lower the image detail
Each image takes 70 to 1,120 tokens of context. Use a lower setting when fine detail does not matter.
Flags from the vLLM Gemma 4 recipes and Ollama's documentation; the rest is this site's guidance. Serving setups are on the self-hosting page; Ollama settings on the Ollama page; prompt habits in the prompt guide.
EmbeddingGemma 2 VRAM
EmbeddingGemma 2, Google's model for search across text, images, audio and video, needs very little. It has 740M parameters, runs on a phone, and works without a graphics card at all. A card helps only when you are indexing a large collection.
Memory in use on a Pixel 11 Pro, with quantization, as reported by Google.
Same device, text-only mode.
This site's estimate at bfloat16: 740M parameters at 2 bytes each.
Tokens per input. Memory does not keep growing as a chat would.
Batch size is what uses memory
Embedding many items at once is faster and uses more memory. If you run out, send smaller batches.
Do not use float16
Google warns the model's values exceed float16's range. Use bfloat16 or float32.
Vectors need room too
About 1.5 GB for every million full-length vectors, wherever you keep them. See pricing.
Phone figures from Google's on-device post; other facts from the model card and developer guide. Google publishes no graphics-memory figure for the full weights, so the 1.5 GB is arithmetic, not a measurement. Usage is in how to use.
How the conversation figures are calculated
| From each model's configuration | 31B | 26B A4B | 12B |
|---|---|---|---|
| Layers that see the whole conversation | 10 | 5 | 8 |
| Cached heads in those layers x width | 4 x 512 | 2 x 512 | 1 x 512 |
| Layers that see only the last 1,024 tokens | 50 | 25 | 40 |
| Cached heads in those layers x width | 16 x 256 | 8 x 256 | 8 x 256 |
| Cache per extra token of conversation | about 82 KB | about 20 KB | about 16 KB |
Configuration values read on October 8, 2026 from the 31B, 26B A4B and 12B files on Hugging Face. 1 GB here means one billion bytes.
How much VRAM does Gemma 4 need?
At 4-bit: 2.9 GB (E2B), 4.5 GB (E4B), 6.7 GB (12B), 14.4 GB (26B A4B) and 17.5 GB (31B) for the model, plus more for the conversation.
Can I run Gemma 4 31B on a 24 GB card?
Yes at 4-bit, with a moderate context: about 21 GB at 32K tokens by this site's estimate. Very long documents will not fit.
What can I run on 8 GB of VRAM?
E4B comfortably, or E2B with room to spare. The 12B's model alone takes 6.7 GB at 4-bit, which leaves too little.
What can I run on 12 or 16 GB?
The 12B is the natural choice. See the 12B page.
Why does a long conversation use more memory?
The model keeps a cache of everything it has read so far. The cache grows with every token.
Does 4-bit hurt quality?
Google says its QAT builds keep quality similar to full precision. It has not published side-by-side scores.
What if I do not have enough VRAM?
Choose a smaller size, shorten the context, or use a hosted version: see Gemma 4 online and the API page.
How much VRAM does EmbeddingGemma 2 need?
Very little: roughly 1.5 GB for the full weights by this site's estimate, and it runs without a graphics card.
Know what fits?
Download the size your card can hold.