---
title: "Gemini 4 Carbon 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 83.5%, code mode 82.2% over four benchmarks; rank 7 of 44."
canonical: https://pydantic.dev/models/list/gemini-4-carbon/pydantic_ai/
---

# Gemini 4 Carbon 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 83.5%, code mode 82.2% over four benchmarks; rank 7 of 44.
>
> Markdown copy of https://pydantic.dev/models/list/gemini-4-carbon/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/gemini-4-carbon.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            | 83.5%        | –         |
| Score, the four with a code mode run | 87.8%        | 82.2%     |
| Cost per task, all six               | $0.58        | –         |
| Cost per task, the four              | $0.83        | $0.53     |

## 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)             | 100%         | 100%      | ±0     | $1.10         | $0.12                    | 1 of 44  | https://pydantic.dev/models/list/gemini-4-carbon/billing_ops.md       |
| [Pydantic AI - Customer support](https://pydantic.dev/models/benchmarks/customer_support.md)   | 60%          | 40%       | −20    | $0.18         | $0.24                    | 3 of 44  | https://pydantic.dev/models/list/gemini-4-carbon/customer_support.md  |
| [Pydantic AI - SQL data analysis](https://pydantic.dev/models/benchmarks/sql_data_analysis.md) | 100%         | 100%      | ±0     | $0.73         | $0.65                    | 1 of 44  | https://pydantic.dev/models/list/gemini-4-carbon/sql_data_analysis.md |
| [Pydantic AI - Research & deck](https://pydantic.dev/models/benchmarks/research_deck.md)       | 91.1%        | 88.9%     | −2.2   | $1.32         | $1.14                    | 7 of 44  | https://pydantic.dev/models/list/gemini-4-carbon/research_deck.md     |
| [Pydantic AI - Structured output](https://pydantic.dev/models/benchmarks/structured_output.md) | 100%         | –         | –      | $0.082        | –                        | 1 of 44  | https://pydantic.dev/models/list/gemini-4-carbon/structured_output.md |
| [Pydantic AI - LLM Judge](https://pydantic.dev/models/benchmarks/llm_judge.md)                 | 50%          | –         | –      | $0.047        | –                        | 32 of 44 | https://pydantic.dev/models/list/gemini-4-carbon/llm_judge.md         |

## How it did on the Pydantic AI benchmarks

Written by an LLM from reviews of every run.

#### Overall
The model passed every run on Billing ops, Structured output and SQL data analysis, scored 91% (tools) and 89% (code mode) on Research & deck, and 50% on LLM Judge. Its answers were accurate on rule-heavy calculations, unit and sign handling, and exhaustive search, with no provider-side format failures in single-request tasks. Its main costs were brute-force data pulling in tool-calling mode, very large single-shot writes, and repeated small query and sandbox errors. As a judge it leaned one way, toward over-strict "no" verdicts.

#### Strengths
- On Billing ops it got all 16 wrong-invoice amounts right in both modes, including half-up rounding cases, and carried out multi-step write sequences (update, void, re-create; oldest-first payment allocation) correctly.
- On Structured output it passed all 10 cases in a single request each, correctly scaling £000 figures, keeping signs consistent, and separating group from parent figures that differed by small amounts.
- On SQL data analysis it handled service-day bitmasks, interpolation, after-midnight service and walk rules in every run, and evaluated all 120 and all 24 orders in the tour cases.
- On Research & deck it batched research reads in parallel, recomputed figures before writing, and in code mode flagged a conflict between a case study and the orders table.
- On LLM Judge its reasons quoted specific evidence such as invoice ids, card endings and slide numbers, and it cross-checked claims against account JSON.

#### Weaknesses
- On LLM Judge all 5 failures were over-strict "no" verdicts, including treating unsupported or polite statements as contradictions and adding requirements not in the question.
- On Research & deck in tool mode it wrote a 74,324-character file in one call taking 487 s, then started re-sending the whole file and hit the 1200 s limit.
- On Billing ops in tools mode it pulled nearly all records into context for large audits, for example 1.36 MB and $4.48 on large wrong_invoices.
- On SQL data analysis it left the reserved column `at` unquoted in 19 of 20 runs, and spent 3 to 15 extra requests re-checking answers it already had.
- On Structured output it was inconsistent on unscored fields, writing 0 where a dash appeared on one side only and using mixed shapes for empty objects.

#### Tool calling compared with code mode
- On Billing ops both modes scored 100%, but code mode cut total cost from about $11.03 to $1.15 by filtering in Python, for example missed_billed fell from $3.69 to $0.12.
- On Research & deck code mode passed and tool mode timed out, because code mode built the deck from templates and patched it with string replacement instead of re-emitting full HTML as a tool argument.
- On SQL data analysis code mode used 13% fewer requests and cost 11% less, with the largest gains on timed_tour (40 to 26 requests), though one_change got worse (21 to 29 requests).
- Across Billing ops small cases and SQL data analysis, code mode sometimes added requests and introduced errors tool calling did not hit, such as `KeyError` on error dicts, sandbox limits and a 30-second time-out.
- Only tool-calling runs exist for Structured output and LLM Judge, so those benchmarks give no basis for comparing the modes.
