VRAMGlass contains affiliate links. As an eBay Partner, we may be compensated if you make a purchase. As an Amazon Associate I earn from qualifying purchases.We may earn from eBay and Amazon links.Learn more

GPUs tracked64Price history94 daysPrice points (24h)29,155 pointsBiggest 24h dropTesla V100 16GB-6.1%Biggest 24h riseInstinct MI100+12.8%Updated
$ USD

Run Gemma 4 31B Locally: VRAM & GPU Requirements

Gemma 4 31B, the largest and highest-scoring dense model in Gemma 4, runs locally on a 24GB GPU at 4-bit at about 36 tokens/s. Context on that card tops out at about 66K. Running the full 256K context takes 48GB of VRAM. At launch, Google said it ranked third among open models on the Arena AI text leaderboard, and it understands images but not audio.

Gemma 4 31B details

  • Min VRAM at 4-bit (8K context)21 GB
  • Parameters30.7B
  • Max context256K
Architecture
Dense
License
Apache-2.0
Launch date
Apr 2, 2026
Vendor
Google DeepMind
Hugging Face repo
google/gemma-4-31B-it
NVFP4 repo (Blackwell)
nvidia/Gemma-4-31B-IT-NVFP4
Ollama tag
gemma4:31b
Layers
60
Hidden size
5,376
KV heads
16
Head dim
256

How much VRAM does Gemma 4 31B need?

QuantizationWeightsGB8K contextGB32K contextGB128K contextGB256K context (max)GB
1-bit7.7est.10.312.320.431.1
2-bit11.8GGUF14.416.424.535.2
3-bit15.4GGUF182028.138.8
4-bit18.3GGUF20.922.93141.7
5-bit21.7GGUF24.326.334.445.1
8-bit32.6GGUF35.237.245.356
BF16/FP1661.4GGUF646674.184.8

Full calculation rules are on the Methodology page.

Can a single GPU run Gemma 4 31B?

A single 24GB GPU runs Gemma 4 31B at 4-bit, but context is the weak spot. Once the 4-bit weights are loaded on an RTX 3090, 4090 or RX 7900 XTX, little VRAM is left, so context tops out around 66K at a little under 40 tokens/s even though long documents are where it clearly beats its smaller siblings. For more room, a 32GB RTX 5090 stretches context to about 168K and runs much faster, while the full 256K takes a 48GB card or larger. 16GB cards are limited to 2-bit. The 128GB unified-memory machines can hold it, but a dense model reads every weight for each token, so 4-bit crawls along at around 10 tokens/s.

eBay
DevicePriceSpeed t/sMax context
Tesla V100 32GB32 GB$1,37813 listings34.5168K
Radeon RX 7900 XTX24 GB$1,40027 listings36.766K
GeForce RTX 309024 GB$1,992116 listings35.866K
GeForce RTX 409024 GB$3,82574 listings38.466K
Ryzen AI Max+ 395 128GBWhole system · 128 GB$4,02531 listings10.2256K
RTX A600048 GB$4,89925 listings29.6256K
Mac Studio M5 Ultra 96GBWhole system · 96 GB$6,7995 listings46.3256K
MacBook Pro M5 Max 128GBWhole system · 128 GB$7,00029 listings23.9256K
GeForce RTX 509032 GB$7,385128 listings65.5168K
DGX Spark 128GBWhole system · 128 GB$7,90037 listings10.8256K
RTX PRO 600096 GB$18,60020 listings65.5256K

Only common GPUs and systems are listed, from cheapest to most expensive.

What to know before running Gemma 4 31B locally

  1. Splitting VRAM on a 24GB card

    The 4-bit weights are 18.3 GB, and going from 8K to 128K of context adds about 10.1 GB more, so a 24GB card can't reach 128K. For longer context, drop to 3-bit (15.4 GB of weights) or shrink the context cache in llama.cpp with -ctk q8_0 -ctv q8_0. Don't go up to 5-bit; on a 24GB card it tops out at about 25K.

  2. Long documents are its strength

    On the 128K multi-needle retrieval test (MRCR v2) in Google's model card, 31B scores 66.4%, while 26B A4B and 12B both land around 44%. For long documents and large codebases, pick 31B.

  3. It's also the pick for agents

    On the same model card, 31B scores 76.9% on the Tau2 tool-calling test versus 68.2% for 26B A4B, a wider gap than on most tests. It also natively supports system prompts and function calling.

  4. Frameworks

    The Ollama tag is gemma4:31b. Google says vLLM, llama.cpp, MLX, SGLang and LM Studio all supported it on launch day; on a Mac, either MLX or llama.cpp works.

Launch commands

Ollama

  • Windows
  • macOS
  • Linux
Terminal
ollama run gemma4:31b

llama.cpp

  • NVIDIA
  • AMD
  • Mac
  • CPU
Terminal
llama-server -hf unsloth/gemma-4-31B-it-GGUF:Q4_K_M -c 8192

vLLM

  • Linux
  • NVIDIA
  • AMD
Original weights
Terminal
vllm serve google/gemma-4-31B-it
NVFP4 · Blackwell

Blackwell GPUs (RTX 50 series, RTX PRO 6000, B200) run NVFP4 weights natively, at about 30% of the original size.

Terminal
vllm serve nvidia/Gemma-4-31B-IT-NVFP4

MLX

  • Apple Silicon

Vision models run on mlx-vlm: on a Mac, pip install mlx-vlm first; this command downloads the MLX weights from Hugging Face and starts a server.

Terminal
mlx_vlm.server --model mlx-community/gemma-4-31b-it-4bit

File names follow that week's model-library snapshot; the definitions are in the methodology. Methodology

Other models in the Gemma family

ModelTotal paramsActive params4-bit size
Gemma 4 E4BDense8B8B5 GB
Gemma 4 12BDense12B12B7.1 GB
Gemma 4 26B A4BMoE25.2B3.8B16.9 GB

About Gemma