---
title: "DeepSeek V4 Pro 0423 on Pydantic AI - Structured output"
description: "Extracting UK company accounts into a nested Pydantic model, checked against the filer's tags. Tool calling 90%; rank 15 of 44."
canonical: https://pydantic.dev/models/list/deepseek-v4-pro/structured_output/
---

# DeepSeek V4 Pro 0423 on Pydantic AI - Structured output

> Extracting UK company accounts into a nested Pydantic model, checked against the filer's tags. Tool calling 90%; rank 15 of 44.
>
> Markdown copy of https://pydantic.dev/models/list/deepseek-v4-pro/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/deepseek-v4-pro/pydantic_ai.md

| Mode         | Score | Tasks passed | Cost  | Requests | Tool calls | Time     |
| ------------ | ----- | ------------ | ----- | -------- | ---------- | -------- |
| Tool calling | 90%   | 9 of 10      | $0.60 | 13       | 16         | 21.8 min |

Each task was run once per mode.

## Review

Written by an LLM from the runs' transcripts.

#### Overall

9 of 10 cases passed in tool-calling mode (the only mode run), for a total of about $0.60. Every case was answered from the accounts text with a single `accounts` submission; 7 took one request and 3 took two. The one failure, `tier1-11022760`, was not a misread number but a wrong treatment of lines shown as a dash.

#### Where it does well

- **Scaling and signs.** All three £000 cases were multiplied by 1,000 correctly, and bracketed costs, creditors and provisions were returned positive while deficits stayed negative, in all 10 cases.
- **Checking by arithmetic.** In `tier2-SC121467` it spotted an unbracketed tax figure of 571 as a credit by reconciling loss before and after tax. In `tier4-05840865` it kept a nil bank loan line because the prior-year total only reconciled with it.
- **Group versus parent.** All 6 cases with both entities had the right figures in the right place, including restated comparatives.
- **Restraint.** It did not split directors' loans out of `Other creditors`, and did not force associates income into `interest_receivable`.

#### Mistakes it makes

- **Inconsistent dash handling (1 failure).** In `tier1-11022760` it returned `called_up_share_capital: 100` from note 20 where the balance sheet shows `-` (expected `0`), and `null` for prior `other_operating_income` shown as `-` (expected `0`). In three other cases it turned the same kind of dash into `0` and passed. Its reasoning debates this point in almost every case without a fixed rule.
- **Split final calls (3 cases).** In `tier3-05959188`, `tier4-05840865` and `tier4-NI626135` it sent `group` and `parent_company` as two separate `accounts` calls. Both were rejected with `Field required`, and it needed a second request to resend the same data combined.
- **Computed figures.** It summed debtors in `tier1-07054261` and `tier2-SC121467`, and filled group `fixed_assets` in `tier5-NI037684` with no total line shown. None were scored, so these passed by luck of the checks.
- **Very long reasoning.** Single turns ran from 10k to 66k characters, which drives cost on the tier 5 cases ($0.08 to $0.09 each).

## Runs

### tier1-07054261

**Tool calling: passed.** Extracted company details, balance sheet and P&L for Cube Logic Limited from £000 accounts in a single `accounts` call; passed. ($0.063, 1 requests, 2.4 min)
- Right: Multiplied every £000 figure by 1,000 and signed deficits correctly (`net_assets` -6187000, `profit_and_loss_reserve` -8457000).
- Right: Treated the dash on `Tax on loss` for 2025 as `tax: 0`, which matches the expected value.
- Right: Reasoned `accounts_type` to `full` and `consolidated: false` from the consolidation exemption.
- Mistake: Computed `debtors` 9792000 as 134 + 9,658 although no total debtors line is shown, against the 'do not compute' rule; the field is not checked, so it cost nothing.
- Mistake: Roughly 34k characters of reasoning for one call, much of it going back and forth on whether a dash means `0` or `null`.

### tier1-11022760

**Tool calling: failed.** Extracted TaskUs Limited's accounts in one `accounts` call; failed on fields where the accounts show a dash, which it handled two different wrong ways. ($0.057, 1 requests, 2.5 min)
- Right: All £000 balance sheet and P&L figures scaled and signed correctly, including `net_current_assets` -36631000 and `tax` 312000 / 632000 as charges.
- Right: Checked the P&L arithmetic (32,402 - 26,177 = 6,225, etc.) before submitting.
- Mistake: In the single assistant turn it set `called_up_share_capital: 100` for both years, taken from note 20 (`0.10` in £'000), while the balance sheet line shows `-`; expected is `0`. It should have used the balance sheet line as shown.
- Mistake: Set `prior_profit_and_loss.other_operating_income: null` for the line `Other operating income | 7,592 | -`; expected is `0`. The line is shown, so `null` was wrong; it argued the opposite way from its own Cube Logic run, where a dash became `0`.
- Mistake: Returned `name` as `TaskUs Limited` where the cover shows `TASKUS LIMITED` (may or may not be scored).
- Mistake: No check error came back (`Final result processed.`), so it had no chance to correct; it submitted after one request.

### tier2-11600506

**Tool calling: passed.** Returned the group balance sheet and P&L for both periods in one `accounts` call; passed. ($0.034, 1 requests, 47 s)
- Right: Read whole-pound figures without scaling and made costs positive (`cost_of_sales` 25037414, `interest_payable` 215132).
- Right: Took the unlabelled subtotal 5,232,213 as `fixed_assets` and kept `provisions` positive at 346932 despite the bracketed deduction line.
- Right: Signed net liabilities correctly (`net_assets` -2896388, `total_assets_less_current_liabilities` -857995).

### tier2-SC121467

**Tool calling: passed.** Returned the group balance sheet and P&L from £000 accounts in one `accounts` call; passed. ($0.040, 1 requests, 59 s)
- Right: Recognised the unbracketed 2024 `Tax on profit/(loss)` of 571 as a credit by checking (1,678) + 571 = (1,107), and returned `tax: -571000`.
- Right: Scaled £000 figures by 1,000 and kept distribution and administrative costs positive.
- Right: Left the `Bad debt provision` line out rather than forcing it into `other_operating_income`.
- Mistake: Summed debtors due after and within one year (808 + 5,988) to give `debtors` 6796000, a figure the balance sheet does not show as a total; unchecked here.

### tier3-05959188

**Tool calling: passed.** Extracted group and parent balance sheets correctly but first sent them as two separate `accounts` calls, both rejected; a second request with one combined call passed. ($0.051, 2 requests, 63 s)
- Right: All group and parent figures correct on first reading, including the restated 2024 parent column and negative reserves (`profit_and_loss_reserve` -27745666).
- Right: Recovered immediately from the validation error by merging the two payloads unchanged.
- Mistake: First turn made two parallel `accounts` calls, one with only `group` and one with only `parent_company`; each returned `Field required`. The schema needs both keys in one call, which cost an extra request.

### tier3-09727592

**Tool calling: passed.** Returned group and parent balance sheets for both periods in one `accounts` call; passed. ($0.053, 1 requests, 2.1 min)
- Right: Set parent prior `investments` to `0` for the line `Investments | 40,275 | -`, matching expected.
- Right: Left `intangible_assets` as `null` because the balance sheet face has no such line, even though note 9 shows a nil carrying amount.
- Right: Kept `provisions` positive at 5889 and net liabilities negative (`net_assets` -3674263).
- Mistake: About 29k characters of reasoning for a two-balance-sheet task, largely spent on the dash-versus-null question.

### tier4-05840865

**Tool calling: passed.** Extracted staff costs and creditors notes for group and parent; the first turn split them across two `accounts` calls that were rejected, and the combined retry passed. ($0.078, 2 requests, 2.6 min)
- Right: Included `bank_loans_and_overdrafts` within one year as `amount: 0`, `prior_amount: 10251` after confirming the prior total 3,668,562 only reconciles with that line.
- Right: Did not split the directors' loan of 48,817 out of `Other creditors`, avoiding a computed figure and double counting.
- Right: Mapped all note lines to the right categories and due dates for both entities.
- Mistake: First turn sent `group` and `parent_company` as two separate `accounts` calls; both failed with `Field required`, costing a second request.

### tier4-NI626135

**Tool calling: passed.** Extracted staff costs and creditors notes for group and parent; two split `accounts` calls were rejected, then one combined call passed. ($0.048, 2 requests, 65 s)
- Right: All eight within-one-year categories and both after-one-year lines correct for group and company.
- Right: Included `bank_loans_and_overdrafts` after one year as `0` with `prior_amount` 5836, as expected.
- Right: Did not invent an `amounts_owed_to_directors` line from the narrative mentioning directors.
- Mistake: First turn again made two parallel `accounts` calls with one top-level key each; both returned `Field required` and a second request was needed.

### tier5-12026946

**Tool calling: passed.** Returned the full set (company, directors, group and parent statements, staff costs, creditors) for The Cambium Group UK Holdings in one `accounts` call; passed. ($0.093, 1 requests, 4.3 min)
- Right: Listed all four directors, including the one who resigned during the period.
- Right: Kept `Income from interests in associates` out of `interest_receivable` (374360) and used the stated loss before tax -4801087 rather than recomputing it.
- Right: Group and parent creditors lines all matched, including the shared bank loan 6841641.
- Mistake: About 66k characters of reasoning for one call, the most expensive case at $0.0928, with long deliberation over whether dashes are `0` or `null`.

### tier5-NI037684

**Tool calling: passed.** Returned the full set for John Mulholland Motors Limited in one `accounts` call; passed. ($0.081, 1 requests, 3.8 min)
- Right: Identified `accounts_type` as `medium` from the medium companies regime statement.
- Right: Mapped `amounts_owed_to_directors` 18372 / 5938 as its own creditors line for group and parent.
- Right: All group and parent balance sheet, P&L and staff cost figures matched.
- Mistake: Set group `fixed_assets` to 4122359 although the group balance sheet has no total fixed assets line (expected has none for the group); it was not scored, so this was harmless but not from the accounts.
- Mistake: About 60k characters of reasoning, with unresolved back-and-forth on `intangible_assets` and group `fixed_assets`.
