ai.canshu.com
中文
VRAM Calculator Advisor & TCO API Pricing Compare Models Leaderboard GPUs

Search models, GPUs, and tools

↑↓ Navigate · Enter Open · ★ Watchlist prioritized ai.canshu.com
Google DeepMind
Open-Weight Google DeepMind · Dense 30.7B · Text+Image+Video · BF16

Gemma-4-31B-IT Architecture Parameters, Benchmarks & VRAM

Google's Apache-2.0 30.7B dense multimodal model with configurable thinking modes and 256K context.

🧬 Gemma-4-31B-IT Architecture & Tensor Specifications

Verified directly against HuggingFace (google/gemma-4-31B-it) config.json & Model Card

HF Class: Gemma4ForConditionalGeneration

1. Backbone & Dimensions

gemma4
Total / Active Params
30.7B (Dense)
Hidden Size (d_model)
5,376
FFN Intermediate Size
21,504
Activation / Norm
GELU-Tanh (GeGLU) · ε=1e-6
Native Tensor Dtype
BF16

2. Attention & Layer Layout

HYBRID
Num Hidden Layers
60 Layers (10 Global KV)
Hidden Layer Layout
60 Interleaved Layers: 50 Sliding (w=1024, 16KV) + 10 Global Full Attention (4KV, dim=512)
Attention Heads (Q / KV)
32 Q / 4 KV (8:1 GQA)
Head Dimension
512
Linear / KV Compression
5:1 Sliding-to-Global Attention ratio bounds KV growth on 256K long context
Vision Encoder / MTP
ViT 27L

3. Context, RoPE & Tokenizer

Tokenizer
Native Context Length
262,144 tokens
RoPE Configuration
Dual RoPE (Global Proportional θ=1,000,000 partial=0.25 · Sliding θ=10,000)
Vocab Size
262,144 (Tied)
Special Token IDs
BOS: 2 · EOS: [1,106,50] · PAD: 0
Language Support
140+ languages pre-trained (35+ out-of-the-box)

📋 Gemma-4-31B-IT Official API & System Card Specifications

Verified against official Google DeepMind developer documentation & pricing

API Model ID: google/gemma-4-31b-it

1. Identity & Capabilities

API Spec
API Model ID
google/gemma-4-31b-it
Release Date
2026-04-02
Weight License
Open-Weight (API Spec)
Native Reasoning
✅ Supported
Function Calling & JSON Schema
✅ 原生支持
Batch API 异步批处理
✅ Supported (50% off)

2. Context, Output & Modalities

Limits
Max Context Window
256,000 tokens (256K)
Max Output Tokens
16,000 tokens
Input Modalities
Text + Image + Video
Output Modalities
Text
Direct China Access
✅ Direct CN + RMB
Deployment Mode
Open-Weight + Cloud API

3. Official Pricing & Cache

USD / 1M
Input / 1M Tokens
$ 0.2
Cached Input / 1M
$ 0.2
Output / 1M Tokens
$ 0.4
Tiered Pricing Notes
OpenRouter: Unified multi-provider routing via OpenRouter

🏆 Official Benchmark Results

Sourced from official System Card / Model Card & technical reports

Arena Elo ~1450 AA Index 44
📚 Knowledge
MMLU-Pro 85.2 %

A more robust and challenging multi-task language understanding benchmark that extends MMLU by expanding multiple-choice options from 4 to 10, eliminating trivial questions, and focusing on reasoning-intensive tasks.

📚 Knowledge
MMMLU 88.4 %

Multilingual Massive Multitask Language Understanding dataset released by OpenAI, featuring professionally translated MMLU test questions across 14 languages including Arabic, Bengali, German, Spanish, French, Hindi, Indonesian, Italian, Japanese, Korean, Portuguese, Swahili…

🧠 Reasoning
AIME 2026 (no tools) 89.2 %
🧠 Reasoning
GPQA Diamond 84.3 %

PhD-level Google-proof science reasoning questions

💻 Coding
LiveCodeBench v6 80 %

LiveCodeBench is a holistic and contamination-free evaluation benchmark for large language models for code.

🤖 Agentic
TAU2-Bench 76.9 %

Dual-control conversational tool-use benchmark

👁️ Multimodal
MMMU-Pro 76.9 %

A more robust multi-discipline multimodal understanding benchmark that enhances MMMU through a three-step process: filtering text-only answerable questions, augmenting candidate options, and introducing vision-only input settings.

👁️ Multimodal
MATH-Vision 85.6 %

🎛️ Official Sampling & Reasoning Parameters

Recommended generation settings & API parameter constraints

Official Default Multimodal & Thinking
temperature=1 top_p=0.95 top_k=64 max_tokens=32,768

💡 Supports interleaved multimodal input, built-in thinking mode, and native function calling.

📊 Gemma-4-31B-IT Full Benchmark Scorecard

16 public benchmarks · ranks among 154 models · synced 2026-11-20

⚔️ Compare head-to-head

Source: ZeroEval / llm-stats.com (✓ = third-party verified, others vendor-reported).

⚡ Gemma-4-31B-IT Interactive VRAM & Token Speed Calculator

Concurrency (Batch):
Dense 30.7B·60L (d=5376)·32Q/4KV·Ctx 256K·Text+Image+Video
Runnable Models →
GPUs
32 GB VRAM·1792 GB/s·Safe Usable 31.4 GB
Smooth Fit22.47 / 31.4 GB~65.5 tok/s
3. Weight Quantization
4. Per-Request Context16K (16,384 tok)
Verified: 2026-11-20·Roofline bandwidth/compute estimate (Batch=1)
Smooth Fit
22.47/ 31.4 GB usable

Physical 32 GB · Load 71.6%

Theoretical Decode Speed
~65.5tokens/s

Actual speed varies ~±25% by runtime

Max Context at Batch=1
122K/ 256K

Enable Q8/Q4 KV quantization to scale batch concurrency

Weights: 18.61 GBKV Cache (1×16K): 2.18 GBOverhead: 1.67 GB
🚀 Blazing Fast (Instant CoT)~7.6s for a 500-token response
Reference Launch CLI:
OLLAMA_CONTEXT_LENGTH=16384 ollama run gemma4:31b

RTX 5090 Fits Gemma-4-31B-IT · Cost & TCO

Approx. $2,199 (~$69/GB VRAM) · 575W TDP

📊 Gemma-4-31B-IT Quantization VRAM Breakdown (16K Context)

Quantization Bits/Weight Weights KV Cache (16K) Total VRAM Quality Note
FP16 / BF16 16 bpw 61.4 GB 2.18 GB 66.11 GB Lossless Full Precision
FP8 / Q8_0 8.5 bpw 32.62 GB 2.18 GB 36.75 GB 99.9% Near-Lossless
GGUF Q6_K 6.56 bpw 25.17 GB 2.18 GB 29.16 GB Ultra High Quality
GGUF Q5_K_M 5.69 bpw 21.84 GB 2.18 GB 25.75 GB High Balanced Quality
Q4_K_M / AWQ 4.85 bpw 18.61 GB 2.18 GB 22.47 GB Sweet Spot (Recommended)
GGUF IQ4_XS 4.25 bpw 16.31 GB 2.18 GB 20.12 GB Compact 4-bit
GGUF Q3_K_M 3.91 bpw 15 GB 2.18 GB 18.79 GB Moderate Perplexity Loss
GGUF Q2_K 3.15 bpw 12.09 GB 2.18 GB 15.81 GB Extreme Compression

🖥️ GPU & Apple Silicon Compatibility for Gemma-4-31B-IT (Q4_K_M)

Frequently Asked Questions

What are the exact architecture parameters of Gemma-4-31B-IT?

Gemma-4-31B-IT uses Gemma4ForConditionalGeneration with 60 layers (60 Interleaved Layers: 50 Sliding (w=1024, 16KV) + 10 Global Full Attention (4KV, dim=512)), hidden_size=5376, 32 Q heads / 4 KV heads (head_dim=512), and vocab_size=262,144.

How much VRAM does Gemma-4-31B-IT require?

At 4-bit quantization (Q4_K_M, 16K context), Gemma-4-31B-IT requires 22.47 GB VRAM. Full FP16 requires 66.11 GB.