---
title: "Gemini 4 Neon 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-neon/structured_output/
---

# Gemini 4 Neon 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-neon/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-neon/pydantic_ai.md

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

Each task was run once per mode.

## Review

Written by an LLM from the runs' transcripts.

#### Overall

10 of 10 cases passed, all in tool-calling mode, and every one in a single request: the model read the accounts text and made one `accounts` call that was accepted without a retry. No check ever failed, so the handbook's "go back to the accounts" path was never exercised. Cost ran from $0.107 to $0.213 per case (about $1.45 in total), highest on the two tier-5 "whole set" cases.

#### Where it does well

- **Scaling**: the three £000 sets (`tier1-07054261`, `tier1-11022760`, `tier2-SC121467`) were multiplied by 1,000 throughout.
- **Signs**: deficits were negative and costs positive in every case. This includes tax credits (`tax` -138000, -571000, -51830) and a parent whose `net_assets` flips from +783514 to -1632236.
- **Group against parent**: in all six tier 3–5 cases the two sets of figures stayed separate, even where they differ by a few pounds (`intangible_assets` 14896135 against 14896091; creditors `other` 103090 against 102990).
- **Creditor notes**: lines were mapped to the right category and `due` band in all four cases with notes, and nil rows kept their prior amounts.
- **Nulls**: group `fixed_assets` was left `null` in `tier5-NI037684`, where the group balance sheet shows no such line.

#### Mistakes it makes

None of these cost a pass; all sit in fields the checks did not cover.

- **0 against `null`**: in 3 cases it returned 0 where expected has no value (parent prior `investments` in `tier5-NI037684`; parent `trade_creditors` `prior_amount` and `creditors_after_one_year` in `tier5-12026946`; group `creditors_after_one_year` in `tier2-SC121467`).
- **Omitted zero rows**: `tier4-05840865` left out two creditor rows that expected carries as 0/0.
- **Inconsistent shape**: in both tier-5 cases the absent parent staff note came back as an object of four `null`s for the current year and plain `null` for the prior year.
- **Unverified extras**: `tier1-11022760` returned `turnover`, `cost_of_sales`, `gross_profit` and `operating_profit`, which the expected set does not include.

#### Tool calling compared with code mode

The benchmark ran in tool-calling mode only, so there is no comparison to make.

## Runs

### tier1-07054261

**Tool calling: passed.** Read the Cube Logic accounts (presented in £000) and returned everything in a single `accounts` tool call; passed on the first request. ($0.15, 1 requests, 51 s)
- Right: Scaled every £000 figure by 1,000 (e.g. `creditors_within_one_year` 20446000)
- Right: Signed the deficits correctly: `net_assets` -6187000, `profit_and_loss_reserve` -8457000, `operating_profit` -940000
- Right: Returned the prior-year tax credit as `tax` -138000 and the current nil tax as 0, not `null`
- Right: Company details right: `accounts_type` full, `audited` true, `consolidated` false, both periods

### tier1-11022760

**Tool calling: passed.** Extracted the TaskUs Limited balance sheet and P&L (in £000) in one `accounts` call; passed on the first request. ($0.12, 1 requests, 42 s)
- Right: Negative net figures handled: `net_current_assets` -36631000, `net_assets` -20029000, prior `profit_before_tax` -1230000
- Right: `called_up_share_capital` returned as 0 (shown as nil in £000) rather than `null`
- Right: `interest_payable` 1307000 and `creditors_after_one_year` 104000 kept positive
- Mistake: Also returned `turnover` 32402000, `cost_of_sales` 26177000, `gross_profit` 6225000 and `operating_profit` 2351000 (and prior equivalents); none of these are in the expected set, so they were not checked and cannot be confirmed from the result

### tier2-11600506

**Tool calling: passed.** Returned the Furat Acquisitions group balance sheet and P&L for both periods in one `accounts` call; passed first time. ($0.11, 1 requests, 31 s)
- Right: Used the consolidated figures, not the company balance sheet
- Right: Net liabilities signed correctly: `net_assets` -2896388, `total_assets_less_current_liabilities` -857995 against prior +1430307
- Right: `other_operating_income` 50000 / 16667 and small `interest_receivable` 91 picked up exactly

### tier2-SC121467

**Tool calling: passed.** Returned the Franke UK Holding group balance sheet and P&L (in £000) in one `accounts` call; passed first time. ($0.13, 1 requests, 43 s)
- Right: £000 scaling applied throughout
- Right: Prior-year loss and tax credit signed correctly: `profit_before_tax` -1678000, `tax` -571000, `profit_after_tax` -1107000
- Right: `profit_and_loss_reserve` -1296000 negative while `shareholders_funds` 8263000 positive
- Mistake: Returned current `creditors_after_one_year` as 0 (prior 4300000); the field is not in the expected set, so whether 0 or `null` was right was not checked

### tier3-05959188

**Tool calling: passed.** Returned both the group and the parent company balance sheets for both periods in one `accounts` call; passed first time. ($0.14, 1 requests, 31 s)
- Right: Kept group and parent columns apart where they are close: `intangible_assets` prior 14896135 (group) against 14896091 (parent)
- Right: All four deficits signed: group `net_assets` -13564855, parent -15485891, and both priors
- Right: Parent-only `investments` 2467 / 2446 returned, group `investments` left `null`

### tier3-09727592

**Tool calling: passed.** Returned the Tyk Technologies group and parent balance sheets for both periods in one `accounts` call; passed first time. ($0.14, 1 requests, 43 s)
- Right: Handled the sign flip in the parent: `net_assets` -1632236 current against +783514 prior
- Right: Parent prior `investments` given as 0, matching expected
- Right: Share capital change 250 to 252 and `share_premium` 28153530 to 28167129 read exactly

### tier4-05840865

**Tool calling: passed.** Returned staff costs and the creditors notes for group and parent in one `accounts` call; passed first time. ($0.12, 1 requests, 36 s)
- Right: Creditor lines mapped to the right categories and `due` bands, including parent `finance_leases` split 11658 within and 28174 after one year
- Right: Zero rows kept as rows: group `bank_loans_and_overdrafts` amount 0 with `prior_amount` 10251
- Right: Parent and group staff costs kept separate (`total` 174680 against 5370606)
- Mistake: Omitted rows that expected carries as 0/0: group `amounts_owed_to_group` within one year and parent `bank_loans_and_overdrafts` within one year. The check still passed, so a missing row appears to count as zero

### tier4-NI626135

**Tool calling: passed.** Returned staff costs and the creditors notes for Diamond Trucks group and parent in one `accounts` call; passed first time. ($0.13, 1 requests, 39 s)
- Right: All ten creditor rows per entity returned, including `bank_loans_and_overdrafts` after one year at 0 with `prior_amount` 5836
- Right: Group and parent `amounts_owed_to_group` kept distinct: 3668476 against 10067741
- Right: Totals `creditors_within_one_year` 15752489 (group) and 17897307 (parent) taken from the right columns

### tier5-12026946

**Tool calling: passed.** Returned the whole Cambium Group set (company details, directors, group and parent balance sheets, group P&L, staff costs, creditors) in one `accounts` call; passed first time. Costliest case at $0.2133. ($0.21, 1 requests, 83 s)
- Right: All four directors listed
- Right: Group P&L losses signed, with the tax charge 72816 positive and the prior credit -51830 negative
- Right: Parent creditor rows sum to the stated `creditors_within_one_year` 13117421
- Mistake: Parent `trade_creditors` `prior_amount` given as 0 and parent `creditors_after_one_year` as 0; expected has no value for either, so these were not checked
- Mistake: Parent `staff_costs` returned as an object of four `null`s while `prior_staff_costs` is `null`: inconsistent shape for the same absent note

### tier5-NI037684

**Tool calling: passed.** Returned the whole John Mulholland Motors set for group and parent in one `accounts` call; passed first time. ($0.20, 1 requests, 75 s)
- Right: `accounts_type` identified as `medium`
- Right: Group `fixed_assets` left `null` because the group balance sheet shows only tangible assets, as expected; parent `fixed_assets` 3599359 with `investments` 300
- Right: `amounts_owed_to_directors` 18372 / 5938 placed in its own category
- Right: Near-identical group and parent creditor lines kept apart (`other` prior 103090 against 102990)
- Mistake: Parent prior `investments` returned as 0; expected has no value for it, so it was not checked
- Mistake: Parent `staff_costs` returned as an object of four `null`s while `prior_staff_costs` is `null`
