Google Cloud logo Open weights · Apache 2.0

Gemma 4 31B

The largest dense model in Google's Gemma 4 family at 30.7B parameters, tuned for consumer GPUs. Apache 2.0 license.

Cheapest via Geodd
Input
$0.13 / 1M tokens
Output
$0.37 / 1M tokens
Geodd Novita Together AI EcoHash Google Cloud 5 providers

Key Specifications

Context window
256K tokens
Knowledge cutoff
Released
Parameters
30.7B
Inputs
Text, image
Capabilities Show details
Reasoning Thinks before it answers, always on or as a switchable mode. Function calling Connect to external tools, APIs, and systems. Structured output Return responses in structured formats like JSON.

Hosted API pricing

Provider Input / 1M tokens Output / 1M tokens Cost at 10M in + 2M out
Geodd logo Geodd Cheapest $0.13 $0.37 $2.04 View
Novita logo Novita $0.14 $0.40 $2.20 View
Together AI logo Together AI $0.39 $0.97 $5.84 View
EcoHash logo EcoHash $0.50 $0.50 $6.00 View
Google Cloud logo Google Cloud Creator Open weights, no hosted price View

Heads up: Base-tier, on-demand rates per 1M tokens; cached, batch and long-context tiers excluded. A provider may serve a shorter context or a quantized build than the creator's release. Verify before provisioning. More on how we price.

Estimated cost to self-host

Gemma 4 31B needs about 22 GB of GPU memory at 4-bit with 32K context. The cheapest rental that fits is 2× RTX 4070 at about $130 a month.

That costs the same as roughly 762M tokens a month on Geodd's API. Self-hosting is more expensive below that volume.

Precision Cheapest, 32K context Cheapest, full 256K context
4-bitINT4 / FP4
Nvidia logo 2× RTX 4070 22 GB VRAM · $130/mo
Nvidia logo 4× RTX 4070 40 GB VRAM · $259/mo
8-bitFP8 / INT8
Nvidia logo 4× RTX 3060 38 GB VRAM · $144/mo
Nvidia logo 4× RTX 5060 Ti 54 GB VRAM · $288/mo
16-bitFP16 / BF16
Nvidia logo 8× RTX 3060 69 GB VRAM · $288/mo
Nvidia logo 8× RTX 5060 Ti 105 GB VRAM · $576/mo

Estimates based on median on-demand rates for Nvidia GPUs. Memory is weights plus KV cache for one request, using FP8 KV cache where supported and FP16/BF16 otherwise. Break-even assumes a 5:1 input-to-output ratio. No guarantee of runtime support, usable performance, or that a matching quantized build exists. How we estimate costs.

Similarly priced models

The models nearest Gemma 4 31B by blended rate, each at its own cheapest provider.

Model Blended / 1M vs Gemma 4 31B
Mistral Ministral 3 8B Mistral $0.15 −12%
Alibaba Cloud Qwen3.5-Flash Alibaba Cloud $0.15 −12%
Meta Llama 3.2 11B Vision Meta $0.155 −9%
Nvidia Nemotron 3 Super 120B A12B Nvidia $0.1583 −7%
DeepSeek DeepSeek V4 Flash DeepSeek $0.1633 −4%
Google Cloud Gemma 4 31B This model Google Cloud $0.17
Alibaba Cloud Qwen3-235B-A22B Instruct (2507) Alibaba Cloud $0.1717 +1%
Meta Llama 3.3 70B Meta $0.175 +3%
Tencent Hy3 Tencent $0.1967 +16%
Mistral Ministral 3 14B Mistral $0.20 +18%
Alibaba Cloud Qwen3.8-Flash Alibaba Cloud $0.2033 +20%

Prices are USD per 1M tokens at each model's cheapest listed provider. Blended is the cost of 10M input plus 2M output tokens, spread over the 12M.

Frequently Asked Questions

What is Gemma 4 31B good for?

Self-hosted text and image work at the heavy end of the Gemma 4 dense models. Apache 2.0 weights, tuned to fit a single consumer GPU.

When is Gemma 4 31B not a good fit?

Audio or video input, and hosted tools like web search or code execution. It is the heaviest Gemma 4 model to serve, and no maximum output is published.

What is the cheapest way to run Gemma 4 31B?

Hosted, unless you push serious volume. Geodd charges $0.13 in / $0.37 out per 1M tokens. The cheapest rental that fits is 2x RTX 4070 at $130 a month, which costs the same as about 762M tokens a month on that API.

Can I self-host Gemma 4 31B?

Yes. The weights are Apache 2.0 licensed. At 4-bit it needs about 22 GB of GPU memory, which starts at roughly $130 a month on the cheapest rental that fits.

More from Google Cloud

Model Context Input / 1M Output / 1M
Google Cloud Gemini 2.5 Flash-Lite 1M $0.10 $0.40
Google Cloud Gemma 4 26B A4B Open weights 256K $0.10 $0.30
Google Cloud Gemma 3 27B Instruct Open weights 128K $0.10 $0.30
Google Cloud Gemini 3.1 Flash-Lite 1M $0.25 $1.50
Google Cloud Gemma 3 12B Instruct Open weights 128K $0.05 $0.10
Google Cloud Gemini 3.5 Flash-Lite 1M $0.30 $2.50
Google Cloud Gemini 2.5 Flash 1M $0.30 $2.50
Google Cloud Gemini 3 Flash Preview 1M $0.50 $3.00