Gemma 4 31B vs phi-4

At a Glance

Compare
Gemma 4 31BGoogle DeepMind
phi-4Microsoft
Pricing and Limits
Input priceFrom · USD / 1M tokens$0.090Openrouter · Sep 23, 2026$0.070Deepinfra · Sep 23, 2026
Output priceFrom · USD / 1M tokens$0.34Openrouter · Sep 23, 2026$0.14Deepinfra · Sep 23, 2026
Context windowMaximum documented tokens262K16K
Model facts checkedSep 3, 2026View model evidence →Aug 28, 2026View model evidence →

Token prices are the lowest available sourced USD rates; input and output may use different providers. Cost ranking estimates output spend on LiveBench, not a full request bill. Ranking methodology →

Available Benchmarks

All benchmark results →
BenchmarkGemma 4 31Bphi-4
LMArena Text Arenatext-2026-09-13-d25aabda0010 · arena_rating · leader1,441.68100% of row best · rating · gemma-4-31b; 95% CI [1434.13929794, 1449.22204224]; votes 5894; rank 641,216.6084% of row best · rating · phi-4; 95% CI [1212.02298793, 1221.18318193]; votes 24126; rank 300
Overall ResultCounted from the protocol-matched rows above1 benchmark winNo overall winner0 benchmark winsNo overall winner

Third-party benchmark Only like-for-like primary-publisher results are shown; raw scores, relative scores, configuration, and token spend remain visible.

Side-by-Side Facts

FieldGemma 4 31Bphi-4
DeveloperGoogle DeepMindMicrosoft
FamilyGemma 4Phi 4
ModelGemma 4 31Bphi-4
VersionGemma 4 31Bphi-4
Lifecycleactiveactive
Released2026-03-112024-12-12
Knowledge cutoffUnknownUnknown
Input modalitiesText, ImageText
Output modalitiesTextText
Context window262K16K
Total parameters31B14.7B
Active parametersUnknownUnknown
Licenseapache-2.0mit
Open weightsYesYes
API availableYesYes
Self-hostableYesYes
Provider accessCerebras (Standard), Deepinfra (Standard), Google Gemini (Standard), Openrouter (Standard), Together Ai (Standard)Deepinfra (Standard), Hugging Face (Standard), Openrouter (Standard)
Capabilitieschat, generation, reasoning, structured_outputs, toolschat, generation

Gemma 4 31B Capabilities

chatgenerationreasoningstructured outputstools
Serving providers5
Canonical IDgoogle/gemma-4-31B-it

phi-4 Capabilities

chatgeneration
Serving providers3
Canonical IDmicrosoft/phi-4

Primary Evidence

Sources and Freshness

Questions

Gemma 4 31B vs phi-4 FAQs

Is Gemma 4 31B or phi-4 better for coding?+

This comparison does not currently contain a protocol-matched coding benchmark for both Gemma 4 31B and phi-4, so Model Markets cannot name a coding leader from pricing, context size, or capability labels alone.

Which is cheaper, Gemma 4 31B or phi-4?+

Gemma 4 31B is $0.090 and phi-4 is $0.070 per million tokens, so phi-4 is cheaper on this metric. Gemma 4 31B is $0.34 and phi-4 is $0.14 per million tokens, so phi-4 is cheaper on this metric.

Which has a larger context window, Gemma 4 31B or phi-4?+

Gemma 4 31B has the larger sourced context window. Gemma 4 31B supports 262K and phi-4 supports 16K.

Which performs better in benchmarks, Gemma 4 31B or phi-4?+

There is no overall benchmark winner: At least two independently verified, protocol-matched benchmarks are required for an overall winner.

Can Gemma 4 31B or phi-4 be self-hosted?+

Both models have the same recorded self-hosting status: supported. Gemma 4 31B is open weight; phi-4 is open weight.

Can Gemma 4 31B and phi-4 understand images?+

Gemma 4 31B is documented with image input; phi-4 is not documented with image input. This reflects supported input modalities, not vision quality.

Which can generate longer answers, Gemma 4 31B or phi-4?+

Neither has a larger sourced maximum output. Gemma 4 31B is — and phi-4 is —.

Do Gemma 4 31B and phi-4 support reasoning and tool use?+

Gemma 4 31B: reasoning, tool calling, and image input. phi-4: none of these features are definitively sourced. Feature support does not establish relative quality.

Which is available from more inference providers, Gemma 4 31B or phi-4?+

Gemma 4 31B has 5 sourced provider routes; phi-4 has 3, so Gemma 4 31B has broader tracked availability.

Which offers better value, Gemma 4 31B or phi-4?+

There is no universal value winner. Compare the input and output prices above with the matched benchmark result for your workload: cheaper tokens can be offset by different quality, token usage, latency, or provider availability.

Send Feedback