Vision · Google DeepMind
Run Gemma 4 31B in the EU through an OpenAI-compatible API
Gemma 4 31B is the largest dense model in Google DeepMind's Gemma 4 family, released in April 2026 under the Apache 2.0 licence. It reads text and images and handles a 256K-token context. On inference.eu you call it with the OpenAI or Anthropic request format, processed in EU data centres and never used for training.
- 0130.7B
- 02EU data centres
- 03Apache 2.0
What Gemma 4 31B is
Gemma 4 is Google DeepMind's family of open models, built from the same research as Gemini 3. The 31B model is the dense flagship: about 30.7 billion parameters, a vision encoder of roughly 550 million parameters, and a context window of 256K tokens. It accepts text and images in any order within one prompt and generates text.
The architecture mixes local sliding-window attention with global attention layers, which keeps memory use manageable on long inputs. Google states support for more than 35 languages out of the box, with pre-training on over 140. Unlike earlier Gemma releases, Gemma 4 uses the standard Apache 2.0 licence rather than custom Gemma terms.
What it does well, and where it falls short
Gemma 4 31B is a capable mid-sized model for reasoning, coding, agent workflows and image understanding. It reads charts, screenshots, scanned pages and photos alongside text, which makes it useful for document workflows that mix layouts and prose. Its dense design gives steady, predictable output quality across tasks.
Because every token passes through all 31 billion parameters, it does more work per token than mixture-of-experts models such as Gemma 4 26B A4B. It does not take audio input: in the Gemma 4 family only the E2B, E4B and 12B models do. For very long agentic coding sessions, larger models such as GLM-5.3 or Kimi K3 go further.
Calling Gemma 4 31B through the API
inference.eu speaks the OpenAI request format, so the OpenAI SDKs for Python and JavaScript, LangChain, LlamaIndex and the Vercel AI SDK work as they are. Set the base URL to the inference.eu API, use your inference.eu key and set the model to gemma-4-31b.
Send images as image_url content parts in the same message as your text; the model handles interleaved text and images. Tool calls, JSON output and streaming work as usual. If your tools use the Anthropic Messages format, Gemma 4 31B is available there as well, so you can switch by changing the base URL, key and model name.
Data residency for Gemma 4 31B
Gemma 4 is published by Google, but on inference.eu the model runs on infrastructure in the European Union. Your prompts, images and the responses are processed in EU data centres, are not sent to Google, and are never used to train any model.
Every customer gets a data processing agreement under Article 28 of the GDPR and our subprocessor list, so you can show exactly who processes the data and where. Billing is in euros. Because Gemma 4 uses the Apache 2.0 licence, there are no usage thresholds or prohibited-use addenda beyond the law itself, which makes it simple to approve for commercial products.
import os
from openai import OpenAI
client = OpenAI(base_url="https://api.inference.eu/v1", api_key=os.environ["INFERENCE_EU_API_KEY"])
response = client.chat.completions.create(
model="gemma-4-31b",
messages=[{"role": "user", "content": "Summarise this contract in five bullet points."}],
)
print(response.choices[0].message.content)What teams use it for
- 1
Document and form understanding
Read invoices, delivery notes and forms as images, and return the fields you need as structured JSON.
- 2
Visual support assistants
Let users upload a screenshot or photo of a problem and get an answer that takes the image into account.
- 3
Agent workflows
Plan and call tools in multi-step workflows where a dense, predictable model is easier to test than a larger one.
Gemma 4 31B: common questions
The questions buyers, developers and legal teams ask us most. Something missing? Ask us directly.
Related
- Gemma 4 26B A4BRun Google's Gemma 4 26B A4B on inference.eu: a fast mixture-of-experts model with image input and 256K context, processed in EU data centres.Vision
- Qwen3.8 27BRun Qwen3.8 27B on inference.eu: a dense open model with image and video input, adjustable reasoning and 256K context, OpenAI-compatible, processed in the EU.Reasoning
- Mistral Small 4 119BRun Mistral Small 4 119B from French lab Mistral AI on inference.eu: reasoning, vision and code in one model, processed in EU data centres.Chat
- Llama 3.3 70B InstructRun Meta's Llama 3.3 70B Instruct on inference.eu: an OpenAI-compatible API with requests processed in EU data centres and billed in euros.Chat
Move your AI workloads to EU infrastructure
Tell us which models you use and roughly how much traffic you have. We reply within one working day with pricing and next steps.
- Reply within one working day
- Pricing for your volume
- DPA ready to sign