KernelFox
Home / Models / Google / Gemma 4 31B IT

Gemma 4 31B IT

By Google.
6.3 / 10
About the level of Claude Opus 4.1Epoch index 144.12, updated 24 Nov 2026
Released
2 Apr 2026
Type
Open weights
Apache 2.0
Context
262,144 tokens
Up to 16,384 output tokens
Price per million
$0.2 in
$0.4 out

Gemma 4 31B Instruct is Google DeepMind's 30.7B dense multimodal model supporting text and image input with text output.

Will it run on my PC?

1. What graphics card or Mac do you have?

2. How much text will you give it at once?

Memory needed = 4-bit model file (18.3 GB, measured on a real GGUF file) + context memory (estimated from the model’s published configuration) + about 1 GB for the runtime. Mac figures assume unified memory.

Verdict
Yes, it fits.
Needs 22.8 GB, you have 24 GB.
1.2 GB to spare on the 24 GB GPU.
18.3 GB model + 3.5 GB context + 1 GB runtime.
Recommended graphics card

Which graphics card to run Gemma 4 31B IT?

Context 8k, 32kup to 22.8 GB of memory
GeForce RTX 309024 GB · about 36 tokens/s (estimated)
$2,699.99
Context 128k, 256kup to 41.6 GB of memory
NVIDIA RTX A600048 GB · about 30 tokens/s (estimated)
$5,860.00

Cheapest card in our list whose memory holds the model at that context length, card alone with no help from your RAM. Speed is an upper-bound estimate from memory bandwidth. Compare all graphics cards for local AI. As an Amazon Associate, I earn from qualifying purchases.

How it compares

Models closest in score, open and proprietary together.

Gemini 3.1 Flash-LiteProprietary, API only
6.4
$0.56/M tokens (blended)
Gemini 2.5 Pro (Jun 2025)Proprietary, API only
6.4
$3.44/M tokens (blended)
Claude Opus 4.1Proprietary, API only
6.4
$30.0/M tokens (blended)
Gemma 4 31B IT (this page)Open weights
6.3
19.3 GB VRAM (Q4)
Qwen3.6-35B-A3BOpen weights
6.3
23.7 GB VRAM (Q4)
Qwen3.5-35B-A3BOpen weights
6.3
23.0 GB VRAM (Q4)

What it costs

Through an API, per million tokens.

$0.2 in / $0.4 out
about $826for a heavy coding-agent month (13,000 calls, 4 billion tokens, mostly cached context). Measured on one heavy Claude Code user (September 2026), priced at list.

Flat-rate subscriptions can cost far less than API list prices for heavy use. Treat this as a reference, not a bill.

Where to run it through an API

Same open model, several inference providers, very different prices. Cheapest first.

Provider
Input $/M
Output $/M
Precision
Context
Uptime
KT
0.1
0.34
not stated
262,144
100%
CoreWeave
0.1
0.34
fp4
262,144
100%
NextBit
0.125
0.34
fp4
262,144
100%
Venice
0.12
0.36
fp4
256,000
100%
Chutes
0.12
0.37
fp4
131,072
100%
DeepInfra
0.16
0.32
fp8
262,144
100%
Crusoe
0.14
0.4
bf16
259,871
100%
Friendli
0.14
0.4
not stated
262,144
100%

Prices from OpenRouter’s public provider list. “Precision” is how the weights are stored: a lower-precision copy (fp4, fp8) is cheaper and faster but can be slightly less accurate. Uptime over the last 30 minutes.

Call Gemma 4 31B IT through the API

OpenRouter exposes this model through an OpenAI-compatible API. Create a key on OpenRouter, then use the model identifier google/gemma-4-31b-it.

Python
OpenRouter API
import os
from openai import OpenAI

client = OpenAI(
    base_url="https://openrouter.ai/api/v1",
    api_key=os.environ["OPENROUTER_API_KEY"],
)

response = client.chat.completions.create(
    model="google/gemma-4-31b-it",
    messages=[{"role": "user", "content": "Explain 4-bit quantization in two sentences."}],
)
print(response.choices[0].message.content)
JavaScript
OpenRouter API
import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://openrouter.ai/api/v1",
  apiKey: process.env.OPENROUTER_API_KEY,
});

const response = await client.chat.completions.create({
  model: "google/gemma-4-31b-it",
  messages: [{ role: "user", content: "Explain 4-bit quantization in two sentences." }],
});
console.log(response.choices[0].message.content);
cURL
OpenRouter API
curl https://openrouter.ai/api/v1/chat/completions \
  -H "Authorization: Bearer $OPENROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "google/gemma-4-31b-it",
    "messages": [{"role": "user", "content": "Explain 4-bit quantization in two sentences."}]
  }'

Prices and providers are in the sections above. Check the exact identifier on the OpenRouter model page.

Specifications

Developer
Released
2 Apr 2026
Type
Open weights
License
Apache 2.0
Parameters
31.3 billion
Layers
60 (10 full attention, 50 sliding attention)
Context window
262,144 tokens, up to 16,384 output tokens
Reads
text, image and video
Writes
text
Full weights on disk
175.7 GB
Name on Hugging Face

Where to get it

Download on Hugging Face GGUF files for local use Paper (arXiv:2607.02770) Use it through OpenRouter License

To run it on your own machine, the two easiest tools are Ollama and LM Studio.

See the full memory table
Your hardwareShort chat (8k)Documents (32k)Long agent (128k)Maximum (256k)
8 GB GPUwith 32 GB more RAM (slower)with 32 GB more RAM (slower)with 32 GB more RAM (slower)with 64 GB more RAM (slower)
12 GB GPUwith 16 GB more RAM (slower)with 16 GB more RAM (slower)with 32 GB more RAM (slower)with 64 GB more RAM (slower)
16 GB GPUwith 16 GB more RAM (slower)with 16 GB more RAM (slower)with 32 GB more RAM (slower)with 32 GB more RAM (slower)
24 GB GPUFitsFitswith 16 GB more RAM (slower)with 32 GB more RAM (slower)
32 GB GPUFitsFitsFitswith 16 GB more RAM (slower)
64 GB MacFitsFitsFitsFits
PC without a graphics card, 16 GB RAMneeds 20.8 GBneeds 22.8 GBneeds 30.9 GBneeds 41.6 GB
PC without a graphics card, 32 GB RAMFits (slow)Fits (slow)needs 30.9 GBneeds 41.6 GB
PC without a graphics card, 64 GB RAMFits (slow)Fits (slow)Fits (slow)Fits (slow)
PC without a graphics card, 128 GB RAMFits (slow)Fits (slow)Fits (slow)Fits (slow)

Frozen facts (name, specifications, links) are fixed when the page is created. Scores, prices and download numbers: refreshed daily; last update 24 Nov 2026. Scores: Epoch AI (Capabilities & benchmarking, CC BY 4.0), adapted by KernelFox.