Google Gemma 4 dense model

Gemma 4 31B IT

Google DeepMind’s 30.7-billion-parameter dense Gemma 4 instruction model for multimodal reasoning, coding, long-context analysis, function calling, and self-hosted or Gemini API inference.

Context window
262.1K
262,144 tokens
Max API output
32,768
tokens
Parameters
30.7B
dense
Gemini API
Free
free tier
Architecture
Dense
60 layers

01 / Overview

What Gemma 4 31B IT Is

Gemma 4 31B IT is the largest dense instruction-tuned model in Google DeepMind’s Gemma 4 family, combining 30.7 billion parameters with multimodal input, configurable thinking, native function calling, and a 256K context window.

A Dense Flagship Inside an Open Model Family

Google released Gemma 4 as a family of open-weight models spanning several architecture and deployment targets.

Within that family, Gemma 4 31B IT occupies a specific role:

  • it is the largest dense Gemma 4 instruction model;
  • it uses 30.7B parameters;
  • it contains 60 transformer layers;
  • it supports text and image input;
  • it generates text output;
  • it supports thinking mode;
  • it supports native function calling;
  • it supports system prompts;
  • it provides a 256K native context window;
  • it can be downloaded and self-hosted;
  • it can also be called through the Gemini API.

The IT suffix means instruction tuned.

That distinguishes the model from a base pre-trained checkpoint intended primarily for further adaptation.

Gemma 4 31B IT is therefore best understood as a large dense open reasoning model rather than merely another hosted chat endpoint.

Its strongest SEO distinction inside the Gemma 4 family is architecture.

The 31B model processes every token through the dense network.

The 26B A4B variant instead uses a Mixture-of-Experts architecture that activates only a subset of its parameters for each token.

That makes 31B the higher-compute dense option and 26B A4B the more inference-efficient sibling.

Model profile
Provider
Google DeepMind
Family
Gemma 4
Model ID
gemma-4-31b-it
Architecture
Dense
Parameters
30.7B
Layers
60
Input
Text, Image
Output
Text

02 / Dense architecture

Gemma 4 31B Uses a 30.7B-Parameter Dense Architecture

Every token in Gemma 4 31B passes through the full dense network, giving the model a different inference profile from Gemma 4 26B A4B’s sparse Mixture-of-Experts design.

Dense and MoE Models Optimize Different Things

Google’s Gemma 4 family intentionally includes both approaches.

Gemma 4 31B

  • 30.7B total parameters;
  • dense transformer;
  • 60 layers;
  • full model participates in inference;
  • targeted at servers and server clusters.

Gemma 4 26B A4B

  • 25.2B total parameters;
  • about 3.8B active parameters;
  • 30 layers;
  • Mixture-of-Experts architecture;
  • only a small subset is active per token;
  • designed for much more efficient inference.

Dense inference is computationally heavier, but the 31B model also delivered the strongest published benchmark profile in the Gemma 4 family across many reasoning, coding, vision, and long-context evaluations.

That makes the 31B model useful when quality matters more than minimizing inference compute.

For self-hosting, architecture affects:

  • accelerator memory;
  • throughput;
  • latency;
  • quantization strategy;
  • batch size;
  • KV-cache capacity;
  • operating cost.

Model parameter count alone is therefore not enough.

A 26B MoE model can be substantially cheaper to run than a 31B dense model because only a fraction of its parameters are active for each token.

31B dense design
  1. 01

    30.7B dense parameters

    Every token is processed through the dense model rather than being routed through a small subset of experts.

  2. 02

    60 transformer layers

    The 31B model uses a deeper dense network than the 26B A4B MoE sibling.

  3. 03

    Higher inference demand

    Dense execution increases compute and memory pressure compared with activating only a few billion parameters per token.

  4. 04

    Higher capability ceiling

    Google’s published Gemma 4 benchmarks generally place the 31B model above the 26B A4B variant.

03 / Thinking

Gemma 4 31B IT Supports Thinking Mode

Gemma 4 introduced an explicit thinking mode that lets the model generate internal reasoning before producing its final response.

Reasoning Can Be Enabled at the Conversation Level

Google documents a dedicated <|think|> control token for Gemma 4.

When thinking is enabled, the prompt template instructs the model to perform a reasoning phase before producing the answer.

For the 31B instruction model, thinking can improve performance on tasks such as:

  • mathematics;
  • complex coding;
  • multi-step reasoning;
  • tool selection;
  • scientific questions;
  • structured decision making.

Thinking also changes inference economics.

More reasoning can mean more generated tokens, higher latency, more memory pressure, and a different answer style.

That makes thinking mode an evaluation variable rather than a setting that should automatically be enabled everywhere.

For simple extraction or classification, extra reasoning may add cost without enough quality gain.

For difficult coding or mathematical work, it can materially improve the result.

Google’s prompt-format documentation also gives an important multi-turn constraint.

Generated thoughts should normally be stripped before ordinary subsequent conversation turns.

Function-calling sequences are an exception because intermediate reasoning may need to remain available until the tool cycle is complete.

Configurable reasoning mode
  1. 01

    Enable thinking

    Use the Gemma 4 thinking control when the task benefits from explicit multi-step reasoning.

  2. 02

    Generate the answer

    The model reasons before producing the user-visible response.

  3. 03

    Strip old thoughts

    For standard multi-turn chat, remove generated thoughts before replaying earlier turns back into the model.

  4. 04

    Measure the gain

    Compare quality, latency, and generated-token usage with thinking enabled and disabled.

04 / Multimodal

Text and Image Understanding in One Open Model

Gemma 4 31B IT accepts interleaved text and image input and can reason about documents, screenshots, charts, handwriting, and other visual content.

Vision Is Native to the Gemma 4 Family

Google lists several vision-oriented capabilities:

  • object detection;
  • document and PDF understanding;
  • screen and UI interpretation;
  • chart comprehension;
  • OCR;
  • multilingual OCR;
  • handwriting recognition;
  • pointing and spatial understanding.

Text and images can be mixed in the same prompt.

That makes the model useful for workflows such as screenshot debugging, document Q&A, chart explanation, UI analysis, OCR plus reasoning, image-grounded coding, and multimodal support assistants.

The 31B model does not provide the same native audio path as the smaller E2B, E4B, and 12B Gemma 4 variants.

This is an important family distinction.

The large 31B and 26B A4B models focus on text and image input.

Text and vision capabilities
  • Text

    Instruction following, generation, reasoning, coding, and multilingual text tasks.

    Supported
  • Image input

    Analyze screenshots, documents, charts, handwriting, interfaces, and general visual content.

    Supported
  • Interleaved input

    Mix text and images within the same prompt.

    Supported
  • Video

    Video can be analyzed as sequences of frames in Gemma 4 workflows.

    Supported
  • Native audio

    Native audio support belongs to E2B, E4B, and 12B Gemma 4 variants, not the 31B model.

    Not listed
  • Text output

    The model generates text responses.

    Supported

05 / Context

A 256K Native Context Window

Gemma 4 31B supports up to 256K tokens of context, allowing long documents, code, conversation history, image-derived tokens, instructions, and tool state to coexist in a single request.

The Model Configuration Uses 262,144 Positions

The open model configuration defines:

  • max_position_embeddings: 262,144;
  • sliding-window attention: 1,024 tokens;
  • 60 text layers;
  • a mix of local sliding attention and global attention layers.

Google’s documentation describes this as a 256K context window.

The hybrid attention design is important.

Not every layer performs unrestricted global attention.

Instead, Gemma 4 combines local sliding-window attention for efficiency, periodic full global attention for broader context awareness, and proportional RoPE on global attention.

This lets the architecture reduce memory and compute pressure while retaining access to long-range information.

Long context is useful for long documents, codebases, research material, extended conversations, multiple retrieved passages, and agentic tool history.

But larger prompts still increase inference cost and KV-cache requirements when self-hosting.

A good evaluation should compare not only maximum context, but also answer quality as context grows.

Long-context capacity

Context window

262,144

Gemini API max output

32,768

Prompt + multimodal contextOutput limit

Google describes the model family as supporting 256K context; the underlying 31B text configuration uses 262,144 maximum positions.

06 / Function calling

Gemma 4 Added Native Function Calling

Gemma 4 31B IT can produce structured function calls, allowing an application to connect model reasoning to external tools and APIs.

The Model Chooses the Tool; Your Application Executes It

Function calling follows a model-tool-model loop.

The application defines available tools and their schemas.

The model can inspect the user request, reason about whether a tool is needed, generate a structured function call, receive the tool result, and then produce the final answer.

Google is explicit that Gemma does not execute the function itself.

The application remains responsible for validating function names and arguments, enforcing permissions, executing the external operation, and returning the result safely.

Thinking mode can improve function-selection accuracy.

That makes 31B useful for agentic workflows where the model must combine reasoning, tool selection, structured arguments, external evidence, and final natural-language generation.

Native agentic tool use
  1. 01

    Define tools

    Provide function names, descriptions, parameters, and validation constraints.

  2. 02

    Model decides

    Gemma reasons about whether a function should be called and generates the structured request.

  3. 03

    Application executes

    Your code validates and runs the tool rather than allowing the model to execute arbitrary operations directly.

  4. 04

    Return the result

    Feed the tool output back to Gemma so it can produce the final response.

07 / Coding

Gemma 4 31B IT Is a Strong Open Coding Model

Coding is one of the areas where Google reported substantial progress for Gemma 4, especially when thinking mode is enabled.

The official model card reports strong instruction-tuned results on programming evaluations.

Gemma 4 31B reached:

  • 80.0% on LiveCodeBench v6;
  • 2150 Codeforces ELO.

Those results materially exceed the earlier Gemma 3 27B baseline listed in the same model card.

Coding use cases include code generation, code completion, debugging, code correction, algorithmic reasoning, repository Q&A, function calling, and tool-using coding agents.

The open-weight design makes the model particularly interesting for teams that want coding capability without sending source code to a third-party hosted inference provider.

That does not automatically mean self-hosting is cheaper.

A 30.7B dense model requires substantial hardware, especially when serving long contexts.

The decision depends on utilization, accelerator cost, latency goals, privacy requirements, concurrency, quantization, and operational expertise.

Coding and agentic workloads
  1. 80.0%

    LiveCodeBench v6

    Published Gemma 4 31B instruction-model result in Google’s model card.

  2. 2150

    Codeforces ELO

    Published competitive-programming rating for the 31B model.

  3. 01

    Local coding assistant

    Use open weights when repository privacy or deployment control matters.

  4. 02

    Tool-using coding agent

    Combine thinking, native function calling, source context, and external validation tools.

08 / Benchmarks

Gemma 4 31B IT Benchmark Profile

Google’s Gemma 4 model card positions the 31B dense model at the top of the family across a broad mix of reasoning, coding, vision, and long-context benchmarks.

Reasoning and Knowledge

Published 31B results include:

  • MMLU Pro: 85.2%;
  • AIME 2026 without tools: 89.2%;
  • GPQA Diamond: 84.3%;
  • BigBench Extra Hard: 74.4%;
  • MMMLU: 88.4%.

Coding

  • LiveCodeBench v6: 80.0%;
  • Codeforces ELO: 2150.

Vision

  • MMMU Pro: 76.9%;
  • MATH-Vision: 85.6%;
  • MedXPertQA multimodal: 61.3%;
  • OmniDocBench 1.5 average edit distance: 0.131, where lower is better.

Agentic Tool Use

  • Tau2 average: 76.9%.

Long Context

  • MRCR v2, 8-needle, 128K average: 66.4%.

The long-context score is especially useful when comparing the 31B dense model with the 26B A4B sibling.

Google reports 44.1% for the 26B A4B model on the same 128K MRCR evaluation.

That gives the 31B dense model a distinct long-context quality advantage in the published table.

Published Gemma 4 results
  1. 89.2%

    AIME 2026

    Mathematical reasoning result without tools.

  2. 84.3%

    GPQA Diamond

    Graduate-level scientific reasoning benchmark.

  3. 80.0%

    LiveCodeBench v6

    Published competitive coding result.

  4. 76.9%

    MMMU Pro

    Multimodal reasoning benchmark.

  5. 66.4%

    MRCR v2 128K

    Long-context 8-needle result reported by Google.

09 / Pricing

Gemma 4 31B IT Pricing

Google currently lists Gemma 4 Gemini API input, output, and context caching as free on the free tier, with no paid-tier token price published for Gemma 4.

Free Hosted Access Is Not the Same as Unlimited Production Capacity

Google’s Gemini Developer API pricing table lists Gemma 4 as:

  • input: free of charge on the free tier;
  • output: free of charge on the free tier;
  • context caching: free of charge on the free tier;
  • paid-tier token pricing: not available.

That makes Gemma 4 unusual compared with standard Gemini models that have explicit paid token rates.

Free-tier access still has operational constraints.

Availability and quotas can limit request rate, token throughput, concurrency, and sustained production use.

For teams that need predictable capacity, Gemma’s open weights provide another path: self-host the model or use a third-party inference provider.

Self-hosted economics are completely different.

Instead of a per-token API bill, the main costs become GPU or TPU capacity, memory, server uptime, orchestration, autoscaling, observability, and engineering operations.

Hosted and self-hosted economics

1M tokens · USD

Input
$0
Context caching
$0
Output
$0

Google free tier

Published token charge
$0
Paid-tier rate
N/A
Token price
Free tier

10 / Deployment

Open Weights Make Gemma 4 31B Different From Closed API Models

Gemma 4 31B IT can be downloaded, inspected, fine-tuned, quantized, and deployed outside Google’s hosted API, giving developers substantially more control over inference.

Hosted API or Your Own Infrastructure

Google distributes Gemma 4 as an open model and makes the weights available through channels such as Hugging Face and Kaggle.

That enables several deployment patterns.

Gemini API

Best for quick prototyping without managing infrastructure.

Cloud inference provider

Useful when a third party can provide predictable serving capacity.

Self-hosted GPU server

Useful when privacy, custom infrastructure, or deployment control matters.

Quantized local deployment

Possible when quality, memory, and latency tradeoffs allow lower-precision weights.

The dense 31B model is the heaviest Gemma 4 option among the commonly discussed server-grade variants.

Google’s deployment guidance places the 31B model on large servers or server clusters.

The 26B A4B sibling is more attractive when inference efficiency is the priority.

The open-weight nature also means model lifecycle is more nuanced than for a closed API.

A hosted endpoint can disappear while the weights remain usable indefinitely.

That is why “deprecated” must always specify which deployment surface is deprecated.

Open-weight deployment choices
  1. 01

    Gemini API

    Use Google-hosted inference without managing model-serving infrastructure.

  2. 02

    Third-party inference

    Use another provider when its pricing, regions, quotas, or hardware fit the workload better.

  3. 03

    Self-host

    Run the open weights on infrastructure you control when privacy or deployment ownership matters.

  4. 04

    Quantize

    Trade some numerical precision for lower memory use and potentially faster local inference.

11 / 31B vs 26B A4B

Gemma 4 31B IT vs Gemma 4 26B A4B IT

The most important Gemma 4 comparison is not 31B versus a slightly smaller dense model—it is dense 31B versus the sparse 26B A4B Mixture-of-Experts architecture.

Gemma 4 31B IT

  • 30.7B total parameters;
  • dense;
  • 60 layers;
  • every token uses the dense model;
  • 256K context;
  • text and image input;
  • stronger published benchmark results;
  • higher inference compute.

Gemma 4 26B A4B IT

  • 25.2B total parameters;
  • approximately 3.8B active parameters;
  • 30 layers;
  • Mixture-of-Experts architecture;
  • only a subset of parameters is active per token;
  • 256K context;
  • text and image input;
  • significantly more efficient inference.

Google itself recommends 26B A4B as a strong starting point for many Gemma workloads because of its lower resource requirements.

The 31B model is the better historical baseline when the objective is maximum Gemma 4 quality.

The 26B A4B model is the more natural option when throughput, memory, and serving cost dominate.

Dense quality vs MoE efficiency
  1. 30.7B

    31B dense parameters

    The full dense network participates in inference for every token.

  2. 3.8B

    26B A4B active parameters

    Only a small subset of the MoE model is active per token despite 25.2B total parameters.

  3. 256K

    Shared context class

    Both models support the 256K context tier in the Gemma 4 family.

  4. 01

    Choose by workload

    Use 31B when quality justifies dense compute; use 26B A4B when efficiency and throughput matter more.

12 / Lifecycle

Gemma 4 31B IT Lifecycle Status

EidoStack treats Gemma 4 31B IT as deprecated, but Google’s current documentation still lists gemma-4-31b-it as a supported Gemini API model and the open weights remain available.

Open Models Have More Than One Lifecycle

A closed model usually has one dominant lifecycle: the provider launches an API, deprecates it, and eventually shuts it down.

Open-weight models are different.

Gemma 4 31B IT can exist simultaneously as:

  • a Google Gemini API endpoint;
  • a downloadable Google model;
  • a Hugging Face repository;
  • a self-hosted deployment;
  • a third-party hosted endpoint;
  • an EidoStack catalog entry.

Those surfaces can have different lifecycle states.

A third-party provider can deprecate its hosted endpoint while the model itself remains fully downloadable.

Likewise, EidoStack can stop recommending or selecting a model even while Google still serves it.

As of the current Google documentation checked for this page:

  • gemma-4-31b-it is still listed among supported Gemini API models;
  • the Gemini Interactions API also lists it;
  • the open weights remain published.

Therefore this page deliberately does not invent a Google shutdown date, a Google replacement model, or a global retirement of the weights.

Deprecation requires provider context
  1. 01

    EidoStack status

    Treat the model page as deprecated in the EidoStack catalog.

  2. 02

    Google hosted status

    Current Google documentation still lists gemma-4-31b-it as a supported Gemini API model.

  3. 03

    Open-weight status

    The model weights remain downloadable and can be independently deployed.

  4. 04

    Provider-specific endpoints

    Third-party inference providers can retire their own Gemma endpoint without retiring the underlying model.

13 / Migration

Migrating Away From Gemma 4 31B IT in EidoStack

Because there is no confirmed Google-wide shutdown in the current documentation, migration should be driven by your deployment goal rather than an invented universal replacement.

Decide What You Are Actually Replacing

There are several different migration goals.

Reduce inference cost

Benchmark Gemma 4 26B A4B IT or another efficient open model.

Preserve open weights

Choose another downloadable model rather than moving automatically to a closed API.

Keep Google-hosted inference

Evaluate the currently supported Google model catalog using the same prompts and modalities.

Improve reasoning

Compare thinking-enabled models on your real reasoning set.

Improve multimodal quality

Replay images, PDFs, screenshots, charts, and OCR tasks.

Replace an EidoStack deprecated selection

Preserve the old prompt set and compare a currently selectable model under the same context strategy.

A strong migration suite should include short instruction-following prompts, long documents, 128K+ context cases, coding tasks, screenshots, document understanding, function calls, thinking-enabled reasoning, and multilingual prompts.

Measure correctness, reasoning quality, tool-call accuracy, latency, output length, context consumption, infrastructure cost, and accepted-result rate.

Choosing the next deployment path
  1. 01

    Preserve your benchmark set

    Keep the prompts, images, tools, context lengths, and expected outputs that represented your 31B workload.

  2. 02

    Choose the migration objective

    Separate quality, cost, self-hosting, throughput, and provider-availability goals instead of treating them as one decision.

  3. 03

    Compare 26B A4B when efficiency matters

    The MoE sibling is the most direct Gemma 4 architectural alternative for reducing inference demand.

  4. 04

    Re-evaluate hosted and self-hosted economics

    Compare free hosted quotas, third-party API rates, accelerator cost, and operational overhead for the new deployment.

14 / Evaluation

Gemma 4 31B IT Strengths and Limitations

Gemma 4 31B IT is most distinctive as a large dense open model with strong published reasoning, coding, vision, long-context, and agentic results—but that capability comes with much heavier inference requirements than the family’s MoE alternative.

Strengths

  • Strong dense-model benchmark profile

    Google’s published Gemma 4 evaluations generally place 31B above the other family variants on reasoning, coding, vision, and long-context tasks.

  • Open weights

    The model can be downloaded, inspected, self-hosted, quantized, and deployed outside a single proprietary API.

  • 256K long context

    A 262,144-position configuration supports large documents, code, conversation history, and multimodal context.

  • Modern agentic capabilities

    Thinking mode, native function calling, system-role support, image understanding, and strong coding performance enable advanced workflows.

What to consider

  • Heavy dense inference

    30.7B dense parameters require substantially more compute than the 26B A4B MoE model’s roughly 3.8B active parameters.

  • No native audio on 31B

    Native audio belongs to the E2B, E4B, and 12B Gemma 4 variants.

  • Hosted free tier is quota-bound

    Google lists free Gemini API token pricing for Gemma 4 but does not provide a normal paid-tier token rate for scaling the endpoint.

  • Lifecycle depends on deployment surface

    EidoStack, Google, third-party hosts, and self-hosted weights can all have different availability states.

Preserve the dense Gemma baseline

Compare Gemma 4 31B behavior with a supported alternative

Replay your text, image, coding, tool-calling, and long-context prompts against a current model while keeping Gemma 4 31B IT as a historical dense-model baseline.

Start Free

Gemma 4 31B IT is marked deprecated in EidoStack. Google’s current documentation still lists the hosted Gemini API model, and the open weights remain available for independent deployment.

Common Questions

What is Gemma 4 31B IT?

Gemma 4 31B IT is Google DeepMind's 30.7B-parameter dense instruction-tuned open-weight model for text and image understanding, reasoning, coding, and function calling.

Is Gemma 4 31B IT deprecated?

It is marked deprecated in the EidoStack model catalog. That status does not mean Google has shut down its Gemini API endpoint or that the open weights are globally retired.

Has Google announced a shutdown date for gemma-4-31b-it?

No Google shutdown date is confirmed in the documentation used for this page. Google's Gemini API documentation still lists gemma-4-31b-it as supported.

Can Gemma 4 31B IT still be self-hosted?

Yes. Its open weights remain independently deployable, including through self-hosted or third-party inference, regardless of the EidoStack catalog status.

How many parameters does Gemma 4 31B IT have?

It has 30.7 billion parameters in a dense transformer architecture with 60 layers.

What is its context window and maximum API output?

The context window is 256K, corresponding to 262,144 positions. The Gemini API lists a maximum output of 32,768 tokens.

Does Gemma 4 31B IT support images and audio?

It accepts text and images and generates text. It does not have the native audio capabilities of the smaller E2B, E4B, and 12B Gemma 4 variants.

Does Gemma 4 31B IT support thinking mode and function calling?

Yes. Gemma 4 supports configurable thinking and native structured function calling, which can be evaluated on reasoning and tool-use tasks.

How much does Gemma 4 31B IT cost through the Gemini API?

Google currently lists free-tier input, output, and context-caching tokens for Gemma 4. Free-tier quotas apply, and no standard paid-tier token rate is published for this model.

How does Gemma 4 31B compare with Gemma 4 26B A4B?

The 31B model is a 30.7B-parameter dense network. The 26B A4B variant uses a Mixture-of-Experts architecture with 25.2B total and approximately 3.8B active parameters, generally requiring less inference compute.

Is Gemma 4 31B IT useful for coding?

Yes. It supports coding and tool use, with Google's published benchmark results including 80.0% on LiveCodeBench v6. Evaluate it with representative code and latency requirements.

How should I migrate from Gemma 4 31B IT?

First decide whether you need a current EidoStack model selection, lower inference cost, continued open-weight deployment, or a different hosted provider. Compare alternatives on your existing text, image, coding, and long-context prompts.

Model information

Last updated

Architecture, parameter count, context length, multimodal capabilities, thinking mode, function calling, system-role support, benchmark results, Gemini API availability, free-tier pricing, and deployment details are based on Google AI for Developers Gemma 4 documentation and model card, the official Gemma 4 model repository, and Gemini API documentation. Lifecycle wording on this page distinguishes EidoStack deprecation status from Google-hosted and open-weight availability.