Gemma 4 / VRAM

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

Gemma 4 31B at 4-bit · memory as a conversation grows Model · 17.5 GB 24 GB card 044 GB The model: fixed The conversation cache: grows with length Short chat, 8K tokensabout 19 GB in total Full context, 256K tokensabout 40 GB in total
The model is a fixed cost. The conversation is the part that grows.
2.9 GBSmallest, E2B at 4-bit
6.7 GB12B at 4-bit
17.5 GB31B at 4-bit
69.9 GB31B at full precision
Interactive

VRAM calculator

Pick a model, how compressed it is, how long your conversations are and how many run at once.

Estimated VRAM
-
ModelConversation cacheSmallest card that fits

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.

Part one

Memory for the model

Google's published figures for loading each size.

ModelFull precision
BF16
8-bit
SFP8
4-bit
Q4_0
Mobile format
Gemma 4 E2B11.4 GB5.7 GB2.9 GB1.1 GB
Gemma 4 E4B17.9 GB8.9 GB4.5 GB2.5 GB
Gemma 4 12B26.7 GB13.4 GB6.7 GB-
Gemma 4 26B A4B57.7 GB28.8 GB14.4 GB-
Gemma 4 31B69.9 GB34.9 GB17.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.

Part two

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 length31B26B A4B12B
4K1.2 GB0.3 GB0.4 GB
8K1.5 GB0.4 GB0.5 GB
16K2.2 GB0.5 GB0.6 GB
32K3.5 GB0.9 GB0.9 GB
64K6.2 GB1.6 GB1.4 GB
128K11.6 GB2.9 GB2.5 GB
256K22.3 GB5.6 GB4.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.

Fitting it

Which graphics card for which model

At 4-bit, with a 32K-token conversation unless stated.

Card memoryBest fitNotesOut of reach
8 GBE4BE2B for more headroom12B
12 GB12BAbout 7.6 GB at 32K context26B A4B
16 GB12B, with long context26B A4B is a tight fit: about 15.3 GB at 32K31B
24 GB26B A4B31B fits at 32K (about 21 GB) but not at long context31B with a very long context
32 GB31BAbout 29 GB at 128K context31B at the full 256K
48 GB31B, any contextAbout 40 GB at 256K; or 8-bit builds of the 12B31B at full precision
80 GB31B at 8-bit, or 26B A4B at full precisionThe usual server card31B 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.

Fitting it

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 · released October 6, 2026
The search model

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 for the model itselfEmbeddingGemma 2, full weightsabout 1.5 GBGemma 4 E2B, 4-bit2.9 GBGemma 4 12B, 4-bit6.7 GBGemma 4 31B, 4-bit17.5 GB EmbeddingGemma 2 figure is an estimate: 740M parameters at 2 bytes each.
It fits on any graphics card, beside whichever Gemma 4 you run.
On a phone, full model
567 MB

Memory in use on a Pixel 11 Pro, with quantization, as reported by Google.

On a phone, text only
191 MB

Same device, text-only mode.

Full weights
~1.5 GB

This site's estimate at bfloat16: 740M parameters at 2 bytes each.

Input limit
8,192

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.

Method

How the conversation figures are calculated

From each model's configuration31B26B A4B12B
Layers that see the whole conversation1058
Cached heads in those layers x width4 x 5122 x 5121 x 512
Layers that see only the last 1,024 tokens502540
Cached heads in those layers x width16 x 2568 x 2568 x 256
Cache per extra token of conversationabout 82 KBabout 20 KBabout 16 KB
The sum. For each layer: heads x width x 2 (a key and a value) x 2 bytes, for every token it can see. Whole-conversation layers count every token; the others stop at 1,024. Gemma 4's design lets some stored data be shared, and apps differ in how they hold the cache, so treat these as an upper-end estimate rather than a measurement.

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.

FAQ

Common questions

More answers on the full FAQ page.

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.

Top