Skip to main content

Model guide

Gemma 4 31B Instruct

Gemma 4 31B is the large dense text-and-image model, distinct from the 26B-A4B mixture-of-experts option. It belongs on the shortlist for an existing high-memory multimodal setup, not a minimal first installation. Choose another Gemma 4 checkpoint when audio input is required.

30.7BMultimodal262,144 token contextView the model card →

At a glance

Parameters
30.7B
Accepts
Text · Image
Returns
Text
Published context limit
262,144 tokens
Model format
safetensors · GGUF
Software and download hosts
Ollama · MLX. Follow the exact setup below; this list does not establish support for every format, input type or software version.
Suggested compression
Q4_K_M
Model-weight download
Q4_K_M weights · 18.69 GBlmstudio-community (community conversion)gemma-4-31B-it-Q4_K_M.gguf
Image-projector download
mmproj-gemma-4-31B-it-BF16.gguf · 1.20 GB. Both downloads total 19.89 GB.
Languages
35+ supported languages; pre-trained on 140+ languages
License
Apache 2.0

Will it fit?

Gemma 4 31B Instruct · Q4_K_M download. Fit depends on your computer, the app you run it in and the conversation length you need. Image processing and any companion files need additional memory.

Check on your computer

Best for

  • Try dense 31B on the same monthly totals as 26B-A4B. Check whether April and May are correctly identified and whether the reported difference is six jobs.

Choose something else when

  • For audio input choose a Gemma 4 checkpoint documented for audio. The 31B path takes text and images.

Using image input

Image setup: follow the image check.

First setup

Check a representative task

Use the same table as 26B-A4B; this model supports images, not audio input.

Setup for this check: Open llama.cpp image setup and start the server with the matching projector.

Test image

In the llama.cpp vision session, attach this image and paste the question below. Keep the answer key out of the prompt. Crop to the table if you cannot save the image.

Read the displayed table. Which month has the most completed jobs? Which has the fewest returned jobs? How many more jobs were completed in April than March?

Check the result: April has the most completed jobs; May has the fewest returns; April has 6 more completed jobs than March.

The image attachment and matching image-processing components must actually be loaded. A text-only run, or an answer inferred from pasted text, does not pass the image check. This small fixture does not establish accuracy on scans, complex charts or real documents.

This creates a 4,096-token copy of gemma4:31b-it-q4_K_M named gemma-4-31b-it-short-context. Save the following as a file named Modelfile in your working folder:

FROM gemma4:31b-it-q4_K_M
PARAMETER num_ctx 4096

Then run these commands from that folder:

ollama pull gemma4:31b-it-q4_K_M
ollama create gemma-4-31b-it-short-context -f ./Modelfile
ollama run gemma-4-31b-it-short-context

Run the task check. Attach the image in a client that supports image input for this model. While the model is loaded, run ollama ps in another terminal and check CONTEXT and PROCESSOR.

The recorded Ollama package is Q4_K_M: 18.67 GB of model weights and 1.20 GB of media companion weights, plus 0.51 GB for its bundled draft model. Use Ollama 0.30.9 or a supporting newer release. A Hugging Face GGUF or MLX checkpoint is a separate representation; choose the matching source and runner in the memory calculator.

See Ollama context settings and the Modelfile instructions.

Other models for this task