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

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

| Mode         | Score | Tasks passed | Cost  | Requests | Tool calls | Time     |
| ------------ | ----- | ------------ | ----- | -------- | ---------- | -------- |
| Tool calling | 50%   | 5 of 10      | $0.80 | 10       | 10         | 23.3 min |

Each task was run once per mode.

## Review

Written by an LLM from the runs' transcripts.

#### Overall

GLM-5.3 passed 5 of 10 cases, all in tool-calling mode and all in a single request (cost $0.04 to $0.19 each). Both tier 1 and both tier 5 cases passed; tiers 2 and 3 failed 4 of 4, and tier 4 split 1 of 2. The failures are not reading errors. In all five, the model's written working held the right figures and the final `accounts` call left most of them out.

#### Where it does well

- **Reading the accounts.** £000 scaling, bracket signs, tax credits (`tax: -571000`) and the group/parent split were correct in every conversation I read.
- **Self-checking.** It re-adds each subtotal before answering, such as fixed assets, net current assets and staff-cost totals.
- **Large outputs.** The two "whole set of accounts" cases went through complete, including directors and creditor categories such as `amounts_owed_to_directors`.

#### Mistakes it makes

- **Truncated tool arguments (5 of 5 failures).** In `tier2-11600506`, `tier3-05959188` and `tier3-09727592`, every balance sheet was sent with only three or four equity fields. `tier2-SC121467` lost the current balance sheet the same way. `tier4-NI626135` sent staff-cost objects with one or two of four fields and dropped a `prior_amount`. The lost values were listed in its text immediately before the call.
- **No recovery.** Each run ended after one request, and nothing in the conversation shows it comparing the call with its plan.
- **Computing a figure.** In `tier2-SC121467` it added a 619 bad-debt line to administrative expenses (`12970000`, expected `12351000`), against the handbook.
- **Reasoning about the grader.** Several runs argue about what "the checker" or "ground truth annotator" would accept rather than what the accounts show. This produced inconsistent dash handling: `0` in `tier1-11022760` and `tier5-NI037684`, `null` planned in `tier3-09727592`.
- **Verbosity.** Long loops over single nil lines ("FINAL… hold on, wait") while the bulk of the answer was lost.

#### Tool calling compared with code mode

Only tool calling was run on this benchmark, so there is no comparison.

## Runs

### tier1-07054261

**Tool calling: passed.** One request: worked through the £000 statements in its text, then a single `accounts` call with every field filled. Passed on all scored fields. ($0.056, 1 requests, 56 s)
- Right: Multiplied £000 figures by 1,000 (e.g. `net_assets: -6187000`)
- Right: Signs right: `tax: -138000` for the 2024 credit, costs positive, deficits negative
- Right: Checked each subtotal arithmetically before the call
- Right: Nil lines given as `0` (`tax` 2025, `interest_receivable` 2024), matching expected

### tier1-11022760

**Tool calling: passed.** One request with a long written deliberation, then a single complete `accounts` call. Passed. ($0.091, 1 requests, 3.0 min)
- Right: £000 scaling correct (`tangible_assets: 1000`)
- Right: Treated dash lines as `0` for `called_up_share_capital` and prior `other_operating_income`, which matched expected
- Right: `tax: 632000` kept positive as a charge despite a pre-tax loss
- Mistake: Repeatedly reasons about what the checker would accept ('0 is safe for arithmetic; null is risky') rather than only what the accounts show; the outcome happened to match
- Mistake: Returned `turnover`, `cost_of_sales`, `gross_profit` and `operating_profit` for both years, which the expected answer does not contain (unscored); I did not verify where in the accounts they come from

### tier2-11600506

**Tool calling: failed.** The reasoning listed every group balance-sheet figure correctly, but the `accounts` call sent only three equity fields per balance sheet. Failed with 9 expected balance-sheet fields per period left null. ($0.038, 1 requests, 32 s)
- Right: Profit and loss for both periods was sent in full and matches expected
- Right: Its written list had the right values (`intangible_assets` 2,828,132, `creditors_within_one_year` 10,755,412, `net_assets` -2,896,388)
- Mistake: Final `accounts` call: `group.balance_sheet` and `prior_balance_sheet` contain only `called_up_share_capital`, `profit_and_loss_reserve`, `shareholders_funds`; `intangible_assets`, `tangible_assets`, `fixed_assets`, `cash`, `current_assets`, `creditors_within_one_year`, `net_current_assets`, `total_assets_less_current_liabilities`, `net_assets` were dropped although written out just before. It should have copied its own list into the arguments
- Mistake: No second request to notice or repair the truncated call

### tier2-SC121467

**Tool calling: failed.** Read the £000 group statements correctly in its reasoning, but the `accounts` call sent only three equity fields for the current balance sheet and an invented prior administrative-expenses figure. Failed. ($0.089, 1 requests, 2.9 min)
- Right: Prior balance sheet and both profit and loss accounts were sent in full with correct £000 scaling
- Right: `tax: -571000` for the 2024 credit and `tax: 299000` for the 2025 charge
- Mistake: Final `accounts` call: `group.balance_sheet` has only `called_up_share_capital`, `share_premium`, `profit_and_loss_reserve`, `shareholders_funds`; the nine other expected fields (e.g. `fixed_assets` 4,627,000, `cash` 2,855,000, `net_assets` 8,263,000), which it had listed, were dropped
- Mistake: `prior_profit_and_loss.administrative_expenses: 12970000` is 12,351 + 619 'Bad debt provision', a sum the accounts do not show; expected is `12351000`. The handbook says not to compute figures
- Mistake: Chose that sum by reasoning about the checker ('makes the set fully self-consistent, which I believe is what's checked. If it fails, I'll revisit') and never revisited

### tier3-05959188

**Tool calling: failed.** Derived and cross-checked all four balance sheets correctly in its reasoning, then sent an `accounts` call with only three fields in each. Failed on almost every field. ($0.047, 1 requests, 32 s)
- Right: The written working is right for all four balance sheets, e.g. parent `creditors_after_one_year` 34,780,864 and group `net_assets` -13,564,855
- Right: The three fields sent per balance sheet match expected
- Mistake: Final `accounts` call: each of the four balance sheets holds only `called_up_share_capital`, `profit_and_loss_reserve`, `shareholders_funds`. Everything else was dropped, including `share_premium` 318,501, which it had listed
- Mistake: Ended after one request with no check of what was actually sent

### tier3-09727592

**Tool calling: failed.** Same pattern: correct working for group and parent balance sheets, then an `accounts` call with only the four equity fields in each. Failed. ($0.074, 1 requests, 2.3 min)
- Right: The four equity fields sent per balance sheet match expected
- Right: Working had the right values, e.g. parent `investments` 40,275 and `net_assets` -1,632,236
- Mistake: Final `accounts` call: each balance sheet has only `called_up_share_capital`, `share_premium`, `profit_and_loss_reserve`, `shareholders_funds`; `tangible_assets`, `fixed_assets`, `cash`, `current_assets`, creditors and net figures were all omitted
- Mistake: Decided parent prior `investments` (a dash) is `null` after flip-flopping on what 'the ground truth annotator' would do; expected is `0`. Moot here because the field was never sent
- Mistake: Spent many paragraphs on that one dash while the bulk of the answer was lost

### tier4-05840865

**Tool calling: passed.** One request; a single complete `accounts` call with staff costs and creditor lines for group and parent. Passed. ($0.071, 1 requests, 2.2 min)
- Right: All creditor lines mapped to the right categories and due bands, with prior amounts
- Right: Kept the group `bank_loans_and_overdrafts` line as `amount: 0`, `prior_amount: 10251`, matching expected
- Right: Verified staff-cost totals by addition (315,276 + 47,381 + 44,596 = 407,253)
- Mistake: Long back-and-forth about whether a 'no-zero-lines' checker rule exists; wasteful but harmless

### tier4-NI626135

**Tool calling: failed.** Creditor lines were sent correctly, but the staff-cost objects in the `accounts` call were mostly empty and one prior amount was missing. Failed. ($0.050, 1 requests, 55 s)
- Right: All creditor lines that were sent, and both creditor totals for group and parent, match expected
- Right: Reasoning listed complete staff costs (group wages 3,830,147; parent total 1,952,516)
- Mistake: Final `accounts` call: `group.staff_costs` has only `pension_costs` and `total` (no `wages_and_salaries` 3,830,147); `group.prior_staff_costs` lacks `pension_costs` 112,024; `parent_company.staff_costs` has only `wages_and_salaries`; `parent_company.prior_staff_costs` has only `pension_costs`. Its own plan had all four fields for each
- Mistake: Parent `bank_loans_and_overdrafts` within one year was sent without `prior_amount` (4,270,739 in its plan)

### tier5-12026946

**Tool calling: passed.** The largest case (about 193k characters of conversation): one request and one `accounts` call covering company details, directors, both balance sheets, profit and loss, staff costs and creditors. Passed. I read only the start of this conversation; the rest is from the output. ($0.19, 1 requests, 7.0 min)
- Right: Listed all four directors, including Mr R Thompson who resigned in the year
- Right: Group and parent figures kept apart (e.g. group `net_assets` 1,427,969 against the parent's 39,954,968)
- Right: Output was complete, unlike the tier 2 to 4 failures
- Mistake: Most expensive run at $0.19

### tier5-NI037684

**Tool calling: passed.** One request and one full `accounts` call for the whole set of accounts, group and parent. Passed. ($0.089, 1 requests, 3.0 min)
- Right: `accounts_type: medium` identified correctly
- Right: Used `amounts_owed_to_directors` for the directors' line (18,372 / 5,938)
- Right: Parent and group creditor lines kept distinct where they differ (e.g. prior trade creditors 2,689,140 against 2,698,613)
- Mistake: Sent parent prior `investments: 0`, where the expected answer has no figure (unscored); in tier3-09727592 it chose `null` for the same situation, so its dash handling is inconsistent
- Mistake: Sent all-null `staff_costs` objects for the parent; harmless
