---
title: "GLM 5.3 Flash 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/glm-5.3-flash/structured_output/
---

# GLM 5.3 Flash 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/glm-5.3-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/glm-5.3-flash/pydantic_ai.md

| Mode         | Score | Tasks passed | Cost   | Requests | Tool calls | Time    |
| ------------ | ----- | ------------ | ------ | -------- | ---------- | ------- |
| Tool calling | 60%   | 6 of 10      | $0.070 | 10       | 11         | 5.3 min |

Each task was run once per mode.

## Review

Written by an LLM from the runs' transcripts.

#### Overall

6 of 10 cases passed, all in tool-calling mode, each in a single request, at $0.004–$0.011 per case. The four failures (both tier 2 and both tier 3 cases) share one cause: the model read the accounts correctly but sent an incomplete `accounts` call. Tiers 1, 4 and 5 all passed.

#### Where it does well

- **Reading the accounts.** In all ten cases the recorded reasoning shows correct extraction. Where I read the full figure lists (9 cases), they matched the expected values.
- **Handbook rules.** It multiplied £000 figures by 1,000 (`tier1-07054261`, `tier1-11022760`, `tier2-SC121467`). Creditors came out positive, deficits and tax credits negative. Group and parent columns stayed apart in four-column notes (`tier4-NI626135`, `tier5-NI037684`).
- **Self-checking.** It re-added totals before answering, e.g. the eight creditor lines summing to 17,897,307 in `tier4-NI626135`.
- **Large outputs.** The two tier 5 cases, with about 150 fields each, were complete and correct.

#### Mistakes it makes

- **Dropped fields in the final call (4 of 10).** In `tier2-11600506`, `tier3-05959188` and `tier3-09727592` the reasoning listed and reconciled every figure. The call then carried only the equity lines (`called_up_share_capital`, `profit_and_loss_reserve`, `shareholders_funds`, sometimes `share_premium`).
  - `tier2-11600506` also lost the whole profit and loss except `tax`.
  - `tier2-SC121467` kept the profit and loss but lost the top of both balance sheets.
  - Missing fields default to `null`, so no check fired and the model got no chance to repair the answer.
  - The conversations do not show whether the model or the gateway truncated the arguments.
- **Duplicate call.** `tier2-SC121467` emitted the same `accounts` call twice; the second was rejected.
- **Second-guessing the grader.** `tier2-SC121467` spent about 64k characters of reasoning, partly weighing odds on what the ground truth held ("~65/35 confident"). `tier4-05840865` did the same over nil rows. Neither changed a result.

The pattern follows the task type: every case asking only for balance sheets, or balance sheet plus profit and loss, for a group failed. Cases with creditors arrays, or with the single-company or full tier 5 schema, passed.

#### Tool calling compared with code mode

No code-mode runs were given for this benchmark, so there is nothing to compare.

## Runs

### tier1-07054261

**Tool calling: passed.** One request: read the Cube Logic accounts (£000), reconciled both periods in its reasoning, and made one complete `accounts` call. Passed. ($0.0057, 1 requests, 16 s)
- Right: Multiplied £000 figures by 1,000
- Right: Signs correct: `creditors_within_one_year` 20446000 positive, `net_current_assets` -8967000, prior `tax` -138000 as a credit
- Right: Summed the two debtors lines (134 + 9,658) to `debtors` 9792000
- Right: Checked `gross_profit - administrative_expenses = operating_profit` for both years before answering

### tier1-11022760

**Tool calling: passed.** One request: extracted the TaskUs single-company balance sheet and profit and loss in £000 and made one complete `accounts` call. Passed. ($0.011, 1 requests, 69 s)
- Right: All 51 expected fields matched, including `called_up_share_capital` 0 and `other_operating_income` 0 for the prior year
- Right: Kept the equity reserve out of `share_premium`
- Right: Cross-checked the prior operating profit (4,003 − 3,765 = 238)
- Mistake: The most expensive pass with the largest conversation (about 130k characters); nothing wrong in the output

### tier2-11600506

**Tool calling: failed.** Reasoning extracted and reconciled every group balance sheet and profit and loss figure correctly, but the single `accounts` call carried only `called_up_share_capital`, `profit_and_loss_reserve`, `shareholders_funds` and `tax`. Everything else defaulted to `null` and the case failed. ($0.0036, 1 requests, 6 s)
- Right: Reasoning listed all expected values correctly, e.g. `fixed_assets` 5,232,213, `net_current_assets` -6,090,208, `profit_before_tax` 953,487
- Right: Arithmetic checks for both years all passed in the reasoning
- Right: The four field kinds it did send were correct
- Mistake: Final `accounts` tool call: arguments were `{"group": {"balance_sheet": {"called_up_share_capital": 400, "profit_and_loss_reserve": -2896788, "shareholders_funds": -2896388}, ..., "profit_and_loss": {"tax": 432692}, ...}}`. It left out intangible and tangible assets, fixed assets, cash, current assets, creditors, net current assets, net assets and all profit and loss lines except `tax`, although the reasoning ended with "Let me now produce the final answer" and had them all.
- Mistake: The schema accepts missing fields as `null`, so no check fired and there was no second request to repair it.

### tier2-SC121467

**Tool calling: failed.** Sent the full group profit and loss, but the balance sheet objects held only share capital, `share_premium: null`, profit and loss reserve and shareholders' funds. All assets, creditors and net figures came out `null`; failed. ($0.011, 1 requests, 72 s)
- Right: Profit and loss for both years correct in £000 × 1,000, including prior `tax` -571000 and `operating_profit` -1818000
- Right: Kept prior `administrative_expenses` at the printed 12,351,000 instead of adding the separate 619 bad debt provision, which matched the expected value
- Mistake: Final `accounts` call: `balance_sheet` and `prior_balance_sheet` omitted `intangible_assets`, `tangible_assets`, `fixed_assets`, `cash`, `current_assets`, `creditors_within_one_year`, `net_current_assets`, `total_assets_less_current_liabilities` and `net_assets` (expected e.g. `fixed_assets` 4627000, `net_assets` 8263000).
- Mistake: Emitted the identical `accounts` call twice in one response; the second was rejected with "Output tool not used - a final result was already processed."
- Mistake: About 64k characters of reasoning, much of it going back and forth on whether to fold the bad debt provision into administrative expenses ("~65/35 confident"), guessing at the grader instead of finishing the balance sheet.

### tier3-05959188

**Tool calling: failed.** Reasoning listed and reconciled all four balance sheets (group and parent, both years) correctly, but the `accounts` call sent only the four equity lines per sheet. All asset, creditor and net figures were `null`; failed. ($0.0049, 1 requests, 12 s)
- Right: Reasoning had every expected value, e.g. group `net_assets` -13564855, parent `creditors_after_one_year` 34780864, parent `investments` 2467
- Right: Kept group and parent figures apart
- Right: Sent equity lines were right, including `share_premium` 318501
- Mistake: Final `accounts` call: each of the four balance sheets contained only `called_up_share_capital`, `share_premium`, `profit_and_loss_reserve` and `shareholders_funds`. The 12 lines above them, which the reasoning had just checked ("All good. Now I'll call the accounts function"), were dropped.
- Mistake: No validation error, so no retry.

### tier3-09727592

**Tool calling: failed.** Reasoning extracted and checked all four Tyk Technologies balance sheets, but the `accounts` call sent only `called_up_share_capital`, `profit_and_loss_reserve` and `shareholders_funds` per sheet. Failed. ($0.0045, 1 requests, 12 s)
- Right: Reasoning values matched the expected ones, e.g. group `cash` 2,720,339, parent `investments` 40,275 and prior 0 (dash read as nil)
- Right: Arithmetic for all four sheets checked in the reasoning
- Mistake: Final `accounts` call dropped every line above the equity section for all four sheets.
- Mistake: It also dropped `share_premium` (28,167,129 and 28,153,530), which the reasoning had listed, so the omission is not limited to non-equity lines.

### tier4-05840865

**Tool calling: passed.** One request: returned group and parent staff costs and the creditors note with every row, in one complete `accounts` call. Passed. ($0.0069, 1 requests, 28 s)
- Right: All creditor rows by category and due date matched, including group bank loans 0 with prior 10251
- Right: Read dashes as 0 for rows the note shows
- Right: Group and parent columns kept apart
- Mistake: Long deliberation over whether to include nil/nil rows, reasoning about what a checker might do; harmless here

### tier4-NI626135

**Tool calling: passed.** One request: returned staff costs and both creditors notes for group and parent, each total re-added in reasoning. Passed. ($0.0050, 1 requests, 16 s)
- Right: Summed the eight within-one-year lines to 17,897,307 (company) and the prior group lines to 14,579,974 to confirm the totals
- Right: Four-column note read correctly (group 2025/2024, company 2025/2024)
- Right: Included bank loans after one year as 0 with prior 5836

### tier5-12026946

**Tool calling: passed.** One request: the largest schema (company info, directors, group and parent balance sheets, group profit and loss, staff costs, creditors) returned in one complete `accounts` call. Passed. ($0.0096, 1 requests, 49 s)
- Right: About 150 expected fields matched
- Right: Signs right: prior `tax` -51830 as a credit, `profit_and_loss_reserve` -43056856
- Right: Ignored the associates' loss line that has no schema field instead of forcing it into another field

### tier5-NI037684

**Tool calling: passed.** One request: returned the full John Mulholland Motors group and parent extraction in one complete `accounts` call. Passed. ($0.0075, 1 requests, 34 s)
- Right: `accounts_type` "medium" identified
- Right: Re-read the four-column creditors note to separate similar group and company figures (273,134 vs 277,314; 2,698,613 vs 2,689,140)
- Right: Parent prior `investments` left `null` where the accounts show a dash, matching expected
- Mistake: Set group `fixed_assets` to 4122359 although the reasoning noted the balance sheet shows no fixed-assets subtotal; not an expected field, so it did not count
