gemma-4-31b-it: the instruction-tuned Gemma 4 31B as a metered multimodal API
gemma-4-31b-it is this platform's serving alias for Gemma 4 31B IT, the instruction-tuned release of the 31-billion-parameter dense model that Google DeepMind published on April 2, 2026 under an Apache 2.0 license. The name carries a suffix because the family ships each size in two forms, base and -it, plus QAT and MTP artifact lines on top, and buyers keep landing on the wrong one. The first job of this page is to fix that map with dated official sources. The second is a spec set in which every number names its owner, because host listings contradict the publisher's own configuration on at least one limit. The third is the request shape this route accepts today. The console's invite flow is the way in while the platform is in beta, and this page is how you arrive with everything already in place.
Last verified: 2026-09-11
What it is
Gemma 4 31B IT is a dense transformer: 30.7 billion parameters, every one of them active on every token. It reads text and images, freely mixed in one prompt, at whatever aspect ratio and resolution you send, and it writes text. Per the official model card, it is the instruction-tuned variant of the family's top dense size, tuned for reasoning, agentic workflows, coding, and multimodal understanding, with native function calling, a native system role, and a built-in thinking mode. The launch announcement put the 31B at number three among open models on the Arena AI text leaderboard on release day, built, in Google's words, from the same research and technology as Gemini 3.
The size line, because "Gemma 4" alone will not tell you which machine you are calling:
| Size | What it is | Context | Reads |
|---|---|---|---|
| E2B | 2.3B effective, dense with per-layer embeddings, built for phones | 128K | text, image, audio |
| E4B | 4.5B effective, same edge design, laptop class | 128K | text, image, audio |
| 12B Unified | 11.95B dense, no separate encoders, added June 2026 | 256K | text, image, audio |
| 26B A4B | 25.2B sparse mixture-of-experts, 3.8B active per token | 256K | text, image |
| 31B | 30.7B dense, the family's top quality tier | 256K | text, image |
Four sizes launched on April 2, 2026; the 12B joined later, which is why some pages still say four. Audio input exists only on the three smaller models, a scoping fact that surprises buyers of this one.
The artifact line runs on top of the sizes. Each model ships pre-trained (the base, for further training) and instruction-tuned (the -it, for serving). In May 2026 Google added MTP drafters: small companion models that draft several tokens at a time for the main weights to check in one pass, cutting decode time by up to about three times with no quality change claimed. In June 2026 came QAT checkpoints, weights trained with quantization built in so that 4-bit copies keep far more quality than after-the-fact compression. A host that says only "Gemma 4 31B" is pinning some point on this line, and the checkpoint name is what tells you which.
The specs that matter for planning, each with its owner:
| Fact | Value | Owner of the number |
|---|---|---|
| Total parameters | 30.7B, dense | official model card |
| Context window | 262,144 tokens | the publisher's model configuration file |
| Output limit | none set by the publisher | the publisher's generation config (no cap present) |
| Layers / sliding window | 60 layers, 1024-token local windows, 5 local to 1 global interleaved | model configuration file |
| Vocabulary | 262,144 tokens | model configuration file |
| Vision | ~550M-parameter encoder, 280 tokens per image by default, budgets of 70 to 1120 | official model card doc |
| Video | frame sequences, up to 60 seconds at one frame per second | official model card doc |
| Audio | not on this model (E2B, E4B, 12B only, 30-second cap) | official model card |
| Knowledge cutoff | January 2025 | official model card |
| Sampling defaults | temperature 1.0, top_p 0.95, top_k 64 | the publisher's generation config |
| License | Apache 2.0 | official model card |
| Release | April 2, 2026 | launch announcement |
Two rows in that table earn plain words. Context: 262,144 is the publisher's own number and the one to trust. Output: because the publisher sets no cap, host pages invent one, and for this exact model two variants of the same marketplace page have shown 32,768 and 16,384. Ask any host what its endpoint actually enforces; on this platform the caller sets the ceiling with max_tokens.
Thinking on this model is a real feature, and an unusual one. The family is described by the publisher as reasoners with configurable thinking modes, and the 31B's benchmark rows were earned with it. But the control is strictly on or off, not a ladder of depths. The publisher documents it three ways: enable_thinking true or false in transformers, a control token at the start of the system prompt in raw template terms, and, on Google's hosted API, a documented mapping where the thinking level "high" means enabled and "minimal" means disabled (Gemini API docs). One structural quirk from the official model card doc: in multi-turn chat, past thinking must be stripped from the history, except in tool-call turns where it is preserved. Serving stacks handle this; raw-API callers do it themselves.
The hosted-access story has a fact in it that most pages skip. Google's own API carries this model on a free tier: input and output free of charge, with the paid tier listed as not available, per the official pricing page. The same page's terms note that free-tier content is used to improve Google's products, and the page publishes no request-count limit. Community threads filled that gap in April 2026 with a roughly 1500-requests-per-day discovery, and later threads describe tighter token-per-minute caps arriving by mid-2026. A metered lane is a different product on every one of those axes: per-call cost in the response, the platform's own content terms, a wallet balance as the spending limit, and per-key revocation.
This platform serves the model as gemma-4-31b-it on the chat route beside the rest of the chat catalog; the models index shows the catalog exactly as it stands. The row is live, listing and metering together.
Use cases
The card's own numbers, and the record since release, point at the same jobs:
- Reasoning-heavy work. This is the 31B's headline: 89.2 percent on AIME 2026 without tools and 84.3 percent on GPQA Diamond in the publisher's table, with the thinking mode doing the heavy lifting. Math proofs, formal logic, multi-step planning.
- Coding. 80.0 percent on LiveCodeBench v6 and a 2150 Codeforces Elo, both publisher-reported. The launch materials pitch the family as local-first code assistants, and the 31B is the quality end of that pitch.
- Document and image work. The card lists document and PDF parsing, multilingual OCR, chart comprehension, screen and UI understanding, handwriting, and object detection among its image capabilities, and posts 76.9 percent on MMMU Pro. Images enter the prompt alongside text in any order, at a token budget you control.
- Agentic and multilingual product work. Native function calling, a native system role, and training across more than 140 languages, with the card noting 35 or more supported out of the box. The publisher's agentic framing is the family's stated design goal.
- Long-context reading. A 262,144-token window with 66.4 percent on MRCR v2 at 128K in the publisher's long-context row. Whole repositories, transcripts, and document sets fit in one request.
- What it is not. It has no audio input, it is not the fast sparse sibling (that is the 26B A4B), and it is not a base model for further pretraining (that is google/gemma-4-31B).
Local weights or a hosted lane: the honest split
Apache 2.0 makes self-hosting a genuine option here, and the memory math is knowable in advance. At full 16-bit precision the weights alone are about 61 GB, and the key-value cache at maximum context adds roughly another 21 GB in technical analyses that derive it from the official configuration, which puts the full-context unquantized experience in a 96 GB-class machine. The realistic local path is quantized: community and vendor guides put a 4-bit 31B at 17 to 20 GB of memory, and Unsloth's hardware table puts an 8-bit 31B at 34 to 38 GB. The official QAT checkpoints exist precisely to make 4-bit lose as little as possible. Add the MTP drafter for speed and an Ollama one-liner (ollama run gemma4:31b) for the easy path.
Run it locally when traffic is steady, the data must stay inside a boundary you control, or you want to fine-tune. Call a hosted lane when traffic is bursty or occasional, you want the full window without memory planning, or you want metering wrapped around the model: each reply carrying its cost, a prepaid wallet as the backstop, and per-key revocation. The lane here is open, and the steps below get you calling it.
API usage
The call is POST /v1/chat/completions, authorized by a Bearer key from the console, OpenAI-compatible in shape. The model id is gemma-4-31b-it. The route is live; the section below is the request shape it accepts today.
| Field | Notes |
|---|---|
model | gemma-4-31b-it |
messages | standard OpenAI message shapes; content parts may mix text and image_url entries, which the route forwards as sent |
reasoning_effort | accepted here today: minimal, low, medium, high |
stream | both streaming and non-streaming shapes work on the route |
max_tokens / max_completion_tokens | both accepted, identical behavior |
tools, tool_choice | standard OpenAI tool shapes, forwarded as sent |
response_format | accepted, for structured output work |
Three laws of this lane that save debugging time:
- The thinking knob is
reasoning_effort, top-level, and the model's control is a toggle. The publisher documents thinking as strictly on or off, with the hosted mapping high for on and minimal for off. The platform contract acceptsminimal,low,medium, andhighat this parameter:minimalandhighcarry the two documented states, andlowandmediumare accepted per the contract without a documented state on a strictly two-state model. The accepted set can also grow; the list above is the current surface, not a permanent freeze. Do not send the model's raw template fields yourself: nested template keys are outside the accepted surface and are answered with a named parameter error. - Thinking output arrives separated, and history needs care. When thinking is on, the model's reasoning comes back as thought text distinct from the answer. It is metered like any other output. If you replay conversation history, strip past thinking from it, except in tool-call turns where the publisher's format preserves it.
- Every response reports its cost. The
usageobject that rides back with the reply contains the retail charge for that call, computed from the token counts, and the prepaid wallet is debited in the same transaction that records the request. The remaining balance is what stops spend. Per-key caps are roadmap items; pulling one key is immediate. Rates come from the catalog and render on the pricing page.
curl
curl -X POST "https://api.ironstratum.com/v1/chat/completions" \
-H "Authorization: Bearer $KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gemma-4-31b-it",
"messages": [
{"role": "user", "content": "A tank fills at 12 liters per minute for 8 minutes, then drains at 5 liters per minute for 4. How much water is left? Show the steps."}
],
"reasoning_effort": "high",
"max_tokens": 2048
}'
python
import os
import requests
resp = requests.post(
"https://api.ironstratum.com/v1/chat/completions",
headers={"Authorization": "Bearer " + os.environ["KEY"]},
json={
"model": "gemma-4-31b-it",
"messages": [
# minimal = thinking off: the fast path for simple chat
{"role": "user", "content": "Summarize this release note in three bullets: context 256K, image input, thinking toggle."},
],
"reasoning_effort": "minimal",
"max_tokens": 512,
},
timeout=300,
)
resp.raise_for_status()
message = resp.json()["choices"][0]["message"]
print(message["content"])
openai-sdk
import os
from openai import OpenAI
client = OpenAI(
base_url="https://api.ironstratum.com/v1",
api_key=os.environ["KEY"],
)
response = client.chat.completions.create(
model="gemma-4-31b-it",
messages=[
{
"role": "user",
"content": [
{"type": "text", "text": "Read the table in this image and return it as JSON."},
{"type": "image_url", "image_url": {"url": "https://example.com/quarterly-table.png"}},
],
}
],
tools=[
{
"type": "function",
"function": {
"name": "save_extracted_table",
"description": "Persist an extracted table as JSON",
"parameters": {
"type": "object",
"properties": {"table": {"type": "string"}},
"required": ["table"],
},
},
}
],
tool_choice="auto",
reasoning_effort="high",
max_tokens=4096,
)
message = response.choices[0].message
if message.tool_calls:
call = message.tool_calls[0]
print(call.function.name, call.function.arguments)
else:
print(message.content)
An existing OpenAI-SDK integration switches over via two lines: the base URL and the model id. Integrations written against Google's own API use a different SDK shape (google-genai with a contents field), so those need the message mapping, not just a base-URL swap.
Benchmarks
Three layers of evidence, each carrying a label and a date. The platform hosts no lane for this model yet, so our own measurements appear nowhere in this section.
The publisher's card. Self-reported, from the official model card, released April 2, 2026, for instruction-tuned models. Its methodology notes: Tau2 is an average over three runs; HLE is reported with and without search; OmniDocBench 1.5 is an average edit distance where lower is better; MRCR is an average. The card also scores the 12B and E2B siblings; the columns here are the ones a buyer compares.
| Benchmark | Gemma 4 31B | Gemma 4 26B A4B | Gemma 4 E4B | Gemma 3 27B (no think) |
|---|---|---|---|---|
| MMLU Pro | 85.2% | 82.6% | 69.4% | 67.6% |
| AIME 2026 no tools | 89.2% | 88.3% | 42.5% | 20.8% |
| LiveCodeBench v6 | 80.0% | 77.1% | 52.0% | 29.1% |
| Codeforces Elo | 2150 | 1718 | 940 | 110 |
| GPQA Diamond | 84.3% | 82.3% | 58.6% | 42.4% |
| HLE no tools | 19.5% | 8.7% | - | - |
| BigBench Extra Hard | 74.4% | 64.8% | 33.1% | 19.3% |
| MMMU Pro (vision) | 76.9% | 73.8% | 52.6% | 49.7% |
| OmniDocBench 1.5 (edit distance) | 0.131 | 0.149 | 0.181 | 0.365 |
| MRCR v2 8-needle 128K | 66.4% | 44.1% | 25.4% | 13.5% |
The label belongs on any reading of it: publisher-reported, reference configuration, comparators chosen by the publisher. The shape that holds up across sources: the family's biggest jump over Gemma 3 is in reasoning and coding, the 31B leads every sibling row, and the 26B A4B sits close behind on most rows at a fraction of the active compute.
The arena and the Elo record. The launch announcement has the 31B at number three among open models on the Arena AI text leaderboard as of April 1, 2026, with the 26B at six, against models twenty times their size. The DeepMind model page plots the thinking variant at Elo 1451 against named comparators: glm-5 at 1456, kimi-k2.5-thinking at 1455, a 397B sparse Qwen at 1450, and gpt-oss-120b at 1354. That is the honest company this model keeps: near the top of the open-weights class on preference-style arenas, below frontier flagships.
Independent and community calibration. One independent index scores the 31B's reasoning variant slightly below the 26B A4B's on its aggregate intelligence scale, while noting the 26B's estimate carries its own uncertainty (dated this run; treat as one lens). A widely read hands-on review found the 26B within about 2 percent of the 31B across its own task mix. The pattern to internalize: the 31B is the quality pick inside the family, the gap to its MoE sibling is small on many tasks, and no open model at this size separates itself on every axis. If a workload matters, run it on your own tasks, on this platform or any other.
Getting started
- Create your console account. Access during beta runs through the invite flow: an open account can call every served model the day it appears.
- Generate an API key. A key per project is the intended pattern; keys are independent shutdown switches, so one revoked key never takes the others down.
- Check the rate. The pricing page carries each token leg's rate and the
usagefield on every response shows the charge; that page is the published commitment, rendered from the catalog and never typed by hand. - Make the first call. Copy the curl tab, set
KEY, and open with something small and thinking off (minimal) for a fast first reply. After that, larger work is a longermessagesarray and nothing more.
The chat category page holds the rest of the chat catalog, and the models index maps the platform's served lanes.