Guide

Gemma 4 31B: Capabilities, Memory Needs, and Access Options

Gemma 4 31B is Google's dense open model with a 262K-token window. See how much memory it needs at each context length and how to use it in Maple.

The words Gemma 4 31B in Maple’s dot-matrix type beside Google’s G mark on a light coral and gray field.

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.

Gemma 4 31B at a glance
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.

Timeline, 2026. Mar 31: Google releases Gemma 4. E2B, E4B, 26B A4B and 31B, under Apache 2.0. Apr 16: MTP drafter models. For faster decoding with speculative decoding. Jun 3: Gemma 4 12B Unified. A fifth size, with audio input. Jun 5: 4-bit QAT checkpoints for 31B. The Q4_0 GGUF download is 18.85 GB. Jul 2: Technical report on arXiv.
Since launch, Google has added faster-decoding drafters, official 4-bit checkpoints and a fifth size; the 31B weights themselves have not changed.

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.

AttributeGemma 4 31BGemma 4 26B A4B
ArchitectureDense, 60 layersMixture of experts, 30 layers, 8 of 128 experts active plus 1 shared
Parameters30.7B25.2B total, 3.8B active
Context window262,144 tokens262,144 tokens
InputText and imagesText and images
Memory to load, BF16 / 4-bit69.9 GB / 17.5 GB57.7 GB / 14.4 GB
MMLU Pro85.282.6
GPQA Diamond84.382.3
LiveCodeBench v680.077.1
MMMU Pro (images)76.973.8
MRCR v2, 8 needles at 128K66.444.1
In MapleAvailable on Pro, Max and TeamNot 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:

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.

ContextKV cache (our estimate)Total with 4-bit weights
32K tokens2.2 to 3.5 GB19.7 to 21.0 GB
128K tokens6.2 to 11.6 GB23.7 to 29.1 GB
256K tokens11.6 to 22.3 GB29.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:31b tag 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 gemma4 reasoning 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.

Gemini API (unpaid tier, per Google’s terms): your device, readable by you; in transit, encrypted; Google’s servers and afterward, readable by Google: used to improve Google products, and human reviewers may read inputs and outputs. Maple: your device, readable by you; in transit, a secure enclave and afterward, no person can read it; chat history stored encrypted.
On the Gemini API’s unpaid tier, Google’s terms let it use and review your prompts; on Maple no person can read them after they leave your device.

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.

FactorSelf-hosted weightsGoogle's Gemini APIMaple
SetupOne GPU with 24 GB or more for 4-bit; Ollama, llama.cpp or vLLMGoogle account and API keyPro, Max or Team plan; choose the model
Model nameThe checkpoint you downloadgemma-4-31b-itGemma 4 31B, gemma4-31b on the API
ContextUp to 262,144, limited by your GPU memoryNot stated on Google's Gemma page262,144 tokens
ImagesNativeNativeDescribed by a vision model in the app; native on Maple Proxy
Data boundaryYour infrastructureGoogle's unpaid-service terms; paid terms in the EEA, Switzerland and the UKEncrypted on your device, decrypted only inside a hardware-isolated enclave
Cost sourceHardware, power and setup timeFree of chargeMaple plan pricing
Main limitationLong context needs far more memory than the weightsPrompts may be used and reviewed by GooglePaid 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

  1. 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.
  2. Google, Gemma 4 license (Apache License 2.0), April 1, 2026, and the Gemma Terms of Use, which point Gemma 4 to it.
  3. 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.
  4. 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.
  5. Gemma Team, Google DeepMind, “Gemma 4 Technical Report”, arXiv, submitted July 2, 2026.
  6. 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.
  7. 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.
  8. 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.
  9. 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.
  10. 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.
  11. Maple, image description in the app and native images on the API. Source for how each surface handles an uploaded image.
  12. Google, Gemini Developer API pricing, updated October 19, 2026. Source for Gemma 4's free tier and the absence of a paid tier.
  13. 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.

Frequently Asked Questions

Is Gemma 4 31B open source?

The weights are released under the Apache 2.0 license, with no click-through and no use policy attached, so you can download, modify and build on them commercially. Google also publishes a technical report. It does not publish its training data.

Can Gemma 4 31B run on a 24 GB GPU?

With 4-bit weights and a modest context, yes. Google estimates 17.5 GB to load the model at Q4_0, and by our estimate a 32K-token conversation adds about 2 to 3.5 GB. The full 256K window adds 12 to 22 GB, which does not fit beside the weights on a 24 GB card.

Does Gemma 4 31B accept audio or video?

No audio. The 31B model takes text and images and returns text. It can read video only as a series of frames, up to 60 seconds at one frame per second. Google's smaller E2B, E4B and 12B models accept audio.

What context length does Maple give Gemma 4 31B?

The full 262,144-token window, in the Maple app and on Maple Proxy. In the app the window holds both your conversation and the answer, and when a long chat outgrows it, older turns from the middle are trimmed first.

Can Gemma 4 31B see my images in Maple?

Through Maple Proxy, yes: an image you send goes to Gemma 4 31B itself. In the Maple app, a vision model first describes each uploaded image, and the model you picked works from that description.

Can Maple read my Gemma 4 31B chats?

No. No one at Maple can read your chats. They are encrypted on your device and decrypted only inside a hardware-isolated enclave running open-source code you can verify, and your chat history is stored encrypted. Our privacy notice covers everything outside your chats.