Gemma 4 31B is the largest model in Google's Gemma 4 family of open models. Google's model card describes a dense model of 30.7 billion parameters with a 262,144-token context window. It takes text and images, returns text, can reason step by step before it answers, and calls tools. The weights are under Apache 2.0.
There are three broad ways to use it. You can run the weights yourself, which can fit on one high-memory GPU if you keep the context short. You can call Google's Gemini API or another host. Or you can use it in Maple, where we offer it on Pro, Max and Team plans with the full 262,144-token window, through our protected inference path.
This guide separates what belongs to the model from what belongs to each route, so you can pick one.
| What is it? | Google's dense 30.7B model: text and image in, text out, with a 262,144-token window, thinking mode and function calling.1 |
|---|---|
| Is it open source? | The weights are under the Apache 2.0 license, with no use policy attached.2 |
| How much memory does it need? | Google estimates 69.9 GB to load it at BF16 and 17.5 GB at 4-bit, before any conversation.3 |
| Does it fit a 24 GB GPU? | At 4-bit with a short context, yes. With the full 256K window, no, by our estimate. |
| Is it in Maple? | Yes, on Pro, Max and Team plans, with the full 262,144-token window.4 |
| Is it private? | That depends on the route, not the model. |
What is Gemma 4 31B?
It is the dense member of a family that now has five sizes. Dense means every parameter works on every token, so the whole model has to sit in memory and all of it runs each step. That makes 31B slower than its mixture-of-experts sibling, 26B A4B, and generally stronger in Google's own results.
Its attention design is what makes the long window affordable. Of its 60 layers, 50 look back only over the last 1,024 tokens, and every sixth layer reads the whole context. Google describes this as interleaving "local sliding window attention with full global attention". Once a conversation grows long, most of its memory therefore sits in just 10 layers, which matters when you size a machine.
Images go through a vision encoder of about 550 million parameters. Each image costs 70 to 1,120 tokens depending on the resolution budget, 280 by default. Video is read as frames, and the 31B model has no audio input. Google lists more than 35 languages as supported out of the box, from pre-training on more than 140.
Is Gemma 4 31B open source?
The weights are. Google publishes them under the Apache 2.0 license, a standard permissive license, and the repository needs no click-through. Earlier Gemma releases used Google's own Gemma Terms of Use; for Gemma 4 those terms simply point to Apache 2.0.
Google also published a technical report.5 It does not publish its training data, which has a January 2025 cutoff. If your definition of open source requires the data, Gemma 4 31B is open-weight rather than fully open.
Which Gemma 4 model is 31B, and what changed since launch?
Google released Gemma 4 in four sizes (E2B, E4B, 26B A4B and 31B) and added a fifth, the 12B Unified model, two months later.6 Pages written at launch describe four sizes and say audio belongs to the two small models. Both are now out of date: audio is supported on E2B, E4B and 12B, and never on 31B.
The 31B weights themselves have not changed since launch. What Google has added around them are tools for running them more cheaply. Its 4-bit quantization-aware training (QAT) checkpoints were trained to hold up at low precision, so they are a better starting point than a generic 4-bit conversion. Its MTP drafter models speed up decoding with speculative decoding; Google says by "up to 3x" with the same output quality.

Gemma 4 31B or 26B A4B?
The 26B A4B is a mixture-of-experts model: 25.2 billion parameters in total, 3.8 billion active per token. It has the same window and input types as 31B. Its memory saving is smaller than its name suggests, because every expert still has to be loaded.
| Attribute | Gemma 4 31B | Gemma 4 26B A4B |
|---|---|---|
| Architecture | Dense, 60 layers | Mixture of experts, 30 layers, 8 of 128 experts active plus 1 shared |
| Parameters | 30.7B | 25.2B total, 3.8B active |
| Context window | 262,144 tokens | 262,144 tokens |
| Input | Text and images | Text and images |
| Memory to load, BF16 / 4-bit | 69.9 GB / 17.5 GB | 57.7 GB / 14.4 GB |
| MMLU Pro | 85.2 | 82.6 |
| GPQA Diamond | 84.3 | 82.3 |
| LiveCodeBench v6 | 80.0 | 77.1 |
| MMMU Pro (images) | 76.9 | 73.8 |
| MRCR v2, 8 needles at 128K | 66.4 | 44.1 |
| In Maple | Available on Pro, Max and Team | Not offered |
The benchmark rows are Google's results for the instruction-tuned models; Google chose the tests and settings, and these are not Maple measurements. The gap is narrow on knowledge and reasoning and wide on long-context retrieval. If your work depends on finding details deep in a long document, 31B is the safer choice. If you want faster answers on modest hardware, 26B A4B is worth testing on your own tasks.
How much memory does Gemma 4 31B need?
Two amounts, and most hardware advice merges them. The first is the weights, which Google publishes. The second is the working memory for the conversation, the KV cache, which grows with every token in the context.
Google is explicit that its table covers only the first:
The estimates in the preceding table only account for the memory required to load the static model weights. They don't include the additional VRAM needed for supporting software or the context window.
We estimated the second from the model's published configuration.7 The 50 sliding-window layers need a fixed 0.84 GB at 16-bit precision, whatever the context length. The 10 global layers need about 41 KB per token, because Gemma stores one shared value for keys and values there. If a serving engine stores keys and values separately, that doubles to about 82 KB.
| Context | KV cache (our estimate) | Total with 4-bit weights |
|---|---|---|
| 32K tokens | 2.2 to 3.5 GB | 19.7 to 21.0 GB |
| 128K tokens | 6.2 to 11.6 GB | 23.7 to 29.1 GB |
| 256K tokens | 11.6 to 22.3 GB | 29.1 to 39.8 GB |
The totals add Google's 17.5 GB load figure for 4-bit weights; for 8-bit, add the KV column to 34.9 GB. They are for one conversation at 16-bit cache precision, on an engine that keeps the sliding-window layers to their window. Add the engine's own overhead. An 8-bit cache halves the KV column, and an engine that allocates the full window to every layer needs far more.
Read the table this way. A 24 GB GPU runs 4-bit Gemma 4 31B comfortably at 32K tokens, but not at the full 256K. Google also notes that Ollama defaults the context to 4K on machines with less than 24 GiB of GPU memory.8 A 48 GB card holds 8-bit weights with up to about 128K tokens, and the BF16 download of 62.55 GB needs an 80 GB-class GPU.9
How do you run Gemma 4 31B yourself?
On one GPU, in most setups. Running the weights yourself gives you the most control over the model, the serving stack and where your data goes. The cost is hardware, setup and keeping the stack current.
The common routes, from easiest to most configurable:
- Ollama or LM Studio. The
gemma4:31btag in Ollama is 19 to 20 GB, and both apps list a QAT build. Set the context length yourself, since Ollama's default is short on smaller GPUs. - llama.cpp. Google's guide recommends its QAT Q4_0 GGUF, an 18.85 GB download including the 1.20 GB vision projector. It warns that images consume context quickly.
- vLLM. The vLLM project's recipe lists one 80 GB NVIDIA GPU as the minimum for BF16 and gives a two-GPU example capped at a 32K window. It needs the
gemma4reasoning and tool-call parsers for thinking and function calling, and Google's 4-bit w4a16 checkpoint cuts the weights from 59.0 to 19.8 GB.10
Self-hosting is the right call when:
- your information must never leave hardware you control
- you need to fine-tune or deeply instrument the model
- you already have a GPU with 24 GB or more and only need modest context
If you need the full window, or you work across several devices, a hosted route avoids buying for the peak. Our DeepSeek V4.1 Flash guide covers a model where that choice is starker, because its checkpoint is 510 GB.
How do you use Gemma 4 31B in Maple?
Choose Gemma 4 31B under More models in the model picker in Maple Research, on a Pro, Max or Team plan. It is not available on Free. We configure it with the full 262,144-token window, so a long report, a codebase or a stack of notes can go into one conversation without a GPU of your own.
In the app, that window holds both your conversation and the answer. When a long chat outgrows it, Maple trims older turns from the middle first and always keeps your first message and your newest one. Thinking is on by default, and you can switch it off for quicker replies.
You can upload an image while using Gemma 4 31B in the app. The app first has a vision model describe the image, then gives that description to the model you selected.11 Gemma 4 31B answers from the description, not a direct view of the image.
For developer tools and existing applications, Maple Proxy is our API route, with the model ID gemma4-31b. There, an image you send goes to Gemma 4 31B itself, so use Proxy when a task depends on a small visual detail. Thinking is off on the API unless you set reasoning_effort, and the Proxy model list shows the current window and input types.
Plan details are on our pricing page, and Gemma 4 31B sits beside the other models we offer in our model library. If you need a longer window, our GLM-5.3 Flash guide covers a model with a million tokens.
The route has limits to plan around:
- Images are described in the app. Use Maple Proxy when the model must see the image itself.
- A paid plan is required. Gemma 4 31B is on Pro, Max and Team.
- Long chats are trimmed. Past 262,144 tokens, the middle of a conversation goes first.
What information reaches each route?
That depends on who operates the model: you, a conventional host, or Maple. Three questions get blurred together. Who can read your prompts while they are processed, what happens to them afterward, and is any of it used for training?
Self-hosted weights. Your prompts and outputs stay on infrastructure you operate. The trust boundary is your own access controls, logging and retention. That makes this the strongest option when information must stay on your hardware, and it makes you responsible for securing it.
Google's Gemini API. Google hosts Gemma 4 31B as gemma-4-31b-it. Its pricing page lists Gemma 4 as free of charge, with no paid tier.12 Google's terms for unpaid services say it uses what you submit to improve its products and machine learning technologies, and that "human reviewers may read, annotate, and process your API input and output."13
The same terms tell developers directly: "Do not submit sensitive, confidential, or personal information to the Unpaid Services." It is a clear disclosure. Users in the European Economic Area, Switzerland and the UK get Google's paid terms, under which prompts are not used to improve its products. Other hosts that serve the open weights set their own terms, so read them for the service you would use.
Maple. We run Google's open weights inside an attested enclave rather than calling Google's API. Your requests are encrypted before they leave your device, and our proof page explains the attestation you can check yourself.
The model runs in its own attested enclave, and Maple's enclave verifies it before forwarding a prompt. It works like certificate chains on the web: you check Maple's enclave, and Maple's enclave checks the model's. Our privacy notice covers everything outside your chats.

That design has a scope. It protects the contents of your chats: your prompts and the responses. It doesn't make information private if you've already shared it elsewhere.
It is also separate from the safety of what the model's output leads you to do. If you paste its code into production or act on its advice, confidential processing doesn't vouch for that code or those actions. Review outputs as you would any untrusted input.
Which route fits your task?
It depends on where your information may go, how much context you need and what hardware you have. The table compares the three routes on the same terms.
| Factor | Self-hosted weights | Google's Gemini API | Maple |
|---|---|---|---|
| Setup | One GPU with 24 GB or more for 4-bit; Ollama, llama.cpp or vLLM | Google account and API key | Pro, Max or Team plan; choose the model |
| Model name | The checkpoint you download | gemma-4-31b-it | Gemma 4 31B, gemma4-31b on the API |
| Context | Up to 262,144, limited by your GPU memory | Not stated on Google's Gemma page | 262,144 tokens |
| Images | Native | Native | Described by a vision model in the app; native on Maple Proxy |
| Data boundary | Your infrastructure | Google's unpaid-service terms; paid terms in the EEA, Switzerland and the UK | Encrypted on your device, decrypted only inside a hardware-isolated enclave |
| Cost source | Hardware, power and setup time | Free of charge | Maple plan pricing |
| Main limitation | Long context needs far more memory than the weights | Prompts may be used and reviewed by Google | Paid plan required; images described in the app |
A rough decision rule:
- Choose self-hosting if information must stay on your hardware and your context needs are modest.
- Choose the Gemini API for prompts you would be comfortable with Google using and reviewing.
- Choose Maple if you want the full 262K window on sensitive material without buying a GPU for it.
Sources
- Google DeepMind, Gemma 4 31B IT model card, last updated July 15, 2026. Source for the parameter count, layers, attention design, context length, input types, vision encoder, image token budgets, video limit, languages, training cutoff, thinking, function calling, benchmark results and the 26B A4B specifications.
- Google, Gemma 4 license (Apache License 2.0), April 1, 2026, and the Gemma Terms of Use, which point Gemma 4 to it.
- Google, Gemma 4 model overview. Source for the memory table for every Gemma 4 size and its scope, the 26B A4B memory figures and the quotation above.
- Maple, public model configuration and app model picker, with context handling and the thinking default. Source for the plans, configured window, trimming and thinking settings in Maple.
- Gemma Team, Google DeepMind, “Gemma 4 Technical Report”, arXiv, submitted July 2, 2026.
- Google, Gemma releases, also published on ai.google.dev, updated October 7, 2026. Source for the release dates of Gemma 4, the MTP drafters and the 12B Unified model; Google's QAT announcement (June 5, 2026) dates the 4-bit checkpoints, and Google's MTP drafter card for 31B is the source for the speedup.
- Maple's calculation from Google's Gemma 4 31B configuration: 10 global layers with 4 key-value heads of 512 dimensions and shared keys and values, and 50 sliding-window layers of 1,024 tokens with 16 key-value heads of 256 dimensions, at 2 bytes per value.
- Google, Run Gemma with Ollama. Source for Ollama's input types and its 4K default context under 24 GiB of GPU memory; the Ollama library lists the tag sizes.
- Hugging Face, repository file listings for Gemma 4 31B IT and Google's QAT Q4_0 GGUF. Our sums of the weight files: 62.55 GB at BF16 and 18.85 GB for the GGUF with its vision projector.
- vLLM project, Gemma 4 serving recipe, updated October 17, 2026. Source for the minimum GPU, the two-GPU example, the required parsers and the QAT memory saving.
- Maple, image description in the app and native images on the API. Source for how each surface handles an uploaded image.
- Google, Gemini Developer API pricing, updated October 19, 2026. Source for Gemma 4's free tier and the absence of a paid tier.
- Google, Gemini API Additional Terms of Service, updated April 28, 2026. Source for how Google uses and reviews content submitted to unpaid services, the quoted instruction, and the paid terms for the EEA, Switzerland and the UK.


