# Gemma 4 31B IT

Gemma 4 31B IT is an open-weight dense model from Google with all 31B parameters active during inference, designed for tasks where output quality takes priority over raw throughput.

- **Model ID:** `google/gemma-4-31b-it`
- **Type:** chat
- **Providers:** novita, parasail, friendli, gmicloud
- **Context window:** 1,048,576
- **Maximum output tokens:** 1,048,576
- **Pricing:** $0.14/1M input tokens, $0.4/1M output tokens
- **Canonical page:** https://vercel.com/ai-gateway/models/gemma-4-31b-it

## Supported parameters

Detailed capability metadata has not been reported for this model.

## Example

```ts
import { streamText } from 'ai'

const result = streamText({
  model: 'google/gemma-4-31b-it',
  prompt: 'Why is the sky blue?'
})
```

## About

Gemma 4 31B IT is the dense counterpart in Google's Gemma 4 family, released on April 2, 2026 alongside the mixture-of-experts Gemma 4 26B. While both share the Gemini 3 architecture, this model activates all 31B parameters during every forward pass.

The dense design means every parameter contributes to every prediction. This produces higher output quality on complex reasoning, generation, and analysis tasks compared to the MoE variant, where a routing mechanism selects a subset of parameters. The tradeoff is higher compute per token, which translates to increased latency and cost per request.

Gemma 4 31B IT accepts text and image inputs within a context window of 1.0M tokens, supports over 140 languages, and handles function-calling, agentic workflows, structured JSON output, and system instructions. The instruction-tuning (indicated by the `it` suffix) prepares the model for conversational and task-oriented use out of the box.

Running Gemma 4 31B IT through AI Gateway provides unified billing, observability, automatic retries, and provider failover across a single API surface.

## What to consider

As a dense model with all parameters active, Gemma 4 31B IT uses more compute per token than the MoE Gemma 4 26B variant. Factor in the higher per-request cost and latency when evaluating provider variants for production traffic.

## When to use

### Best For

- **Quality-critical generation tasks** where you need the strongest output in the Gemma 4 family and can accept higher latency
- **Complex reasoning and analysis** including multi-step planning, code generation, and detailed document analysis
- **Multilingual applications** serving users across 140+ languages with a single model
- **Vision-language tasks** such as image understanding, visual Q&A, and document parsing within a context window of 1.0M tokens

### Consider Alternatives When

- Latency and throughput are your primary constraints, where the MoE Gemma 4 26B activates fewer parameters and responds faster
- You need native image or audio generation output, which Gemma 4 31B IT does not support
- Your workload is high-volume, low-complexity inference where a smaller or lighter model is more cost-effective
- You require proprietary-grade performance on the most demanding benchmarks, where Gemini 3 Pro may be a better fit

## Best for

- **Quality-critical generation tasks:** You need the strongest output in the Gemma 4 family and can accept higher latency
- **Complex reasoning and analysis:** Multi-step planning, code generation, and detailed document analysis
- **Multilingual applications:** serving users across 140+ languages with a single model
- **Vision-language tasks:** Image understanding, visual Q&A, and document parsing within a context window of 1.0M tokens

## Consider alternatives

- **Latency and throughput primary:** Your primary constraints favor the MoE Gemma 4 26B, which activates fewer parameters and responds faster
- **Native image or audio generation:** You need media output, which Gemma 4 31B IT does not support
- **High-volume low-complexity inference:** A smaller or lighter model is more cost-effective
- **Proprietary-grade benchmark performance:** Gemini 3 Pro may be a better fit for the most demanding benchmarks

## Frequently asked questions

### What makes Gemma 4 31B IT different from the MoE Gemma 4 26B?

Gemma 4 31B IT is a dense model, meaning all 31B parameters are active during every forward pass. The MoE Gemma 4 26B activates roughly 4B of its 26B total parameters per pass. Gemma 4 31B IT targets higher output quality; the 26B variant targets lower latency and cost.

### What input modalities does Gemma 4 31B IT support?

Gemma 4 31B IT accepts text and image inputs within a context window of 1.0M tokens. It does not generate images or audio.

### How does Gemma 4 31B IT relate to Google's Gemini models?

Gemma 4 31B IT is built on the same architecture as Gemini 3 but with open weights. It shares capabilities like function-calling, structured output, and system instructions. Gemini models remain proprietary; Gemma 4 31B IT lets you inspect or adapt the weights.

### What languages does Gemma 4 31B IT support?

Over 140 languages. The instruction-tuning covers multilingual conversational and task-oriented use cases.

### How do I use Gemma 4 31B IT on AI Gateway?

Set the model to `google/gemma-4-31b-it` in the AI SDK. AI Gateway handles provider routing, retries, and failover automatically.

### Does Gemma 4 31B IT support function-calling?

Yes. It supports function-calling for agentic workflows, structured JSON output, and system instructions natively, inherited from the Gemini 3 architecture.

## Links

- [Model page](https://vercel.com/ai-gateway/models/gemma-4-31b-it)
- [AI Gateway documentation](https://vercel.com/docs/ai-gateway)
- [Provider model documentation](https://novita.ai/models/model-detail/google-gemma-4-31b-it)
- [Provider pricing](https://novita.ai/pricing)
