Gemma 4 31B
Deploy Gemma 4 31B on a dedicated GPU from $0.45 per hour, billed per minute, on 1× RTX 4090. Google's 30.7B dense Gemma 4 model for text and vision, combining a 256K context window with configurable thinking, native function calling and strong reasoning and coding scores.
HexGrid Cloud price
$0.45/hr
1× RTX 4090
Context
256K
tokens
Parameters
30.7B
dense
Input
Text + Image
multimodal
Running Gemma 4 31B on HexGrid Cloud
What you get when you deploy with us, beyond the hourly rate.
Single tenant by default
The model runs on a GPU that is yours for the life of the instance. No shared endpoint, no queue behind other tenants.
Per-minute billing
You pay for the GPU, not the token. Stop the instance and billing stops with it.
OpenAI-compatible endpoint
Point an existing SDK at your instance by changing the base URL. No rewrite required.
Your weights, your data
Prompts and outputs stay inside your instance. Nothing is logged, sampled or used for training.
Gemma 4 31B GPU sizing and cost
What the model needs at each precision, and the cheapest HexGrid Cloud configuration that holds it.
| Precision | vRAM needed | Runs on | Price |
|---|---|---|---|
BF16 Recommended | 74 GB | 5× RTX A4000 | $1.00/hr |
FP8 | 37 GB | 1× RTX A6000 | $0.55/hr |
INT4 | 19 GB | 1× RTX 4090 | $0.45/hr |
No hardware-independent throughput number is published. Benchmark the precise HexGrid GPU, context length, image resolution and batch configuration before publishing tok/s.
About Gemma 4 31B
What Gemma 4 31B is built for, and where it falls short.
Gemma 4 31B is Google's largest dense Gemma 4 checkpoint. The instruction-tuned version accepts interleaved text and images and generates text, with a 256K-token context window.
Its architecture uses 60 decoder layers, a hybrid of local sliding-window and global attention, and a dedicated approximately 550M-parameter vision encoder.
Gemma 4 adds configurable thinking, native structured function calling, stronger coding capabilities and support for video understanding through sequences of image frames.
What people run it for
Multimodal assistants
Assistants that can reason jointly over screenshots, photographs, diagrams and text.
Document understanding
Extract, summarize and reason over visually structured documents and long textual context.
Coding agents
Generate and modify code while using structured functions or external development tools.
Visual question answering
Answer questions about diagrams, UI screenshots, charts and real-world images.
Strengths
- 256K context for large documents, long agent histories and multimodal prompts
- Native image understanding plus interleaved text-image input
- Configurable thinking mode for trading reasoning depth against latency
- Native function calling for agentic applications
- Apache 2.0 licence with straightforward commercial deployment terms
- Pre-trained on material spanning more than 140 languages
Limitations
- The 31B checkpoint does not include the audio encoder available in smaller Gemma 4 variants
- 30.7B dense parameters make full-precision deployment substantially heavier than smaller Gemma variants
- Video is handled through sampled image frames rather than a dedicated video encoder
- 256K-context serving can require substantial KV-cache memory
- Benchmark results depend on Google's documented evaluation settings and should not be treated as workload-specific guarantees
Quickstart
Deploy behind an OpenAI-compatible multimodal chat endpoint and submit text or image-plus-text messages.
from openai import OpenAI
client = OpenAI(
base_url="https://<your-instance>.hexgrid.cloud/v1",
api_key="<your-key>",
)
response = client.chat.completions.create(
model="google/gemma-4-31B-it",
messages=[
{"role": "user", "content": "Explain the tradeoff between local and global attention."}
],
)
print(response.choices[0].message.content)Gemma 4 is natively multimodal. Image requests should use the multimodal content-array format supported by the serving engine.
Gemma 4 31B reported benchmarks
Scores published by the model authors. A starting point, not a guarantee on your own data.
- MMLU Pro85.2%
- AIME 2026 no tools89.2%
- LiveCodeBench v680%
- GPQA Diamond84.3%
- Codeforces2150 ELO
- MMMU-Pro76.9%
Gemma 4 31B specifications
Architecture and serving details for Gemma 4 31B.
Architecture
- Type
- Dense multimodal Transformer
- Parameters
- 30.7B
- Layers
- 60
- Sliding window
- 1024 tokens
- Vision encoder
- ~550M parameters
- Vocabulary
- 262K
Context and modalities
- Context window
- 256K tokens
- Input
- Text + image
- Output
- Text
- Audio
- Not supported on 31B
- Video
- Supported through image-frame sequences
Capabilities
- Thinking mode
- Configurable
- Function calling
- Native
- Languages
- 35+ out of the box; pretrained on 140+
- Licence
- Apache 2.0
Gemma 4 31B frequently asked questions
Common questions about deploying Gemma 4 31B on HexGrid Cloud.
Is Gemma 4 31B actually a 31-billion-parameter model?
Google reports 30.7B total parameters; 31B is the rounded family name.
Does Gemma 4 31B support audio?
No. Google's table lists audio for E2B, E4B and 12B, but not for the 31B model.
Does it support images?
Yes. Gemma 4 31B has a dedicated approximately 550M-parameter vision encoder and supports interleaved text-image input.
Can I enable or disable reasoning?
Yes. Google's model interface exposes configurable thinking behavior.
Can I use it commercially?
Yes. Gemma 4 is released under Apache 2.0.
Deploy Gemma 4 31B today
$0.45 per hour on 1× RTX 4090, billed per minute, never shared.