Skip to content
Agents tracked: 506 Releases (7d): 634 Agent status: 3 with issuesSince last limit reset: Claude 15d · Codex 0d For AI agents: Markdown Updated Nov 26, 2026

Gemma 4 31B

by Google

Chat, code and image reading.

Text and agentsCommercial useRuns on 32 GB

Hugging FaceDemos

1. Commercial use

“each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work”

Any use is allowed, paid products included; no fee and no credit line is required to use it.

ai.google.dev/gemma/docs/gemma_4_license

Checked against its official pages on Nov 23, 2026. Tap a verdict to see its source.How we checkedReport an error

What Gemma 4 31B does

Gemma 4 31B is an open text and image model by Google DeepMind that chats, writes code, reasons step by step and reads pictures, documents and screenshots. It is the largest dense size of the Gemma 4 family. The model files are on Hugging Face, free to use in paid products under the Apache 2.0 license.

What people use it for

Chat assistant and drafts

Run your own assistant for support chats, emails, summaries or marketing text, on your own server instead of a paid hosted model.

Read documents, charts and screenshots

Ask questions about a photo, a scanned page, a chart or an app screen, including text in many languages and handwriting.

Agents that call your tools

Let the model pick a function from your app (search, booking, database lookup) and fill in its inputs, as the core of an agent.

Write and fix code

Generate, complete and correct code locally, for example inside a private coding assistant.

Long files in one go

Give it up to 256K tokens at once, so a long report or a large part of a codebase fits in one request.

Many languages

Answer users in 35+ languages out of the box; it was trained on text in over 140 languages.

Gemma 4 31B popularity

4,457
likes on Hugging Face
5.6M
downloads, last 30 days
18
Hugging Face trending score

As reported by Hugging Face, checked Nov 26, 2026. Downloads include automated ones; some repositories report none.

Where to run Gemma 4 31B

Through an API

Provider$ per 1M in / outToolsContext
CoreWeave (99.6% up, 24h)$0.1 / $0.34Yes262K
Venice (99.8% up, 24h)$0.12 / $0.36Yes256K
NextBit (100% up, 24h)$0.125 / $0.34Yes262K
Crusoe (100% up, 24h)$0.14 / $0.4Yes260K
Parasail (100% up, 24h)$0.15 / $0.4Yes262K
PrimeIntellect (95.2% up, 24h)$0.186 / $0.312Yes262K
DeepInfra (99.8% up, 24h)$0.2 / $0.4Yes262K
OpenRouter$0.2 / $0.4Yes262K
Modal (100% up, 24h)$0.34 / $0.1Yes131K
ModelRun (100% up, 24h)$0.75 / $1Yes262K

As reported by each provider via Hugging Face Inference Providers and OpenRouter, checked Nov 26, 2026.

On your machine

Parameters

31.3B

Memory at 4-bit

about 18.8 GB

Our estimate: 0.6 GB per billion parameters, with room for the context.

GGUF builds

57 on Hugging Face

For llama.cpp, Ollama and LM Studio; e.g. ggml-org/gemma-4-31B-it-GGUF

MLX builds

15 on Hugging Face

For Apple silicon

Gemma 4 31B license

Free to use, change and sell inside paid products under Apache 2.0. If you pass the model files on, include a copy of the license and mark the files you changed.

In a paid product
Yes

Any use is allowed, paid products included; no fee and no credit line is required to use it.

“each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work” source

Ship the weights to users
With conditions

Shipping the weights or a fine-tuned copy needs a copy of the Apache 2.0 license and a note on changed files.

“You must cause any modified files to carry prominent notices stating that You changed the files” source

Work for clients
Yes

You may build and deliver client projects with it under the same Apache 2.0 terms.

“each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work” source

Alternatives

Gemma 4 31B This page

4,457 likesApache 2.0

Qwen3.8-27B

Qwen · image-text-to-text

21.7K likesApache 2.0

Kimi-K3

moonshotai · image-text-to-text

12K likesCustom license

Llama-3.1-8B-Instruct

meta-llama · text-generation

9,102 likesLlama 3.1 license

Qwen3.8-Flash-Next

Qwen · image-text-to-text

7,502 likesCustom license

All text and agents models

Get started

Tell your AI assistant

“Run google/gemma-4-31B-it locally with the latest transformers (pip install -U transformers torch accelerate), load it with AutoProcessor and AutoModelForMultimodalLM (dtype="auto", device_map="auto"), put images before text, use temperature 1.0, top_p 0.95, top_k 64, and read answers through processor.parse_response.”

  1. Install the libraries.

    pip install -U transformers torch accelerate

    From huggingface.co/google/gemma-4-31B-it/raw/main/README.md

  2. Load the model and its processor.

    from transformers import AutoProcessor, AutoModelForMultimodalLM
    
    MODEL_ID = "google/gemma-4-31B-it"
    
    # Load model
    processor = AutoProcessor.from_pretrained(MODEL_ID)
    model = AutoModelForMultimodalLM.from_pretrained(
        MODEL_ID,
        dtype="auto",
        device_map="auto"
    )
    

    From huggingface.co/google/gemma-4-31B-it/raw/main/README.md

  3. Send a chat with apply_chat_template and generate; add enable_thinking=True when you want step-by-step reasoning.

    From huggingface.co/google/gemma-4-31B-it/raw/main/README.md

Model id to use

OpenAI-compatible: base URL https://openrouter.ai/api/v1

google/gemma-4-31b-it

Mistakes to avoid

Loading it with old Gemma code or an old Transformers version
pip install -U transformers torch accelerate, then AutoProcessor plus AutoModelForMultimodalLM as in the model card

The model card says Gemma 4 needs the latest Transformers and shows only this loading code.

Sending the model's earlier thinking back in the chat history
Keep only the final answers of earlier turns; keep the thinking only for tool-call turns

The card says earlier thoughts must not be added before the next user turn.

Putting the image after the question in the prompt
Put image content first, then the text

Google recommends this order for the best results with images.

Keeping sampling settings copied from another model
temperature=1.0, top_p=0.95, top_k=64

The card gives one standard setting for all uses.

Showing the raw output to users with the thinking tags in it
Pass the output through processor.parse_response, which splits the thinking from the answer

With thinking on, the raw text holds the reasoning block before the answer.

Questions

Can I use Gemma 4 31B in a paid app?

Yes. It is under Apache 2.0, which allows commercial use; keep the license text with any copies of the files you share.

Does it understand images and audio?

Images and video frames, yes. Audio no; only the E2B, E4B and 12B sizes take audio.

How do I turn on thinking?

Set enable_thinking=True in apply_chat_template (or start the system prompt with the think token); parse_response then separates the reasoning from the answer.

What is the difference from Gemma 4 26B A4B?

31B is a dense model and scores higher in Google's table; 26B A4B uses only 3.8B active parameters per step and runs almost as fast as a 4B model.