Contact, if you are interested in this website / domain name / sponsorship / advertisement / partnership

Gemma 4 31B

Gemma 4 31B is the largest dense model in Google's Gemma 4 family, released on 31 March 2026 under Apache 2.0. It accepts text and images (video as frames), offers a 256K context window and has a configurable thinking mode. It interleaves local sliding-window attention with periodic global layers.

By GoogleReleased March 31, 2026Data checked October 10, 2026
CurrentOpen weightsEfficient

Specifications

Context window
256Kabout 197,000 words, or 390 pages
Max output
Not published
Input price
$0.20per 1M tokens
Output price
$0.40per 1M tokens
Cached input
Not published
Weights
OpenApache-2.0
Parameters
31.3Bdense
Input types
Text, Images, Video
Output types
Text
Reasoning mode
Yes
Tool calling
Yes
Released
Mar 31, 2026Current

DeepInfra serverless price for gemma-4-31B-it (256K context).

What it costs in practice

WorkloadMonthly cost at list price
Support chatbot30,000 conversations a month, 2,000 input and 400 output tokens each$17
Document summaries2,000 documents a month, 12,000 input and 800 output tokens each$5.44
Coding agent1,000 tasks a month, 60,000 input and 6,000 output tokens each$14

Standard rates, no caching or batch discounts. Run your own numbers.

Strengths

  • Apache 2.0 license (earlier Gemma versions used custom terms)
  • Configurable thinking mode and native function calling
  • Only 10 of 60 layers use full global attention, which reduces KV-cache size

Trade-offs to weigh

  • About 62 GB of weights at BF16, so a single 24 GB GPU needs 4-bit quantization
  • No audio input at this size (audio is limited to E2B, E4B and 12B)

Where it fits

Google positions Gemma 4 31B for:

self-hostingmultimodalmultilingualfine-tuningchat

Where you can use it

  • Hugging Face
  • Ollama
  • DeepInfra

Run it yourself

Released under Apache-2.0. Approximate memory needed just to load the weights:

PrecisionMemory for weights
16-bit (BF16/FP16)63 GB
8-bit (FP8/INT8)31 GB
4-bit (Q4_K_M, about 4.85 bits)19 GB

Add memory for the KV cache (it grows with context length and concurrent users) and 1-2 GB of runtime overhead. Size it precisely in the VRAM calculator.

Model card on Hugging Face

Alternatives to consider

ModelTierContextInput / output per 1M
Mistral Small 4Mistral AIEfficient256K$0.15 / $0.60Compare
GLM-5.3-FlashZ.ai (Zhipu AI)Efficient1M$0.15 / $0.50Compare
Granite 4.2 30BIBMEfficient128K$0.16 / $0.65Compare
Ministral 3 14BMistral AIEfficient256K$0.20 / $0.20Compare

Frequently asked questions

How much does Gemma 4 31B cost?

Gemma 4 31B lists at $0.20 per million input tokens and $0.40 per million output tokens (checked October 10, 2026). DeepInfra serverless price for gemma-4-31B-it (256K context). Confirm current rates on the provider's pricing page before you commit.

What is the context window of Gemma 4 31B?

Gemma 4 31B accepts up to 262,144 tokens of context (about 197,000 words, or 390 pages). Long prompts cost more and can be slower, so most apps send only what the task needs.

Is Gemma 4 31B open source?

Gemma 4 31B is an open-weight model released under the Apache-2.0 license. You can download the weights from Hugging Face (google/gemma-4-31B-it) and run or fine-tune them yourself, within the license terms. Open weights isn't the same as fully open source: training data and code may not be published.

Can I run Gemma 4 31B locally?

Yes, if you have enough memory. The weights alone need about 19 GB at 4-bit quantization and about 63 GB at 16-bit, plus room for the KV cache. Use the VRAM calculator on LLModel.com to check a specific GPU or Mac.

What is Gemma 4 31B best for?

Google positions Gemma 4 31B for self-hosting, multimodal, multilingual, fine-tuning. It accepts text, images, video as input, has a reasoning (thinking) mode and supports tool calling. Test it on a sample of your own tasks before you choose it for production.

Sources

  1. huggingface.co/google/gemma-4-31B-it
  2. deepinfra.com/pricing
  3. ai.google.dev/gemma/docs/releases
  4. huggingface.co/google/gemma-4-31B-it/raw/main/config.json
  5. huggingface.co/api/models/google/gemma-4-31B-it
  6. ollama.com/library

Facts checked against these pages on October 10, 2026. Spot an error? Tell us.

Still choosing a model?

Send us your use case and constraints. We'll come back with a shortlist and an evaluation plan you can run on your own data.

  • Free and vendor-neutral: no model provider pays for placement.
  • Your details go only to partners you agree to.

Takes about 2 minutes. No sales calls unless you ask for one.