---
title: "Qwen3.8 Max (0902) on Pydantic AI - Structured output"
description: "Extracting UK company accounts into a nested Pydantic model, checked against the filer's tags. Tool calling 60%; rank 35 of 44."
canonical: https://pydantic.dev/models/list/qwen3.8-max-0902/structured_output/
---

# Qwen3.8 Max (0902) on Pydantic AI - Structured output

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

| Mode         | Score | Tasks passed | Cost  | Requests | Tool calls | Time     |
| ------------ | ----- | ------------ | ----- | -------- | ---------- | -------- |
| Tool calling | 60%   | 6 of 10      | $0.59 | 10       | 10         | 12.3 min |

Each task was run once per mode.

## Review

Written by an LLM from the runs' transcripts.

#### Overall

Qwen3.8-max passed 6 of the 10 cases, all in tool-calling mode. Each case used one request and cost $0.05–$0.08. It never retried. In every case it worked out the figures in its reasoning and then made a single `accounts` call.

#### Where it does well

- **Reading the figures.** In all 10 conversations the numbers in its reasoning are almost entirely right. That covers scaling from £000, bracket signs and group versus parent columns.
- **Tax signs.** It checked the sign of tax against the tax note and the profit after tax:
  - In tier1-11022760 it worked out that `(312)`/`(632)` were charges in both years.
  - In tier2-SC121467 it saw the brackets were reversed and returned -571000 as a credit.
- **Large outputs.** The two biggest tier-5 cases (12026946 and NI037684) passed with complete outputs.
- **Note-level extraction.** Both tier-4 creditor and staff-cost cases passed, with category mapping and 0 amounts handled.

#### Mistakes it makes

**Dropping figures between reasoning and the tool call: 3 of the 4 failures.** In each case the reasoning lists the right values, but the call to `accounts` leaves them out, so they come out null:

- **tier2-SC121467:** it sent only the four equity lines for each group balance sheet. Cash, current assets, creditors, net assets and the other asset and liability lines were all missing.
- **tier3-05959188:** the same thing happened for all four group and parent balance sheets, losing about 44 expected fields.
- **tier3-09727592:** it left out group current-year `cash` (2,720,339), which appears word for word in its reasoning.

The schema accepts partial objects, so nothing flagged the gaps and the model sent each answer only once. This is a reliability problem in output, not in reading the accounts.

**Overriding the face of the balance sheet: 1 failure.**

- **tier1-11022760:** the £000 balance sheet shows `-` for share capital. The model knew this, but returned £100 from note 20, where 0 was expected.

**Minor, unscored.**

- **tier5-NI037684:** it reported `investment_property` 523300 alongside a `fixed_assets` figure equal to tangible assets.

## Runs

### tier1-07054261

**Tool calling: passed.** Read the single-company £000 accounts in one request and returned the full `accounts` structure with every figure scaled by 1,000. Passed. ($0.068, 1 requests, 68 s)
- Right: Scaled all £000 figures correctly, e.g. `intangible_assets` 2640000 and `creditors_within_one_year` 20446000
- Right: Signed the net figures correctly: `net_current_assets` -8967000, `profit_and_loss_reserve` -8457000, prior `tax` -138000 as a credit

### tier1-11022760

**Tool calling: failed.** Extracted every balance sheet and P&L figure correctly but returned `called_up_share_capital` 100 for both years where 0 was expected. Failed on that one field. ($0.049, 1 requests, 68 s)
- Right: Worked out that the bracketed `Tax (charge)/credit` line was a charge in both years (312000 and 632000), checking it against note 9 and the loss after tax
- Right: All other balance sheet and P&L figures matched, with £000 scaled and signs correct
- Mistake: In its reasoning it saw that the £000 balance sheet shows share capital as `-` (nil), then chose £100 from note 20 instead. It should have taken the balance sheet line as shown, which is 0, for both periods.

### tier2-11600506

**Tool calling: passed.** Returned the group balance sheet and P&L for both years in one call, figures in pounds. Passed. ($0.049, 1 requests, 35 s)
- Right: Every expected group figure matched, including small items such as `interest_receivable` 91 and `other_operating_income` 16667
- Right: Also filled in extra lines (provisions, stocks, debtors, creditors after one year)

### tier2-SC121467

**Tool calling: failed.** Its reasoning listed every group balance sheet figure (intangibles 378000, cash 2855000, current assets 13197000 and so on), but the `accounts` call held only the four equity lines for each balance sheet. All asset and liability fields came out null. Failed. ($0.056, 1 requests, 56 s)
- Right: P&L for both years was correct and scaled from £000, with the 2024 tax credit as -571000 after it reconciled the reversed brackets against note 11
- Right: Equity lines were correct: `called_up_share_capital` 9559000, `profit_and_loss_reserve` -1296000 and -1176000
- Mistake: In the final tool call it left out `intangible_assets`, `tangible_assets`, `fixed_assets`, `cash`, `current_assets`, `creditors_within_one_year`, `net_current_assets`, `total_assets_less_current_liabilities` and `net_assets` for both years, although its reasoning had all of them. It should have put every figure it had worked out into the call.

### tier3-05959188

**Tool calling: failed.** Its reasoning correctly listed the full group and parent balance sheets for both years. The `accounts` call held only share capital, share premium, P&L reserve and shareholders' funds for each of the four sheets. Failed. ($0.060, 1 requests, 34 s)
- Right: All extracted figures in the reasoning matched the expected values, including the parent's `creditors_after_one_year` 34780864 and its arithmetic check that fixed assets add up
- Right: The equity figures it did send were correct and signed negative where needed
- Mistake: It dropped every asset and liability line (about 44 expected fields) from the final tool call, so they came out null. It should have sent the complete set it had already written down.

### tier3-09727592

**Tool calling: failed.** Returned nearly complete group and parent balance sheets, but left `cash` out of the current-year group balance sheet. It had 2,720,339 in its reasoning. Failed on that field. ($0.052, 1 requests, 51 s)
- Right: All parent company figures were correct, including prior `investments` 0 taken from the `-` shown on the balance sheet
- Right: Treated provisions and creditors as positive amounts and net liabilities as negative
- Mistake: It dropped `cash` (and `debtors`) from `group.balance_sheet` in the tool call even though its reasoning listed `Cash 2,720,339`. Group cash came out null where 2720339 was expected.

### tier4-05840865

**Tool calling: passed.** Returned group and parent staff costs and creditor notes with category breakdowns in one call. Passed. ($0.054, 1 requests, 59 s)
- Right: Mapped creditor categories correctly, including 0 amounts such as group `bank_loans_and_overdrafts` within one year
- Right: Staff cost totals and the parent's `amounts_owed_to_group` matched

### tier4-NI626135

**Tool calling: passed.** Returned the group and parent creditor breakdowns and staff costs for both years. Passed. ($0.055, 1 requests, 74 s)
- Right: Filled in all ten group creditor lines, including after-one-year bank loans of 0 with a prior figure of 5836
- Right: Parent creditors and staff costs matched

### tier5-12026946

**Tool calling: passed.** Filled in the full tier-5 schema in one request: company details, directors, group and parent balance sheets, P&L, staff costs and creditors. Passed. ($0.079, 1 requests, 2.9 min)
- Right: All four directors were listed
- Right: Large output, about 4,000+ characters, with no fields dropped. The group P&L signs were correct, e.g. prior `tax` -51830

### tier5-NI037684

**Tool calling: passed.** Filled in the full schema for a medium-sized group in one request. Passed. ($0.068, 1 requests, 2.0 min)
- Right: Set `accounts_type` to `medium`, and returned both directors and every expected group and parent figure
- Mistake: It reported group `investment_property` 523300 while `fixed_assets` equals `tangible_assets` (4122359). That looks like double counting, but the field wasn't scored.
