Price Per TokenPrice Per Token
Google
Google
vs
Microsoft
Microsoft

Gemma 2 9B vs Phi 4

A detailed comparison of pricing, benchmarks, and capabilities

OpenClaw

Best LLMs for OpenClaw Vote for which model works best with OpenClaw

112 out of our 301 tracked models have had a price change in February.

Get our weekly newsletter on pricing changes, new releases, and tools.

Key Takeaways

Gemma 2 9B wins:

  • Cheaper input tokens
  • Cheaper output tokens
  • Higher intelligence benchmark

Phi 4 wins:

  • Larger context window
  • Faster response time
  • Better at coding
  • Better at math
  • Supports tool calls
Price Advantage
Gemma 2 9B
Benchmark Advantage
Phi 4
Context Window
Phi 4
Speed
Phi 4

Pricing Comparison

Price Comparison

MetricGemma 2 9BPhi 4Winner
Input (per 1M tokens)$0.03$0.06 Gemma 2 9B
Output (per 1M tokens)$0.09$0.14 Gemma 2 9B
Using a 3:1 input/output ratio, Gemma 2 9B is 44% cheaper overall.

Gemma 2 9B Providers

Nebius $0.03 (Cheapest)
Novita $0.08

Phi 4 Providers

NextBit $0.06 (Cheapest)
DeepInfra $0.07

Benchmark Comparison

8
Benchmarks Compared
1
Gemma 2 9B Wins
2
Phi 4 Wins

Benchmark Scores

BenchmarkGemma 2 9BPhi 4Winner
Intelligence Index
Overall intelligence score
32.110.5
Coding Index
Code generation & understanding
-11.2-
Math Index
Mathematical reasoning
-18.0-
MMLU Pro
Academic knowledge
31.971.4
GPQA
Graduate-level science
14.857.5
LiveCodeBench
Competitive programming
-23.1-
AIME
Competition math
-14.3-
BBH
Big-Bench Hard
42.1--
Phi 4 significantly outperforms in coding benchmarks.

Cost vs Quality

X-axis:
Y-axis:
Loading chart...
Gemma 2 9B
Other models

Context & Performance

Context Window

Gemma 2 9B
8,192
tokens
Phi 4
16,384
tokens
Max output: 16,384 tokens
Phi 4 has a 50% larger context window.

Speed Performance

MetricGemma 2 9BPhi 4Winner
Tokens/secondN/A6.0 tok/s
Time to First TokenN/A0.79s

Capabilities

Feature Comparison

FeatureGemma 2 9BPhi 4
Vision (Image Input)
Tool/Function Calls
Reasoning Mode
Audio Input
Audio Output
PDF Input
Prompt Caching
Web Search

License & Release

PropertyGemma 2 9BPhi 4
LicenseOpen SourceOpen Source
AuthorGoogleMicrosoft
ReleasedJun 2024Jan 2025

Gemma 2 9B Modalities

Input
text
Output
text

Phi 4 Modalities

Input
text
Output
text

Related Comparisons

Compare Gemma 2 9B with:

Compare Phi 4 with:

Frequently Asked Questions

Gemma 2 9B has cheaper input pricing at $0.03/M tokens. Gemma 2 9B has cheaper output pricing at $0.09/M tokens.
Phi 4 scores higher on coding benchmarks with a score of 11.2, compared to Gemma 2 9B's score of N/A.
Gemma 2 9B has a 8,192 token context window, while Phi 4 has a 16,384 token context window.
Gemma 2 9B does not support vision. Phi 4 does not support vision.