Google · Released, not on our provider
Gemma 4 31B: Specs, How to Run Locally or by API, and Where to Try (2026)
Gemma 4 31B is Google DeepMind’s 30.7B dense open-weights model under an Apache 2.0 license—the largest of five Gemma 4 sizes—with a 256K-token context window, text and image input, text output, OpenRouter API providers ranging from $0.10 to $0.75 per million input tokens, and text chat available on our Gemma 4 page.
Use it now
Chat
This chat starts with Gemma 4, not Gemma 4 31B.
- Maker
- Type
- Text
- Released
- 2026-04-02
Checked
Gemma 4 31B: facts, with sources
- Gemma 4 31B Dense is the largest of the five open-weights sizes in Google DeepMind’s Gemma 4 family (E2B, E4B, 12B, 26B A4B, and 31B), released in both pre-trained and instruction-tuned variants. Google’s model card targets consumer GPUs and workstations for reasoning, agentic workflows, coding, and multimodal understanding, and states that Gemma 4 undergoes “the same rigorous safety evaluations as our proprietary Gemini models” (alongside Google’s closed proprietary Gemini models). For the full family overview and text chat with 31B on this site, see our Gemma 4 page.Source: ai.google.dev · checked 2026-11-24
- Google’s launch post, dated April 2, 2026, introduces Gemma 4 as “our most intelligent open models to date”, built from the same research and technology as Gemini 3 and released under a commercially permissive Apache 2.0 license. The post states that the family launched in four sizes (E2B, E4B, 26B MoE, and 31B Dense) with native function calling and structured JSON output, notes that unquantized bfloat16 26B and 31B weights fit on a single 80GB NVIDIA H100 GPU, and lists Vertex AI, Cloud Run, and GKE for production deployment.Source: blog.google · checked 2026-11-24
- Gemma 4 31B accepts interleaved text and image inputs with variable aspect ratios and resolutions (visual token budgets of 70, 140, 280, 560, and 1120) and processes video as sequences of frames up to 60 seconds at one frame per second, generating text output; audio input is not supported on 31B (only on E2B, E4B, and 12B Unified). The model card lists out-of-the-box support for 35+ languages (pre-trained on 140+ languages), native function calling, native system, assistant, and user roles, configurable thinking triggered by <|think|> in the system prompt (with disabled thinking still emitting empty thought tags on 31B and prior thoughts omitted in multi-turn history except tool-call turns), and recommended sampling settings of temperature=1.0, top_p=0.95, and top_k=64.Source: ai.google.dev · checked 2026-11-24
- In Google’s own model card benchmark table for instruction-tuned Gemma 4 31B (Google’s own published figures, not tested by us), Google reports 85.2% on MMLU Pro, 89.2% on AIME 2026 (no tools), 80.0% on LiveCodeBench v6, 2150 Codeforces ELO, 84.3% on GPQA Diamond, 76.9% on Tau2 (average over 3), 88.4% on MMMLU, 76.9% on MMMU Pro, 85.6% on MATH-Vision, 0.131 average edit distance on OmniDocBench 1.5 (lower is better), and 66.4% on MRCR v2 8 needle 128k (average). Across every listed text, vision, and long-context benchmark in that table, Google’s reported figures for 31B sit above its figures for 26B A4B.Source: ai.google.dev · checked 2026-11-24
- On Hugging Face, Google publishes the instruction-tuned weights at google/gemma-4-31B-it with header “License: Apache 2.0” and “Authors: Google DeepMind”. The repository includes quickstart code for Hugging Face Transformers (AutoProcessor and AutoModelForMultimodalLM, with enable_thinking set to True or False in apply_chat_template) as well as links for running google/gemma-4-31B-it with vLLM, SGLang, and Docker Model Runner.Source: huggingface.co · checked 2026-11-24
Family specs
Gemma 4 31B and the five Gemma 4 model sizes
- On Google’s Gemma 4 model card, 31B Dense has 30.7B total parameters, 60 layers, a 1024-token sliding window, a 256K-token context length, a 262K vocabulary size, and a ~550M-parameter vision encoder, with no audio encoder. It uses hybrid attention interleaving local sliding-window attention with full global attention (with the final layer always global), unified Keys and Values in global layers, and Proportional RoPE (p-RoPE), and its pre-training dataset has a January 2025 cutoff.Source: ai.google.dev · checked 2026-11-24
- Google’s model card lists all five Gemma 4 sizes: E2B (2.3B effective, 5.1B with embeddings, 128K context), E4B (4.5B effective, 8B with embeddings, 128K context), 12B Unified (11.95B encoder-free, 256K context), 26B A4B MoE (25.2B total, 3.8B active across 8 of 128 experts plus 1 shared, 256K context), and 31B Dense (30.7B, 256K context). Comparing the two largest sizes, the model card states that 26B A4B “runs almost as fast as a 4B-parameter model” because it activates only a 4B subset per token, making 26B A4B the faster-inference option relative to the dense 31B.Source: ai.google.dev · checked 2026-11-24
Five sizes compared
Gemma 4 31B specs alongside every Gemma 4 size
Gemma 4 31B Dense is the largest of the five sizes in Google DeepMind’s Gemma 4 family, sitting above the faster 26B A4B Mixture-of-Experts model and the three smaller audio-capable models (E2B, E4B, and 12B Unified). Our Gemma 4 page covers the whole family and lets you chat directly with google/gemma-4-31b-it over OpenRouter. On AI Model Buffet a typical reply to Gemma 4 costs about 1 credit (a credit is about $0.01 in the $5 pack), billed by its real token cost, at least 1 credit.
| Size | Total parameters | Context | Input modalities |
|---|---|---|---|
| E2B | 2.3B effective (5.1B with embeddings) | 128K tokens | Text, Image, Audio (plus video as frames) |
| E4B | 4.5B effective (8B with embeddings) | 128K tokens | Text, Image, Audio (plus video as frames) |
| 12B Unified | 11.95B (encoder-free) | 256K tokens | Text, Image, Audio (plus video as frames) |
| 26B A4B | 25.2B total, 3.8B active (MoE: 8 of 128 experts + 1 shared) | 256K tokens | Text, Image (plus video as frames; no audio) |
| 31B Dense | 30.7B dense (60 layers) | 256K tokens | Text, Image (plus video as frames; no audio) |
Run and try
Where to run or try Gemma 4 31B
- Google also publishes its own quantization-aware 4-bit (q4_0) GGUF weights for 31B on Hugging Face at google/gemma-4-31B-it-qat-q4_0-gguf under Apache 2.0 without gating: the 31B model file is 16.44 GiB, plus a separate multimodal projector file of 0.16 to 1.12 GiB across Gemma 4 sizes (file sizes read November 21, 2026; we have not run these files).Source: huggingface.co · checked 2026-11-24
- Google DeepMind’s Gemma 4 page groups 12B, 26B, and 31B as models “optimized for consumer GPUs” for turning workstations into local-first AI servers, and provides a “Try in Google AI Studio” link. Under Download and Run, the page lists Hugging Face, Ollama, Kaggle, LM Studio, and Docker for model weights, plus Jax, Keras, Gemini Enterprise Agent Platform, Google AI Edge, Cactus, Google Kubernetes Engine, Ollama, and Unsloth for training and deployment; it does not print a minimum consumer GPU VRAM figure for 31B.Source: deepmind.google · checked 2026-11-24
- OpenRouter lists google/gemma-4-31b-it (262,144-token context, text, image, and video input, text output, tool calling, reasoning, and structured outputs) across multiple third-party hosts (the FAQ cites 15 providers; the standard-routing table lists 17 provider entries plus 1 Flex tier). As of November 25, 2026, OpenRouter’s header shows the lowest listed pair at $0.10 input / $0.34 output per 1M tokens (weighted average paid: $0.1327 / $0.3895 per 1M), while individual standard-routing providers range from $0.10 to $0.75 per 1M input and $0.10 to $1.15 per 1M output; prices vary by provider and change over time, and EU in-region routing is listed as not currently available. On AI Model Buffet a typical reply to Gemma 4 costs about 1 credit (a credit is about $0.01 in the $5 pack), billed by its real token cost, at least 1 credit.Source: openrouter.ai · checked 2026-11-24 · second-hand
- NVIDIA hosts google/gemma-4-31b-it (version Gemma 4 31B IT v1.0, global deployment) on NVIDIA NIM at build.nvidia.com, noting that NVIDIA does not own or develop the model. Its card lists a 256K input context length, 262,144 vocabulary size, text, image, and video (MP4/WebM) inputs, text output, and a 04/02/2026 release date on Build.NVIDIA.com and Hugging Face; the trial service is governed by the NVIDIA API Trial Terms of Service and model use by the NVIDIA Open Model License Agreement (with Additional Information: Apache License, Version 2.0). For deployment, NVIDIA lists vLLM and SGLang on Linux across NVIDIA A100, H100, H200, B100, B200, and GB200 GPUs (tested with vLLM on an H100), and prints no USD price.Source: build.nvidia.com · checked 2026-11-24 · second-hand
- In a third-party engineering article dated June 5, 2026, Callstack describes self-hosting google/gemma-4-31B-it with vLLM (0.22.0, noting full Gemma 4 support arrived in vLLM v0.19.0 with transformers >= 5.5.0, and SGLang added Gemma 4 in v0.5.11 and MTP in v0.5.12) on NVIDIA RTX PRO 6000 Blackwell Server Edition GPUs (96 GB GDDR7 each). Callstack writes that a single 96 GB GPU can run constrained setups (such as capping --max-model-len at 16K), whereas a two-GPU tensor-parallel replica (TP2, using about 85 GiB per active card at --max-model-len 32768) gives safer memory headroom and long-context capacity, and disabling unused modalities with --limit-mm-per-prompt saves KV cache. In Callstack’s own ShareGPT benchmark (Callstack’s own figures, not tested by us), adding the Gemma 4 MTP assistant checkpoint (google/gemma-4-31B-it-assistant) improved output throughput by 2.48x at concurrency 1, 1.92x at concurrency 10, and 1.09x at concurrency 100 while increasing mean and p99 TTFT.Source: callstack.com · checked 2026-11-24 · second-hand
Hosted and local options
Where to run or try Gemma 4 31B
You can try Gemma 4 31B in a hosted browser or API environment (Google AI Studio, OpenRouter, NVIDIA NIM, or text chat on our Gemma 4 page) or download the Apache 2.0 weights from Hugging Face, Ollama, Kaggle, LM Studio, or Docker to run on your own hardware. Official Google pages also list Vertex AI, Cloud Run, and GKE for cloud production deployment.
| Platform | How to use it | Official or third-party | Notes |
|---|---|---|---|
| Google AI Studio | Browser workspace linked via Try in Google AI Studio on Google DeepMind’s Gemma 4 page | Official (Google) | Google’s launch post says 31B and 26B run in Google AI Studio; no paid USD API rate is printed on the pages we read |
| OpenRouter | OpenAI-compatible API and web tryout via model slug google/gemma-4-31b-it | Third-party router and hosts | Header lists $0.10 / $0.34 per 1M tokens; standard providers range $0.10 to $0.75 input and $0.10 to $1.15 output per 1M (changes over time); no EU in-region routing |
| Hugging Face | Download google/gemma-4-31B-it weights or google/gemma-4-31B-it-qat-q4_0-gguf; run with Transformers, vLLM, SGLang, or Docker Model Runner | Official Google repos on Hugging Face | Apache 2.0, not gated; 4-bit QAT GGUF model file is 16.44 GiB plus a 0.16 to 1.12 GiB multimodal projector file across Gemma 4 sizes |
| Ollama | Local download and execution channel listed under Download and Run on Google DeepMind’s Gemma 4 page | Third-party local runtime (listed by Google) | Listed alongside LM Studio and Docker; minimum consumer GPU VRAM for 31B is not stated on the pages we read |
| Kaggle | Download official Gemma 4 model weights from the Kaggle channel listed on Google DeepMind’s page | Official distribution channel (Google) | Named in both Google’s launch post and DeepMind’s Download section; no separate fee printed on the pages we read |
| NVIDIA NIM | Hosted trial and Linux deployment (vLLM or SGLang) for google/gemma-4-31b-it (v1.0) at build.nvidia.com | Third-party host (NVIDIA) | Global deployment; governed by NVIDIA API Trial Terms and NVIDIA Open Model License (Apache 2.0 noted); lists A100, H100, H200, B100, B200, GB200; no USD price printed |
| This site (Gemma 4 page chat) | Browser text chat on our Gemma 4 page, routed to OpenRouter’s google/gemma-4-31b-it | Third-party chat interface (unofficial) | Text-only chat; typical reply costs about 1 credit ($0.01 per credit in the $5 pack), billed by real token cost, at least 1 credit |
Source: deepmind.googleSource: blog.googleSource: openrouter.aiSource: huggingface.coSource: huggingface.coSource: build.nvidia.com
Nearest available
Alternatives to Gemma 4 31B you can use now
Gemma 4
Google$0.20 / $0.40 (per million tokens)
- Google’s launch post, dated April 2, 2026, introduces Gemma 4 as "our most intelligent open models to date", built from the same research and technology as Gemini 3 and released under an Apache 2.0 license. It says the family launched in four sizes: Effective 2B (E2B), Effective 4B (E4B), a 26B Mixture of Experts (MoE) and a 31B Dense, aimed at advanced reasoning and agentic workflows, with native function calling and structured JSON output.Source: blog.google · checked 2026-11-21
- On June 3, 2026 Google added Gemma 4 12B. Its post says it sits between E4B and the 26B MoE, runs locally on 16GB of VRAM or unified memory, is the first mid-sized Gemma 4 with native audio input, and has no separate vision or audio encoders. Google says its benchmark performance is near the 26B model at less than half the total memory. These are the maker’s own claims, not tested by us.Source: blog.google · checked 2026-11-21
- Google’s model card lists five sizes: E2B, E4B, 12B, 26B A4B and 31B. The small models (E2B, E4B) have a 128K-token context and the others 256K. All take text and image input and generate text; the card says E2B, E4B and 12B also take audio. It says all models have configurable thinking modes, native function calling and a native system role, and support more than 140 languages.Source: ai.google.dev · checked 2026-11-21
FAQ
Gemma 4 31B FAQ
What is Gemma 4 31B?
Gemma 4 31B (31B Dense) is the largest of the five open-weights models in Google DeepMind’s Gemma 4 family, introduced in Google’s April 2, 2026 launch post and published in both pre-trained and instruction-tuned (google/gemma-4-31B-it) variants under an Apache 2.0 license. Unlike Google’s closed proprietary Gemini models, Gemma 4 weights can be downloaded and self-hosted, while Google’s model card states they undergo the same rigorous safety evaluations. For an overview of the entire family, see our Gemma 4 page.
What are Gemma 4 31B’s specs, context window, and modalities?
According to Google’s Gemma 4 model card, 31B Dense has 30.7B total parameters, 60 layers, a 1024-token sliding window, a 256K-token context length (listed as 262,144 tokens on OpenRouter), a 262K vocabulary size, and a ~550M-parameter vision encoder. It takes text and image inputs (with variable aspect ratios, visual token budgets of 70 to 1120, and video as frames up to 60 seconds at 1 fps) and outputs text, with no audio support. It includes configurable thinking (<|think|>), native function calling, native system, assistant, and user roles, out-of-the-box support for 35+ languages (pre-trained on 140+ languages), and a January 2025 training data cutoff.
How large is Gemma 4 31B, and how can I run it myself?
You can download the Apache 2.0 weights from Hugging Face (google/gemma-4-31B-it) and run them with Transformers, vLLM, SGLang, or Docker Model Runner, or pull weights through Ollama, Kaggle, LM Studio, or Docker. Google’s launch post states that unquantized bfloat16 31B weights fit on a single 80GB NVIDIA H100 GPU, and Google also publishes an official 4-bit QAT (q4_0) GGUF repository (google/gemma-4-31B-it-qat-q4_0-gguf) whose 31B model file is 16.44 GiB plus a separate 0.16 to 1.12 GiB multimodal projector file. Official Google pages we read do not print a minimum consumer GPU VRAM requirement; in a third-party post, Callstack ran google/gemma-4-31B-it on vLLM with 96 GB NVIDIA RTX PRO 6000 Blackwell GPUs, noting a single 96 GB card needs reduced context (such as 16K) while two GPUs in TP2 used about 85 GiB each at 32K context.
Where can I try Gemma 4 31B online?
On the sources we read, hosted options include Google AI Studio (linked directly from Google DeepMind’s Gemma 4 page), OpenRouter (google/gemma-4-31b-it), Hugging Face (the official model repository and listed Spaces), NVIDIA NIM (build.nvidia.com), and browser text chat on our Gemma 4 page. For cloud self-deployment, Google’s launch post and DeepMind page also list Vertex AI, Cloud Run, and Google Kubernetes Engine.
How much does the Gemma 4 31B API cost?
Pricing depends on the host and changes over time. On OpenRouter (google/gemma-4-31b-it) as of November 25, 2026, the header lists the lowest input/output pair at $0.10 / $0.34 per 1M tokens (weighted average paid: $0.1327 input / $0.3895 output per 1M), while individual standard-routing providers span $0.10 to $0.75 per 1M input tokens and $0.10 to $1.15 per 1M output tokens (plus a DeepInfra Flex tier at $0.16 / $0.32). Neither Google’s pages we read nor NVIDIA NIM’s model card prints a paid USD per-million-token API rate.
How does Gemma 4 31B compare to 26B A4B and the other Gemma 4 sizes?
Gemma 4 spans five sizes: E2B (2.3B effective, 128K context), E4B (4.5B effective, 128K context), 12B Unified (11.95B encoder-free, 256K context), 26B A4B MoE (25.2B total, 3.8B active, 256K context), and 31B Dense (30.7B, 256K context). E2B, E4B, and 12B Unified support audio input, whereas 26B A4B and 31B Dense do not. Google’s model card notes that 26B A4B runs almost as fast as a 4B-parameter model because it activates only a 4B subset per token, while Google’s own published benchmark table (not tested by us) reports higher scores for 31B than 26B A4B, such as 85.2% vs 82.6% on MMLU Pro and 66.4% vs 44.1% on MRCR v2 8 needle 128k.
Can I use Gemma 4 31B on this site?
Yes, for text chat. Our Gemma 4 page runs OpenRouter’s google/gemma-4-31b-it in browser text chat. On AI Model Buffet a typical reply to Gemma 4 costs about 1 credit (a credit is about $0.01 in the $5 pack), billed by its real token cost, at least 1 credit. This site is text-only chat and does not provide Google AI Studio, NVIDIA NIM, or self-hosted weight downloads.
Is this the official Google website?
No. This page is unofficial and not affiliated with or endorsed by Google. Every fact links to the page we read.