Llama vs Gemma: benchmarks and API costs

Gemma 4 31B leads SciCode at 45.49% versus 21.30%. Gemma 4 31B has the lower illustrated request cost at $0.0018; the other model costs $0.00239.

Updated · 4 sources · Methodology

DimensionWinnerMarginEvidence
SciCode (%)Gemma 4 31B24.19 ppLlama 4 Scout 21.30% / Gemma 4 31B 45.49%12
Output speed (tokens/s)Llama 4 Scout59.5 tokens/sLlama 4 Scout 95.3 / Gemma 4 31B 35.8 tokens/s
AA time to first answer token (s)Llama 4 Scout77.85 sLlama 4 Scout 1.12 s / Gemma 4 31B 78.97 s
Estimated request costGemma 4 31B$0.0005910K + 1K: Llama 4 Scout $0.00239 / Gemma 4 31B $0.0018

AA coding quality benchmarks

MetricLlama 4 ScoutGemma 4 31B (Reasoning)
SciCode (%)21.30145.492

Performance

MetricLlama 4 ScoutGemma 4 31B (Reasoning)
Output speed (tokens/s)95.335.8
AA time to first answer token (s)1.1278.97

Prices and request cost

MetricLlama 4 Scout · Novita AIGemma 4 31B · Novita AI
Input / 1M tokens$0.183$0.144
Output / 1M tokens$0.593$0.44
Context window (tokens)131,0723262,1444
Max output (tokens)131,0723131,0724
API documentationNovita AI · Chat API
Cost example: 10,000 input + 1,000 billed output tokens

Coding, reasoning, context and cost

Coding benchmark

  • AA SciCode: Llama 4 Scout 21.30% / Gemma 4 31B 45.49%.12

Reasoning benchmark

  • The configured AA first-answer wait is 1.12 s for Llama 4 Scout and 78.97 s for Gemma 4 31B.12

Context window (tokens)

  • Gemma is the capacity choice at 262,144 context tokens; Llama’s endpoint stops at 131,072. Both list 131,072 maximum output tokens.12

Estimated request cost

  • The same uncached token quantities cost $0.00239 for Llama 4 Scout and $0.0018 for Gemma 4 31B.12

Methodology and sources

SciCode is AA’s scientific-coding evaluation, reported as a percentage; higher is better. It is separate from the 10,000-input-token performance test and is not an in-editor Cline evaluation. Quality and performance use the configurations shown beside the model names. A current AA v5 Intelligence Index is displayed only where both models have a published value. AA performance uses the 10,000-input-token benchmark at each model’s displayed configuration; reasoning settings vary by model. Output speed is the median output rate. Answer latency measures the first answer token after reasoning, not the initial streamed reasoning chunk. For non-streamed reasoning and non-reasoning models, AA reports the same first-chunk and first-answer event. AA estimates answer latency from initial response and reasoning duration; it is not a separately sampled median. These are reference deployments, not Novita endpoint guarantees. The uncached cost example bills 10,000 input and 1,000 output tokens at each named seller’s tariff; it is not the cost of the AA benchmark. Prices, context and output limits use the cited seller sources.

  1. Artificial Analysis · Llama 4 Scout · quality and performance
  2. Artificial Analysis · Gemma 4 31B (Reasoning) · quality and performance
  3. Novita AI · Llama 4 Scout · endpoint pricing and limits
  4. Novita AI · Gemma 4 31B · endpoint pricing and limits

Build with Novita Model APIs

Create an API key and connect your application.