VRAMGlass contains affiliate links. As an eBay Partner, we may be compensated if you make a purchase.As an eBay Partner, we may be compensated.Learn more

GPUs tracked57Price history49 daysPrice points (24h)43,400 pointsBiggest 24h dropGeForce RTX 3060 12GB-11.1%Biggest 24h riseCMP 170HX 40GB+19.8%Updated
$ USD

How to Deploy Gemma 4 31B Locally

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

Gemma 4 31B details

  • Min VRAM at 4-bit21 GB · 8K
  • 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 for local deployment?

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 card runs it 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 memory is left, so context tops out around 66K at a little under 40 tokens/s, and long documents are exactly where it clearly beats its smaller siblings. For more room, a 32GB RTX 5090 stretches context to about 168K and runs much faster; 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$89518 listings34.5168K
Radeon RX 7900 XTX24 GB$1,25029 listings36.766K
GeForce RTX 309024 GB$1,799107 listings35.866K
GeForce RTX 409024 GB$3,75868 listings38.466K
Ryzen AI Max+ 395 128GBWhole system · 128 GB$4,46420 listings10.2256K
RTX A600048 GB$4,89916 listings29.6256K
Mac Studio M5 Ultra 96GBWhole system · 96 GB$7,27412 listings46.3256K
MacBook Pro M5 Max 128GBWhole system · 128 GB$7,54920 listings23.9256K
DGX Spark 128GBWhole system · 128 GB$8,24022 listings10.8256K
GeForce RTX 509032 GB$8,395123 listings65.5168K
RTX PRO 600096 GB$22,50011 listings65.5256K

Only common GPUs and systems are listed, one set for models under 50B and another for larger ones, sorted by price from low to high.

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