---
title: "Qwen3.7 Flash on Pydantic AI - Structured output"
description: "Extracting UK company accounts into a nested Pydantic model, checked against the filer's tags. Tool calling 50%; rank 39 of 44."
canonical: https://pydantic.dev/models/list/qwen3.7-flash/structured_output/
---

# Qwen3.7 Flash on Pydantic AI - Structured output

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

| Mode         | Score | Tasks passed | Cost   | Requests | Tool calls | Time     |
| ------------ | ----- | ------------ | ------ | -------- | ---------- | -------- |
| Tool calling | 50%   | 5 of 10      | $0.020 | 14       | 15         | 12.4 min |

Each task was run once per mode.

## Review

Written by an LLM from the runs' transcripts.

#### Overall

qwen3.7-flash passed 5 of the 10 cases, all in tool calling. That was 2 of 2 at tier 3, 2 of 2 at tier 2, 1 of 2 at tier 5, and none at tier 1 or tier 4. It is cheap: $0.0015–0.0025 a case and 1–2 requests each. Every failure came down to one or two fields. The failures were never figures it could not find in the accounts.

#### Where it does well

- **Reading the statements:** balance sheet and P&L figures were almost always correct, including the ×1000 scaling and bracket signs. This held even on large group-plus-parent outputs (tier3-05959188, tier5-NI037684).
- **Using validator errors:** after `profit_before_tax - tax` errors it fixed tax signs (tier1-07054261, tier2-SC121467). After a creditors-sum error it found a missing `other` line (tier4-NI626135).

#### Mistakes it makes

- **What it submits doesn't match its reasoning (3 failures).** In tier4-05840865 and tier4-NI626135 its reasoning listed wages and salaries (and pension) from the staff note, but the tool call sent `null`. In tier1-07054261 it decided twice that `accounts_type` should be `full`, then sent `small` both times.
- **Wrong period dates (1 failure).** In tier1-11022760 it set `period.start` to `2024-01-01` for a year ended 31 Dec 2025. When the validator flagged the gap with the prior period, it moved the prior period back to 2023 instead of correcting the start date: the error was right, and it changed the wrong field.
- **Picking a note figure over the balance sheet (tier1-11022760).** It sent share capital as `100` from a note, although its reasoning had chosen the balance sheet's `-` (0).
- **Wrong creditor category (tier5-12026946).** It put `440466` under `corporation_tax` instead of `other_tax_and_social_security`. It also padded the list with zero lines for every category and used `0` where the handbook asks for `null`.
- Minor waste: one case sent two parallel `accounts` calls, and the second was ignored.

## Runs

### tier1-07054261

**Tool calling: failed.** It extracted every balance sheet and P&L figure correctly. It fixed the sign of the prior-year tax credit after a validator error, but it submitted `accounts_type: "small"` instead of `full` both times, so the case failed. ($0.0024, 2 requests, 77 s)
- Right: All balance sheet figures were correct and multiplied up from £000, including the negative `net_current_assets` and `profit_and_loss_reserve`
- Right: After the error `profit_before_tax - tax gives -10715000` it changed prior `tax` from `138000` to `-138000`, which is the correct credit sign
- Mistake: Its first-turn reasoning concluded `accounts_type` should be `full`, but the tool call sent `small`
- Mistake: In the retry turn its reasoning said 'I'll revert to `full`', and it sent `small` again. What it reasoned and what it submitted did not match
- Mistake: Its reasoning first worked out the period as 2024-01-01 to 2025-12-31, though the submitted dates were correct

### tier1-11022760

**Tool calling: failed.** For a year ended 31 Dec 2025 it set the period start to `2024-01-01`. When the validator flagged a mismatch with the prior period, it moved the prior period back a year to `2023` instead of fixing the start date. It also returned share capital as `100` where the balance sheet shows `-`. The case failed. ($0.0022, 2 requests, 81 s)
- Right: All balance sheet figures were right from £000, including the creditors and net liabilities
- Right: It worked out that the bracketed `(312)` and `(632)` are tax charges, so `tax` is positive, and checked this against PAT
- Mistake: Turn 1: `period.start` was `2024-01-01` for a 12-month year ended 2025-12-31. It should have been `2025-01-01`
- Mistake: Turn 2: the error said `prior_period ends 2024-12-31, but should end the day before period starts`. It changed `prior_period` to 2023-01-01 to 2023-12-31, which kept the wrong period start and made the prior period wrong too
- Mistake: `called_up_share_capital`: its reasoning said to use 0 because the balance sheet line shows `-`, but it submitted `100` from note 20

### tier2-11600506

**Tool calling: passed.** It returned the group balance sheet and P&L for both years in a single accepted call, and every checked field was correct. ($0.0015, 1 requests, 53 s)
- Right: Passed on the first request
- Right: Kept negative net figures and positive costs, as the handbook requires

### tier2-SC121467

**Tool calling: passed.** Its first call had the tax signs reversed, with `-299000` and `571000`. It fixed both after the validator's `profit_before_tax - tax` errors and passed on the second call. ($0.0025, 2 requests, 1.6 min)
- Right: After the errors it corrected the signs to `299000` and `-571000` and did not change any other figure
- Right: All group balance sheet figures were correct
- Mistake: Turn 1: it read the bracketed tax lines the wrong way round, which cost one retry

### tier3-05959188

**Tool calling: passed.** It returned the group and parent-company balance sheets for both years in one turn and passed. ($0.0017, 1 requests, 56 s)
- Right: Kept group and parent figures separate, including parent `investments` `2467` and creditors after one year
- Right: All 64 checked fields were correct
- Mistake: It sent two `accounts` calls in parallel. The second was ignored with 'Output tool not used'

### tier3-09727592

**Tool calling: passed.** It returned the group and parent balance sheets in one call and passed. ($0.0017, 1 requests, 64 s)
- Right: Correct parent `investments` `40275` and prior parent `net_assets` `783514` (positive) next to the negative group figure
- Mistake: It filled `intangible_assets: 0` and `investments: 0` for the group where the accounts show no such line. These fields were not checked

### tier4-05840865

**Tool calling: failed.** Its reasoning read note 5 correctly (wages `4,716,869`, pension `205,062`, and so on), but the tool call sent `null` for wages and pension and only filled `total`. The creditors were correct. The case failed. ($0.0017, 1 requests, 65 s)
- Right: All creditor lines for group and parent matched notes 16 and 17, with prior amounts, and the totals tied to the balance sheet
- Right: Accepted on the first call
- Mistake: The submitted `staff_costs.wages_and_salaries` and `pension_costs` were `null` for both group periods, although its reasoning had listed the values. It dropped figures it had already extracted

### tier4-NI626135

**Tool calling: failed.** Its first call left out the group's `other` creditor line (`781,030`), and the validator caught the within-one-year sum. It added the line and was accepted, but `wages_and_salaries` stayed `null` even though its reasoning had `3,830,147`. The case failed. ($0.0024, 2 requests, 82 s)
- Right: It used the sum-check error to find the missing `other` creditors line for both group and parent
- Right: Creditor categories and amounts matched note 16
- Mistake: From the first call on, `staff_costs` held only `pension_costs` and `total`. It never sent wages, although its reasoning had listed them

### tier5-12026946

**Tool calling: failed.** It returned the full set: company details, directors, group and parent statements, staff costs and creditors, in one call. It filed the group's `440466` creditor line under `corporation_tax` when it is `other_tax_and_social_security`, and padded the creditors list with zero lines for every category. The case failed. ($0.0020, 1 requests, 79 s)
- Right: All group and parent balance sheet and P&L figures were correct, including the tax signs
- Right: The group staff costs were complete, and all 4 directors were found
- Mistake: The group creditor line `440466`/`508467` was labelled `corporation_tax`, with `other_tax_and_social_security` set to 0
- Mistake: It listed every category in both due buckets with `amount: 0`, and gave parent `trade_creditors` `prior_amount: 0` where the accounts show nothing (the handbook asks for `null`)

### tier5-NI037684

**Tool calling: passed.** It returned the full set for group and parent in one call and passed. ($0.0021, 1 requests, 1.5 min)
- Right: Passed on the first call across about 130 checked fields, including both sets of creditor lines and staff costs
- Mistake: It sent group `fixed_assets` `4645659`, including investment property `523300`, but this was not penalised
