---
title: "Gemini 4 Carbon on Pydantic AI - Structured output"
description: "Extracting UK company accounts into a nested Pydantic model, checked against the filer's tags. Tool calling 100%; rank 1 of 44."
canonical: https://pydantic.dev/models/list/gemini-4-carbon/structured_output/
---

# Gemini 4 Carbon on Pydantic AI - Structured output

> Extracting UK company accounts into a nested Pydantic model, checked against the filer's tags. Tool calling 100%; rank 1 of 44.
>
> Markdown copy of https://pydantic.dev/models/list/gemini-4-carbon/structured_output/. 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/structured_output.md. The model on every Pydantic AI benchmark: https://pydantic.dev/models/list/gemini-4-carbon/pydantic_ai.md

| Mode         | Score | Tasks passed | Cost  | Requests | Tool calls | Time    |
| ------------ | ----- | ------------ | ----- | -------- | ---------- | ------- |
| Tool calling | 100%  | 10 of 10     | $0.82 | 10       | 10         | 9.5 min |

Each task was run once per mode.

## Review

Written by an LLM from the runs' transcripts.

#### Overall

`gemini-4-carbon` passed all 10 cases in tool-calling mode, each in a single request: the conversation is always the accounts text, one `accounts` call, and `Final result processed.` There were no retries, no failed checks and no provider errors. Cost ran from $0.0601 (`tier2-11600506`) to $0.1031 (`tier5-12026946`), about $0.82 in total.

#### Where it does well

- **Units.** The three £000 cases (`tier1-07054261`, `tier1-11022760`, `tier2-SC121467`) were all multiplied by 1,000 with no slips.
- **Signs.** Deficits and losses are negative, costs and creditors positive. It read the mixed line `Tax (charge)/credit on loss | (312) | (632)` as two charges, and returned real credits as negative (`tax` -138000, -571000, -51830).
- **Group against parent.** In the six cases that ask for both, figures that differ by small amounts stayed in the right column, e.g. `intangible_assets` 14896135 against 14896091 in `tier3-05959188`, and `other` prior 103090 against 102990 in `tier5-NI037684`.
- **Nil against absent.** Dashes on shown lines became 0 (`called_up_share_capital` in `tier1-11022760`, prior `investments` in `tier3-09727592`), and lines not shown became `null`. It did not put TaskUs's `Equity reserve` into `share_premium`.
- **Large outputs.** The two tier-5 cases, each with roughly 150 scored fields, were correct in one call.

#### Mistakes it makes

None cost a pass. The blemishes are all on fields the benchmark did not score:

- **Zero where the accounts show a dash on one side only.** In `tier5-12026946` the parent `trade_creditors` row has `prior_amount: 0` for `31,943 | –`, and the parent gets `creditors_after_one_year: 0` plus a zero-amount `finance_leases` row. `tier2-SC121467` has `creditors_after_one_year: 0` for the current year.
- **Inconsistent empty shape.** In both tier-5 cases the parent `staff_costs` is an object of four nulls while `prior_staff_costs` is a bare `null`.
- **Omitted zero rows.** In `tier4-05840865` the group `amounts_owed_to_group` rows (expected 0 / 0) were left out; the scorer accepted this.

Because every case passed first time, the handbook's instruction on what to do after a failed check was never exercised. This run says nothing about how the model recovers from a validation error.

#### Tool calling compared with code mode

Only tool-calling runs exist for this benchmark, so there is no comparison to make.

## Runs

### tier1-07054261

**Tool calling: passed.** Read the Cube Logic accounts (in £000) and returned everything in a single `accounts` call on the first request; all scored fields matched. ($0.088, 1 requests, 56 s)
- Right: Scaled every £000 figure by 1,000, e.g. `turnover` 16382000 and `creditors_within_one_year` 20446000.
- Right: Signs followed the handbook: `net_current_assets` -8967000, `profit_and_loss_reserve` -8457000, prior `tax` -138000 as a credit, while costs stayed positive.
- Right: Returned `tax: 0` and prior `interest_receivable: 0` for lines shown as nil, and `null` for `stocks`, `provisions` and `creditors_after_one_year`.
- Right: One request, $0.0884.

### tier1-11022760

**Tool calling: passed.** Extracted the TaskUs company details, balance sheet and profit and loss for both years in one `accounts` call; passed. ($0.070, 1 requests, 52 s)
- Right: Converted £'000 to pounds throughout, e.g. `investments` 16705000 and `creditors_within_one_year` 50167000.
- Right: Handled the mixed-sign tax line `Tax (charge)/credit on loss | (312) | (632)` as charges of 312000 and 632000, both positive.
- Right: Mapped `Called up share capital | - | -` to 0 and prior `Other operating income | -` to 0.
- Right: Left `share_premium` null rather than putting the `Equity reserve` (167/444) there.
- Right: Also filled `turnover` 32402000, `cost_of_sales` 26177000, `gross_profit` 6225000 and `operating_profit` 2351000, which match the statement of comprehensive income but are not in the scored set.

### tier2-11600506

**Tool calling: passed.** Returned the Furat Acquisitions group balance sheet and profit and loss for both periods in one `accounts` call; passed. ($0.060, 1 requests, 36 s)
- Right: All 40 scored group fields matched, including negative `net_assets` -2896388 and `profit_and_loss_reserve` -2896788.
- Right: Kept `total_assets_less_current_liabilities` sign per period: -857995 current, 1430307 prior.
- Right: Returned only the `group` block, as the question asked, with no parent figures mixed in.
- Right: One request, $0.0601, the cheapest case.

### tier2-SC121467

**Tool calling: passed.** Returned the Franke UK Holding group balance sheet and profit and loss (in £000) for both periods in one `accounts` call; passed. ($0.091, 1 requests, 89 s)
- Right: Scaled £000 to pounds, e.g. `called_up_share_capital` 9559000 and `cost_of_sales` 21162000.
- Right: Prior-year loss signs correct: `profit_before_tax` -1678000, `tax` -571000 as a credit, `profit_after_tax` -1107000.
- Right: `profit_and_loss_reserve` negative in both years (-1296000, -1176000) while `shareholders_funds` stayed positive.
- Mistake: In the single `accounts` call it gave current-year `creditors_after_one_year` as 0 against 4300000 prior; the field is not in the scored set, so whether the accounts show a nil or no line was not checked by the benchmark.

### tier3-05959188

**Tool calling: passed.** Returned the Tribe Payments group and parent company balance sheets for both periods in one `accounts` call; passed. ($0.083, 1 requests, 43 s)
- Right: Kept group and parent figures apart where they are close: `intangible_assets` 14896135 (group prior) against 14896091 (parent prior), `cash` 1720386 against 1675323.
- Right: Parent-only `investments` 2467 and 2446 returned for the parent, `null` for the group.
- Right: Deficits negative in all four balance sheets, e.g. parent `net_assets` -15485891.
- Right: One request, $0.0827.

### tier3-09727592

**Tool calling: passed.** Returned the Tyk Technologies group and parent balance sheets for both periods (year to 31 January 2026) in one `accounts` call; passed. ($0.075, 1 requests, 46 s)
- Right: Caught the sign change in parent `net_assets`: -1632236 current, 783514 prior.
- Right: Returned parent prior `investments` as 0, matching the expected nil line, with 40275 current.
- Right: Share capital change picked up: 252 current, 250 prior, in both group and parent.
- Right: One request, $0.0752.

### tier4-05840865

**Tool calling: passed.** Returned the Drishaun Holdings staff costs and creditors notes for group and parent in one `accounts` call; passed. ($0.074, 1 requests, 48 s)
- Right: Split creditors rows by category and `due`, e.g. parent `finance_leases` 11658 within one year and 28174 after one year.
- Right: Gave explicit 0 for group `bank_loans_and_overdrafts` current against 10251 prior.
- Right: Staff cost totals reconcile with their parts: group 4716869 + 448675 + 205062 = 5370606.
- Right: Parent `amounts_owed_to_group` 1538825 / 1524980 kept out of the group list.
- Mistake: Did not emit group `amounts_owed_to_group` rows, which the expected set lists as 0 / 0; the scorer accepted the omission, so this cost nothing.

### tier4-NI626135

**Tool calling: passed.** Returned the Diamond Trucks staff costs and creditors notes for group and parent in one `accounts` call; passed. ($0.077, 1 requests, 60 s)
- Right: Ten creditor rows each for group and parent, all matching, including `bank_loans_and_overdrafts` after one year 0 current / 5836 prior.
- Right: Group and parent `amounts_owed_to_group` kept distinct: 3668476 against 10067741.
- Right: `creditors_after_one_year` totals 689258 (group) and 686105 (parent) agree with the finance lease rows.
- Right: One request, $0.0769.

### tier5-12026946

**Tool calling: passed.** Returned the whole Cambium Group set (company details, directors, group and parent balance sheets, group profit and loss, staff costs, creditors) in one `accounts` call; passed. ($0.10, 1 requests, 70 s)
- Right: About 150 scored fields matched in one request, the most expensive case at $0.1031.
- Right: Listed all four directors, including `Mr R Thompson` who resigned 13 August 2025.
- Right: Group `tax` signs correct: 72816 charge current, -51830 credit prior.
- Right: Parent and group both carry the same bank loan 6841641 / 9729304, and parent-only `amounts_owed_to_group` 6050000 / 5550000.
- Mistake: Parent `trade_creditors` row has `prior_amount: 0` where note 19 shows a dash (`31,943 | –`); the expected set has no prior value for that row, so it was not scored.
- Mistake: Parent `staff_costs` returned as an object of four nulls while `prior_staff_costs` was a bare `null`: inconsistent shape for the same absent note.
- Mistake: Parent `creditors_after_one_year: 0` and a `finance_leases` after-one-year row with `amount: 0` were given for the current year, where the expected set has no such line.

### tier5-NI037684

**Tool calling: passed.** Returned the whole John Mulholland Motors set for group and parent in one `accounts` call; passed. ($0.095, 1 requests, 70 s)
- Right: `accounts_type` returned as `medium`, not `full`, matching the expected value.
- Right: Group `fixed_assets` left `null` where the group balance sheet shows only tangible assets (4122359), while parent `fixed_assets` 3599359 includes `investments` 300.
- Right: Group and parent creditors kept apart on near-identical rows: `other` prior 103090 against 102990, `other_tax_and_social_security` prior 273134 against 277314.
- Right: `amounts_owed_to_directors` 18372 / 5938 categorised separately rather than folded into `other`.
- Mistake: Parent `staff_costs` returned as an object of four nulls while `prior_staff_costs` was a bare `null`, the same inconsistency as in `tier5-12026946`.
