Skip to content
Local AI Wizard
Your machine
Theme

Gemma 4 31B

Google · google/gemma-4-31B-it

Q4 file 18.3 GB (Q4_K_M) · runs well from 32 GB · Weights license: Apache 2.0

LMArena · text1,452 ± 7Rank 76 · release 2026-10-22 · its own scale
Memory needed~24 GBQ4 weights + working room, before the machine's reserve
Parameters30.7 Bmanufacturer specification
Context262,144 tokensPublished for this model

Quality

LMArena · text · rating
1,452 ± 7Confidence interval 1,445–1,460 · 6,137 votes · rank 76 of the releaseLMArena 2026-10-22 · CC BY 4.0

No result in LiveBench 2026-06-25 Not in LiveBench 2026-06-25

Reported by the publisher

15 results · Google's model card · read 2026-10-25
MMLU Pro
85.2%
AIME 2026 no tools
89.2%
LiveCodeBench v6
80.0%
Codeforces ELO
2,150
GPQA Diamond
84.3%
Tau2 (average over 3)
76.9%
HLE no tools
19.5%
HLE with search
26.5%
Every reported result15
BigBench Extra Hard
74.4%
MMMLU
88.4%
MMMU Pro
76.9%Vision
OmniDocBench 1.5 (average edit distance, lower is better)
0.131Vision
MATH-Vision
85.6%Vision
MedXPertQA MM
61.3%Vision
MRCR v2 8 needle 128k (average)
66.4%Long Context
Across Gemma 4 sizes15 shared results · same publisher and settings
Gemma 4: results the publisher reports for each size under the same settings
Benchmark (publisher settings)E2BE4B12B26B A4B31B
MMLU Pro60.0%69.4%77.2%82.6%85.2%
AIME 2026 no tools37.5%42.5%77.5%88.3%89.2%
LiveCodeBench v644.0%52.0%72.0%77.1%80.0%
Codeforces ELO6339401,6591,7182,150
GPQA Diamond43.4%58.6%78.8%82.3%84.3%
Tau2 (average over 3)24.5%42.2%69.0%68.2%76.9%
HLE no toolsThis size's card does not report this result under these settingsThis size's card does not report this result under these settings5.2%8.7%19.5%
HLE with searchThis size's card does not report this result under these settingsThis size's card does not report this result under these settingsThis size's card does not report this result under these settings17.2%26.5%
BigBench Extra Hard21.9%33.1%53.0%64.8%74.4%
MMMLU67.4%76.6%83.4%86.3%88.4%
MMMU Pro · Vision44.2%52.6%69.1%73.8%76.9%
OmniDocBench 1.5 (average edit distance, lower is better) · Vision0.2900.1810.1640.1490.131
MATH-Vision · Vision52.4%59.5%79.7%82.4%85.6%
MedXPertQA MM · Vision23.5%28.7%48.7%58.1%61.3%
MRCR v2 8 needle 128k (average) · Long Context19.1%25.4%43.4%44.1%66.4%

Values as printed on the card, with the publisher's own settings (card section: Benchmark Results); column “Gemma 4 31B”. Not comparable across publishers and not used in any ranking. Model card

Run it

Run it

File Q4_K_M · 18.3 GB · unsloth/gemma-4-31B-it-GGUF · What is Q4?

Measured 39–71 tok/s · Q4_K_M · 3 machines · Local LLM Advisor · all rows

ollama run hf.co/unsloth/gemma-4-31B-it-GGUF:Q4_K_M
  1. Install Ollama
  2. Run the command above
  3. Ask: Explain what a context window is, in two sentences.

Runs on

Fast memory holds it 42

The planning estimate fits the memory the model can use quickly: graphics card VRAM, or unified memory within the macOS GPU share.

Show all 42

Within memory, outside the fast part 51

Within the machine's memory, outside its fast part: on a graphics card the layers that do not fit run on the CPU from PC RAM (the listed RAM, or 32 GB assumed); on a Mac, above the macOS default GPU share. Not a speed figure.

Show all 51

One memory tier short 9

The same machines with the next memory size up would hold it in fast memory.

Show all 9

Gemma 4 31B is a text model from Google with 30.7B parameters. It was released on March 31, 2026 and reads up to 262,144 tokens of context. Its Q4 weights plus working room come to about 24 GB before the machine's reserve; the smallest reference machines whose fast memory holds that are Mac mini M4 · 32 GB unified (~32 GB with its reserve) and RTX 5090 · 32 GB VRAM (~26 GB with its reserve). We collected 25 downloadable GGUF and MLX files from 2 publisher sources; the most downloaded GGUF source is unsloth's. It has no result in LiveBench 2026-06-25. Its LMArena text rating is 1,452 ± 7 (release 2026-10-22), a separate human-preference scale.

Hardware profiles grouped by the Q4 planning estimate on each machine (dedicated GPUs reserve 2 GB; unified and system memory 25%, 2 to 8 GB): the fast memory holds it, it is within memory but outside the fast part (layers offloaded to PC RAM, or above the macOS GPU share), or the machine is one memory tier short. Each card opens its hardware profile. Not a measured fit or speed.

On the reference machines

Gemma 4 31B on the reference machines
Where Q4 sits
Mac mini M2 · 8 GB unifiedLarger than its memoryNo file on the site's quant ladder fits the fast memory at 8,192 tokensNo file in the previous column~26 GBLarger than its memoryNo file on the site's quant ladder fits the fast memory at 8,192 tokensNo file in the previous column
Mac mini M4 · 16 GB unifiedLarger than its memoryNo file on the site's quant ladder fits the fast memory at 8,192 tokensNo file in the previous column~28 GBLarger than its memoryNo file on the site's quant ladder fits the fast memory at 8,192 tokensNo file in the previous column
Mac mini M4 · 24 GB unifiedLarger than its memoryNo file on the site's quant ladder fits the fast memory at 8,192 tokensNo file in the previous column~30 GBLarger than its memoryNo file on the site's quant ladder fits the fast memory at 8,192 tokensNo file in the previous column
Mac mini M4 · 32 GB unifiedFast memory holds itQ4_K_MGGUF · 18.3 GB · needs ~32 GB8,192 tokens~32 GBFast memory holds itQ4_K_MGGUF · 18.3 GB · needs ~32 GB8,192 tokens
Mac mini M5 Pro · 64 GB unifiedFast memory holds itQ8_0GGUF · 32.6 GB · needs ~49 GB65,536 tokens~32 GBFast memory holds itQ8_0GGUF · 32.6 GB · needs ~49 GB65,536 tokens
Mac Studio M5 Max · 128 GB unifiedFast memory holds itQ8_0GGUF · 32.6 GB · needs ~49 GB262,144 tokens~32 GBFast memory holds itQ8_0GGUF · 32.6 GB · needs ~49 GB262,144 tokens
Mac Studio · M5 Ultra · 36-core CPU / 80-core GPU · 512 GB unifiedFast memory holds itQ8_0GGUF · 32.6 GB · needs ~49 GB262,144 tokens~32 GBFast memory holds itQ8_0GGUF · 32.6 GB · needs ~49 GB262,144 tokens
RTX 4060 · 8 GB VRAMIn memory, outside the fast partNo file on the site's quant ladder fits the fast memory at 8,192 tokensNo file in the previous column~26 GBIn memory, outside the fast partNo file on the site's quant ladder fits the fast memory at 8,192 tokensNo file in the previous column
RTX 3060 · 12 GB VRAMIn memory, outside the fast partNo file on the site's quant ladder fits the fast memory at 8,192 tokensNo file in the previous column~26 GBIn memory, outside the fast partNo file on the site's quant ladder fits the fast memory at 8,192 tokensNo file in the previous column
RTX 5080 · 16 GB VRAMIn memory, outside the fast partNo file on the site's quant ladder fits the fast memory at 8,192 tokensNo file in the previous column~26 GBIn memory, outside the fast partNo file on the site's quant ladder fits the fast memory at 8,192 tokensNo file in the previous column
RTX 4090 · 24 GB VRAMIn memory, outside the fast partIQ4_XSGGUF · 16.4 GB · needs ~24 GB16,384 tokens~26 GBIn memory, outside the fast partIQ4_XSGGUF · 16.4 GB · needs ~24 GB16,384 tokens
RTX 5090 · 32 GB VRAMFast memory holds itQ5_K_MGGUF · 21.7 GB · needs ~30 GB32,768 tokens~26 GBFast memory holds itQ5_K_MGGUF · 21.7 GB · needs ~30 GB32,768 tokens
DGX H100 · 8 × 80 GBFast memory holds itQ8_0GGUF · 32.6 GB · needs ~57 GB262,144 tokens~40 GBFast memory holds itQ8_0GGUF · 32.6 GB · needs ~57 GB262,144 tokens

The file column uses the site's quant ladder (Q8_0 to Q3_K_M, MLX 8 to 4-bit on a Mac): the largest collected file whose size × 1.2 plus the context cache and the machine's reserve fits the fast memory. Planning estimates, not measured runs.

Plan another quantization or context

Consider it for

Compare Gemma 4 31B using its publisher card. No overall score appears in the LiveBench 2026-06-25 snapshot.

Check first

The Q4 weights plus working room come to about 24 GB from 30.7B stated parameters, before the machine's reserve (Runs on adds it per machine). It is not a measured minimum; context, batch size, runtime and quantization change actual memory use.

Versions to download

Files you can download for this checkpoint. The section opens on the most downloaded collected GGUF source, unsloth, at Q4_K_M. On a Mac it opens on the most downloaded MLX source. Sizes are the Hub's published bytes. What is Q4?

unsloth

unsloth/gemma-4-31B-it-GGUF · gemma-4-31B-it-Q4_K_M.gguf · 18.3 GB

Run this file

ollama run hf.co/unsloth/gemma-4-31B-it-GGUF:Q4_K_M
llama-server -hf unsloth/gemma-4-31B-it-GGUF:Q4_K_M
lms get https://huggingface.co/unsloth/gemma-4-31B-it-GGUF
  • mlx-lm: mlx-lm runs MLX repositories; pick the MLX version on a Mac

Quality scores on this page belong to the original checkpoint; these files are not scored or ranked. File sizes read 2026-10-23 · download counts read 2026-10-17 · commands: Hugging Face Hub docs: Use Ollama with any GGUF model · llama.cpp server README (-hf <user>/<model>[:quant]) · LM Studio docs: lms get with a Hugging Face URL · mlx-lm README (mlx_lm.generate --model)

Fine-tunes, adapters and other versions322 fine-tunes
Quantized versions
342
Fine-tunes
322
Adapters · merges
365 · 40

Browse them on the Hugging Face model tree · read 2026-10-23

Uncensored and abliterated versions72

Some community uploads remove the model's safety refusals. Quality may drop, the original publisher does not support them, claims about them are the uploader's, and the original license still applies. This site never recommends or ranks them.

72 derivative repositories have “uncensored” or “abliterated” in their name (read 2026-10-23).

Measured speed

Tokens per second by machine

Output tok/s · 3 machines · every row in the table · What is a token?

RTX 5090, 71.3 ± 0.23 · Q4_K_M71.3
RTX 4090 24 GB, 44.42 ± 0.04 · Q4_K_M44.4
RTX 3090 24 GB, 38.78 ± 0.01 · Q4_K_M38.8
Measured speed
RTX 5090NVIDIA GeForce RTX 5090 · 32 GB (the card's only memory size; rented host)71.3 ± 0.23Q4_K_M0 / 128 · Single llama-bench processllama.cpp CUDAllama.cpp commit 3e4dfa8f3 (b11658)Flash Attention enabledunsloth/gemma-4-31B-it-GGUF/gemma-4-31B-it-Q4_K_M.gguf
RTX 4090 24 GBNVIDIA GeForce RTX 4090 · 24 GB (the card's only memory size; rented host)44.42 ± 0.04Q4_K_M0 / 128 · Single llama-bench processllama.cpp CUDAllama.cpp commit 3e4dfa8f3 (b11658)Flash Attention enabledunsloth/gemma-4-31B-it-GGUF/gemma-4-31B-it-Q4_K_M.gguf
RTX 3090 24 GBNVIDIA GeForce RTX 3090 · 24 GB (the card's only memory size; rented host)38.78 ± 0.01Q4_K_M0 / 128 · Single llama-bench processllama.cpp CUDAllama.cpp commit 3e4dfa8f3 (b11658)Flash Attention enabledunsloth/gemma-4-31B-it-GGUF/gemma-4-31B-it-Q4_K_M.gguf

Source: Data: Local LLM Advisor (localllmadvisor.com) · CC BY 4.0 (checked 2026-10-25) · llama.cpp CUDA · llama.cpp commit 3e4dfa8f3 (b11658) · not estimated

How to run

The memory needed above is the Q4 load before a machine's reserve. Formula: parameters × 0.625 bytes, plus 20% working allowance; each machine then adds its system reserve: 25% of unified or system memory, 2 to 8 GB, or 2 GB per GPU on dedicated cards. This is neither measured VRAM nor checkpoint download size.

Q4 planning estimate only. Check checkpoint format, runtime support, KV cache, context, batch size and offload before choosing hardware.

Documented ways to run it

Copied as printed in the linked source (read 2026-10-18); not run by this site.

Setup stated first by the source · Transformers
pip install -U transformers torch accelerate
Transformers · model card · Getting Started
from transformers import AutoProcessor, AutoModelForMultimodalLM

MODEL_ID = "google/gemma-4-31B-it"

# Load model
processor = AutoProcessor.from_pretrained(MODEL_ID)
model = AutoModelForMultimodalLM.from_pretrained(
    MODEL_ID,
    dtype="auto",
    device_map="auto"
)
Transformers · model card · Getting Started
# Prompt
messages = [
    {"role": "system", "content": "You are a helpful assistant."},
    {"role": "user", "content": "Write a short joke about saving RAM."},
]

# Process input
inputs = processor.apply_chat_template(
    messages,
    tokenize=True,
    return_dict=True,
    return_tensors="pt",
    add_generation_prompt=True,
    enable_thinking=False
).to(model.device)
input_len = inputs["input_ids"].shape[-1]

# Generate output
outputs = model.generate(**inputs, max_new_tokens=1024)
response = processor.decode(outputs[0][input_len:], skip_special_tokens=False)

# Parse output
processor.parse_response(response, prefix=inputs["input_ids"])

Evidence level: Generic estimate only; no execution reproduced by this site.

Publisher sampling defaults
temperature 1 · top_p 0.95 · top_k 64generation_config.json · read 2026-10-23source
Chat template markers
tool calls · thinkingmarkers found in the template, not a test of the feature · read 2026-10-23source
Before downloading
  1. Check the exact checkpoint and license linked here.
  2. Confirm a compatible runtime and precision or quantization for your platform.
  3. Allow for context, batch size and any extra media components beyond the weights.

Technical details

What the source and the catalog store for this checkpoint. Missing fields are left out, never zero.

Checkpoint / version
google/gemma-4-31B-it
Task and modality
language and reasoning · text + image
Count and basis
30.7B · manufacturer specificationgoogle/gemma-4-31B-it model card (Hugging Face) · read 2026-10-17source
Context
262,144 tokens published for this modelgoogle/gemma-4-31B-it model card (Hugging Face) · read 2026-10-17source
Architecture
Densegoogle/gemma-4-31B-it model card (Hugging Face) · read 2026-10-17source
Released
Gemma releases (Google AI for Developers): March 31, 2026, Release of Gemma 4 in E2B, E4B, 31B and 26B A4B sizes · read 2026-10-10source
Runtime and precision
No local execution verified.
Languages
140+ languages Publisher's statement · read 2026-10-18source
Commercial use
Allowed Apache License 2.0 text (SPDX) · read 2026-10-18license text
Every stored field13 fields
Revision checked
842da3794eaa0b77d5f08bae87a17459d91ff475
Architecture
Gemma4ForConditionalGeneration
Library
transformers
Hub task tag
image-text-to-text
Declared base models
google/gemma-4-31B
Distributions in this group
mlx-community/gemma-4-31b-it-4bit
Formats
transformers, safetensors
Access
Open download
Publisher kind
Official
Repository created
2026-03-11creation is not the model's release
Repository updated
2026-07-20a commit is not a release date
Hub downloads (30 days) · likes
8,432,279 · 4,198this repository only · read 2026-10-25
Catalog state
Hub config or weights found; no inventory benchmark link

Sources

Identity and published specifications come from the checkpoint page. Benchmark scores belong to the named release and do not measure speed on your computer.

Catalog reviewed: 2026-10-17. Benchmark release: 2026-06-25; snapshot collected: 2026-10-18.