Google
ChatCodingReasoningMulti-purpose30.7B
Chat

Gemma 4 31B

Gemma · Apache 2.0

Google's flagship open-weight model. Dense 30.7B parameters with 256K context. Benchmarks: 89.2% AIME 2026, 85.2% MMLU Pro, 84.3% GPQA Diamond, 80.0% LiveCodeBench v6, 86.4% agentic tool use. Supports text, image, and video input. Fits on a single RTX 4090 at Q4 or dual 16 GB GPUs. Direct successor to Gemma 3 27B with substantially better reasoning. Apache 2.0 licensed.

Parameters
30.7B
Architecture
Dense
Context
256,000 tokens
Released
2026-04-02
Engines
llama.cpp, ollama, vLLM
Builder Tools
Claude Code, Codex CLI, Continue, Cursor, LM Studio, Ollama, Open WebUI, Windsurf

Parameters

30.7B

VRAM

28 GB

Context

250K

Formats

5

GPUs

33

Gemma 4 31B (30.7B) requires 28 GB VRAM at recommended quality (Q6_K). At efficient quality (Q4_K_M), it fits in 21 GB VRAM, making it compatible with the AMD Radeon RX 7900 XTX. On NVIDIA Grace Blackwell Ultra GB300, expect approximately 183 tok/s at Q8_0. For the best experience, High-End Home AI Server ($3,842) is recommended.

Source: OwnRig methodology

VRAM (Recommended)

28 GB

Quantization

Q6_K

File Size

26.73 GB

Max Context

250K tokens

Primary Use

Chat

Memory

VRAM Requirements

QualityQuantizationVRAMFile Size
fullQ8_034 GB32.64 GB
recommendedQ6_K28 GB26.73 GB
recommendedQ5_K_M24 GB22.61 GB
efficientQ4_K_M21 GB19.6 GB
compressedQ3_K_M16 GB14.59 GB
Scaling

Context Length Impact

KV cache VRAM at Q6_K quality. Longer context = more memory.

ContextKV CacheTotal VRAM
2K307 MB28.3 GBexceeds 24 GB
4K614 MB28.6 GBexceeds 24 GB
8K1.1 GB29.1 GBexceeds 24 GB
16K2.2 GB30.2 GBexceeds 24 GB
32K4.5 GB32.5 GBexceeds 24 GB
64K9 GB37 GBexceeds 24 GB
128K17.9 GB45.9 GBexceeds 24 GB

Compatible GPUs

33 devices
NVIDIA Grace Blackwell Ultra GB300Q8_0183 tok/sExcellent
NVIDIA GeForce RTX 3090Q4_K_M35 tok/sGood
NVIDIA GeForce RTX 4090Q4_K_M38 tok/sGood
NVIDIA GeForce RTX 5080Q3_K_M22 tok/sGood
NVIDIA GeForce RTX 5090Q6_K50 tok/sGood
NVIDIA RTX PRO 6000 BlackwellQ8_041 tok/sGood
NVIDIA RTX PRO 6000 Blackwell Max-QQ8_041 tok/sGood
AMD Radeon RX 7900 XTXQ4_K_M36 tok/sGood
Apple M4 Max (36GB Unified)Q6_K15 tok/sAcceptable
Apple M4 Ultra (192GB)Q8_018 tok/sAcceptable
AMD Radeon Pro W7900Q8_019 tok/sAcceptable
NVIDIA GeForce RTX 4070 Ti SuperQ3_K_M15 tok/sAcceptable
NVIDIA GeForce RTX 4080 SuperQ3_K_M16 tok/sAcceptable
NVIDIA RTX 4090 Laptop (150-175W)Q3_K_M11 tok/sAcceptable
AMD Radeon RX 9070Q3_K_M14 tok/sAcceptable
Apple M3 Pro (18GB Unified)Q3_K_M7 tok/sMarginal
Apple M4 Max (128GB Unified)Q8_012 tok/sMarginal
Apple M4 Max (64GB Unified)Q8_012 tok/sMarginal
Apple M4 Pro (24GB Unified)Q4_K_M10 tok/sMarginal
Apple M4 Pro (48GB)Q8_06 tok/sMarginal
NVIDIA GeForce RTX 4060 Ti 16GBQ3_K_M6 tok/sMarginal
AMD Radeon RX 9060 XT 16GBQ3_K_M7 tok/sMarginal
NVIDIA GeForce RTX 5060 Ti 16GBQ3_K_M7 tok/sMarginal
Apple M4 (16GB Unified)Q3_K_M1 tok/sNot viable
Apple M1 (8GB Unified)Q3_K_MNot viable
Apple M1 (16GB Unified)Q3_K_MNot viable
Apple M1 Pro (16GB Unified)Q3_K_MNot viable
Apple M2 (8GB Unified)Q3_K_MNot viable
Apple M2 (16GB Unified)Q3_K_MNot viable
Apple M2 Pro (16GB Unified)Q3_K_MNot viable
Apple M3 (8GB Unified)Q3_K_MNot viable
Apple M3 (16GB Unified)Q3_K_MNot viable
AMD Radeon RX 9060 XT 8GBQ3_K_MNot viable

Showing 33 of 33 entries

Builder Context

Gemma 4 31B is commonly used with Claude Code, Codex CLI, Continue, Cursor, LM Studio, Ollama, Open WebUI, Windsurf. For an AI coding workflow, pair it with an embedding model like nomic-embed-text for local RAG.

FAQ

Frequently Asked Questions

How much VRAM does Gemma 4 31B need?
Gemma 4 31B requires 28 GB VRAM at recommended quality (Q6_K). At lower quality settings, it can fit in as little as 16 GB.
What is the best GPU for Gemma 4 31B?
The NVIDIA Grace Blackwell Ultra GB300 delivers the best performance for Gemma 4 31B, achieving 183 tok/s at Q8_0 with an excellent rating.
Can I run Gemma 4 31B on an RTX 4060 Ti?
Gemma 4 31B at Q3_K_M requires 28 GB VRAM, which exceeds the RTX 4060 Ti's 16 GB. Consider a lower quantization or a GPU with more VRAM.
What quantization should I use for Gemma 4 31B?
For the best quality, use Q6_K (28 GB VRAM). If your GPU has limited VRAM, Q3_K_M (16 GB) is the most efficient option with acceptable quality.
Is Gemma 4 31B good for coding?
Yes. Gemma 4 31B is used with Claude Code, Codex CLI, Continue, Cursor, LM Studio, Ollama, Open WebUI, Windsurf for local AI coding. For the best coding experience, pair it with an embedding model for local RAG.

Related Guides

All models

Data confidence: estimated. Source

VRAM requirements are calculated from model parameters and may vary by inference engine, context length, and batch size. Performance estimates are based on community benchmarks and should be verified for your specific configuration.Gemma is a trademark of its respective owner. OwnRig is not affiliated with or endorsed by the model creator.