Google · released 2026-03-11

Gemma 4 31B

Largest dense Gemma 4 model, with image input, configurable thinking and a 256K context; Apache 2.0 licensed.

generalreasoningvisionmultilingual
Parameters
31B
Active / token
31B
Context
256K
Memory at Q4
20.8 GB
License
apache-2.0
Images
Yes
Thinking mode
Yes

Cheapest ways to use it $0.09 in / $0.34 out per 1M tokens via DeepInfra (12 providers) · or free on RTX 3090 or better

Get started

1 · Try it now

Chat with it on Google AI Studio ↗ Use via API from $0.09/1M on DeepInfra

Free online chats are the quickest way to see if a model suits you before downloading anything.

3 · Run it on your machine

Install Ollama, then run this in a terminal:

ollama run gemma4:31b

Will it run on my computer?

Gemma 4 31B needs roughly 20.8 GB of GPU memory at the usual Q4 quality. Check your exact machine →

MachineBest fileFitEst. speed
RTX 4060 Q4_K_M Spills to RAM ~3.2 tok/s · Slow
RTX 3060 12GB Q4_K_M Spills to RAM ~4.3 tok/s · Slow
RTX 4060 Ti 16GB Q4_K_M Spills to RAM ~5.6 tok/s · Slow
RTX 3090 Q4_K_M Fits in memory ~33 tok/s · Fast
RTX 4090 Q4_K_M Fits in memory ~35 tok/s · Fast
RTX 5090 Q5_K_M Fits in memory ~50 tok/s · Fast
M4 · 16 GB — Too big —
M4 Pro · 48 GB Q3_K_M Fits in memory ~11 tok/s · Usable
M4 Max · 128 GB Q5_K_M Fits in memory ~15 tok/s · Usable
M3 Ultra · 512 GB Q5_K_M Fits in memory ~22 tok/s · Usable
DGX Spark Q4_K_M Fits in memory ~10 tok/s · Usable
Ryzen AI Max+ 395 Q4_K_M Fits in memory ~7.8 tok/s · Slow

PCs assume 64 GB system RAM. Estimates, not measurements — method.

Ways to run it

Use it through an API 12 providers

Heads up: providers serve this model at different compression levels (fp4, fp8). 4-bit versions are cheaper to run and can be slightly worse.

ProviderInput / 1MOutput / 1MStated precisionContext
DeepInfra $0.09
$0.05 cached
$0.34 fp4 256K source ↗
Featherless $0.12 $0.36 not stated 256K source ↗
Venice $0.12
$0.05 cached
$0.36 fp4 250K source ↗
Chutes $0.12
$0.012 cached
$0.37 fp4 128K source ↗
Amazon Bedrock $0.14 $0.40 not stated — source ↗
Crusoe Cloud $0.14
$0.14 cached
$0.40 not stated — source ↗
FriendliAI $0.14 $0.40 not stated — source ↗
Parasail $0.15
$0.06 cached
$0.40 not stated — source ↗
DeepInfra $0.20 $0.40 fp8 256K source ↗
DeepInfra $0.27 $0.76 fp8 128K source ↗
SambaNova (SambaCloud) $0.38 $1.15 not stated 128K source ↗
SiliconFlow $0.75
$0.25 cached
$1.00 not stated 256K source ↗

Prices in USD from each provider’s own pricing page, checked 2026-12-04. Cheapest highlighted.

Rent a GPU and run it yourself

SetupFromPer hourFileEst. speedPer 1M tokens*
1× RTX A5000 24GB RunPod
community
$0.16 4-bit
20.8 GB
~27 tok/s $1.62
1× RTX 3090 24GB Vast.ai
marketplace
$0.21 4-bit
20.8 GB
~33 tok/s $1.78
1× RTX 3090 Ti 24GB Vast.ai
marketplace
$0.27 4-bit
20.8 GB
~35 tok/s $2.14
1× L4 24GB Vast.ai
marketplace
$0.32 4-bit
20.8 GB
~11 tok/s $7.90

*For one conversation at a time. Serving many users at once (batching, e.g. with vLLM) cuts the cost per token by 10× or more, which is how API providers get so cheap. Rental prices checked 2026-12-04. All GPU prices →

On your own machine

Free after the hardware. See the table above for which GPUs and Macs can run it, or check your exact machine. Easiest apps: Ollama and LM Studio.

Memory by quality level

FileQualityWeights+ 8K contextTotal
Q3_K_MNoticeably worse 15.3 GB 0.7 GB 17.0 GB
Q4_K_MGood — the usual pick 19.0 GB 0.7 GB 20.8 GB
Q5_K_MVery close to full 22.3 GB 0.7 GB 24.2 GB
Q6_KNear lossless 25.8 GB 0.7 GB 27.9 GB
Q8_0Practically lossless 33.3 GB 0.7 GB 35.5 GB
FP16Full precision 62.6 GB 0.7 GB 65.7 GB

Test answers

Gemma 4 31B is queued for our test suite. See tested models →

Similar models