---
title: "Gemma 4 31B on Pydantic AI Combined"
description: "The mean of the six Pydantic AI benchmarks; code mode is compared over the four that have a code mode run. Tool calling 29.7%, code mode 22% over four benchmarks; rank 43 of 44."
canonical: https://pydantic.dev/models/list/gemma-4-31b-it/pydantic_ai/
---

# Gemma 4 31B on Pydantic AI Combined

> The mean of the six Pydantic AI benchmarks; code mode is compared over the four that have a code mode run. Tool calling 29.7%, code mode 22% over four benchmarks; rank 43 of 44.
>
> Markdown copy of https://pydantic.dev/models/list/gemma-4-31b-it/pydantic_ai/. Index for agents: https://pydantic.dev/models/llms.txt

**Agents: use the API for model information.** It answers a question in one request, where the pages need several.

- Choose a model for an agent: `POST https://pydantic.dev/models/api/select` with a JSON body such as `{"description": "what the agent does"}`. It returns up to five ranked models with reasons. Format: https://pydantic.dev/models/select.md
- Search models by name: `GET https://pydantic.dev/models/api/search?query=<text>`
- List, filter and sort models: `GET https://pydantic.dev/models/api/models`, for example `?weights=open&max_price=2&sort=efficiency`
- One model in full: `GET https://pydantic.dev/models/api/models/<slug>`
- Any other question about the models: `GET https://pydantic.dev/models/api/ask?query=<question>`

Add `intent=<intent>&stack=<stack>&harness=<harness>` to the query string of all but the single model. An `OPTIONS` request to any endpoint returns its schema. The same five are tools of the MCP server at `https://pydantic.dev/models/mcp`. More: https://pydantic.dev/models/usage.md

About the benchmark: https://pydantic.dev/models/benchmarks/pydantic_ai.md. The model's page: https://pydantic.dev/models/list/gemma-4-31b-it.md

## Scores

Cost is the mean cost of one task. Code mode is compared with tool calling over the four benchmarks run in both modes (https://pydantic.dev/models/codemode.md).

|                                      | Tool calling | Code mode |
| ------------------------------------ | ------------ | --------- |
| Score, all six benchmarks            | 29.7%        | –         |
| Score, the four with a code mode run | 22%          | 22%       |
| Cost per task, all six               | $0.023       | –         |
| Cost per task, the four              | $0.033       | $0.020    |

## Each benchmark

| Benchmark                                                                                      | Tool calling | Code mode | Change | Cost per task | Cost per task, code mode | Rank     | Runs                                                                 |
| ---------------------------------------------------------------------------------------------- | ------------ | --------- | ------ | ------------- | ------------------------ | -------- | -------------------------------------------------------------------- |
| [Pydantic AI - Billing ops](https://pydantic.dev/models/benchmarks/billing_ops.md)             | 20%          | 20%       | ±0     | $0.10         | $0.021                   | 44 of 44 | https://pydantic.dev/models/list/gemma-4-31b-it/billing_ops.md       |
| [Pydantic AI - Customer support](https://pydantic.dev/models/benchmarks/customer_support.md)   | 20%          | 20%       | ±0     | $0.0055       | $0.0012                  | 38 of 44 | https://pydantic.dev/models/list/gemma-4-31b-it/customer_support.md  |
| [Pydantic AI - SQL data analysis](https://pydantic.dev/models/benchmarks/sql_data_analysis.md) | 0%           | 0%        | ±0     | $0.017        | $0.048                   | 38 of 44 | https://pydantic.dev/models/list/gemma-4-31b-it/sql_data_analysis.md |
| [Pydantic AI - Research & deck](https://pydantic.dev/models/benchmarks/research_deck.md)       | 48.1%        | 48.1%     | ±0     | $0.0085       | $0.010                   | 41 of 44 | https://pydantic.dev/models/list/gemma-4-31b-it/research_deck.md     |
| [Pydantic AI - Structured output](https://pydantic.dev/models/benchmarks/structured_output.md) | 0%           | –         | –      | $0.0044       | –                        | 44 of 44 | https://pydantic.dev/models/list/gemma-4-31b-it/structured_output.md |
| [Pydantic AI - LLM Judge](https://pydantic.dev/models/benchmarks/llm_judge.md)                 | 90%          | –         | –      | $0.0004       | –                        | 2 of 44  | https://pydantic.dev/models/list/gemma-4-31b-it/llm_judge.md         |

## How it did on the Pydantic AI benchmarks

Written by an LLM from reviews of every run.

#### Overall
Gemma-4-31B is cheap and fast per run, but it rarely completes multi-step data tasks correctly in either mode. It scored 90% on LLM Judge, 48% on Research & deck, 20% on Billing ops, and 0% on Structured output and SQL data analysis. Its common failure is a confident answer built on incomplete work: guessed keys, omitted fields, made-up IDs or placeholder values. It never goes back to verify.

#### Strengths
- In LLM Judge it passed 9 of 10 cases with one `final_result` call each (about $0.0004), with no format errors and reasons that quote specific details such as invoice IDs.
- In Structured output the subtotals it did report (net assets, PBT, PAT, reserves) were almost always correct, including signs and £000 scaling, and it separated group from parent figures correctly.
- In Billing ops single lookups like `get_invoice` passed in 2 requests, and the correction case made the right sequence of `update_attendance`, `void_invoice` and `create_invoice` calls.
- In Research & deck it called `ask_founder` early, recovered from SQL binder errors by querying `information_schema.columns`, and passed `check_deck` on the first try.

#### Weaknesses
- In Structured output it left line items (cash, debtors, tangible assets) null in all 8 answered cases, and it passed the creditors check with an empty list or invented lines.
- In Billing ops it made unasked-for writes on read-only questions (`record_payment`, `void_invoice` with invented IDs) and once reported a payment that never ran.
- In SQL data analysis it wrote no SVG in any of 20 runs and submitted placeholder or fabricated legs, including an arrival after the stated deadline.
- In Research & deck it never viewed the logo or images it placed, and it added claims the data room does not support, such as an invented parking statistic.
- In LLM Judge its one failure accepted a survey share as market evidence, against the handbook's 'answer yes only when clearly' rule.

#### Tool calling compared with code mode
- In Billing ops both modes scored 20%, but tool calling failed noisily, repeating the same search until it hit the 60-request limit or overflowed the context, at up to $0.33 per run.
- In Billing ops code mode was cheaper and usually finished in 2–15 requests, but it failed silently by guessing response keys behind `.get(..., [])` and returning 0 or `[]`.
- In SQL data analysis both modes scored 0%; code mode cost about $0.48 in total against $0.17 for tool calling, and it assumed non-existent GTFS files and ran into syntax and type-check retry limits.
- In Research & deck both modes scored 48%, with tool mode querying the founder-specified metrics correctly while code mode picked its own metrics and misread `fleet_units`.
