---
title: "GPT-6 Astra on Pydantic AI Accounting"
description: "Questions about and changes to a tutoring agency's books, checked to the penny. Tool calling 90%, code mode 80%; rank 2 of 32."
canonical: https://models.pydantic.dev/models/gpt-6-astra/accounting_platform/
---

# GPT-6 Astra on Pydantic AI Accounting

> Questions about and changes to a tutoring agency's books, checked to the penny. Tool calling 90%, code mode 80%; rank 2 of 32.
>
> Markdown copy of https://models.pydantic.dev/models/gpt-6-astra/accounting_platform/. Index for agents: https://models.pydantic.dev/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://models.pydantic.dev/api/select` with a JSON body such as `{"description": "what the agent does"}`. It returns up to five ranked models with reasons. Format: https://models.pydantic.dev/select.md
- Search models by name: `GET https://models.pydantic.dev/api/search?query=<text>`
- List, filter and sort models: `GET https://models.pydantic.dev/api/models`, for example `?weights=open&max_price=2&sort=efficiency`
- One model in full: `GET https://models.pydantic.dev/api/models/<slug>`
- Any other question about the models: `GET https://models.pydantic.dev/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://models.pydantic.dev/mcp`. More: https://models.pydantic.dev/usage.md

About the benchmark: https://models.pydantic.dev/benchmarks/accounting_platform.md. The model on every Pydantic AI benchmark: https://models.pydantic.dev/models/gpt-6-astra.md

| Mode         | Score | Tasks passed | Cost   | Requests | Tool calls | Time    |
| ------------ | ----- | ------------ | ------ | -------- | ---------- | ------- |
| Tool calling | 90%   | 9 of 10      | $18.16 | 110      | 971        | 8.9 min |
| Code mode    | 80%   | 8 of 10      | $1.46  | 57       | 57         | 2.1 min |

Each task was run once per mode.

## Review

Written by an LLM from the runs' transcripts.

#### Overall

`gateway/openai:gpt-6-astra` passed 17 of 20 runs: 9/10 in `tools` and 8/10 in `code_mode`. All three failures were incomplete invoice audits, with no provider errors. It performed reliably on the supplied payment, correction, balance and margin tasks; broad overcharge detection was less dependable.

#### Where it does well

Both modes passed all six cases involving invoice totals, outstanding debt and payment recording. They correctly subtracted existing allocations, converted pounds to integer pence and applied payments oldest due first.

Both correction runs preserved the required mutation order and replaced a `22800`-pence paid invoice with a `17100`-pence paid invoice. All four margin runs passed; code explicitly implemented `ROUND_HALF_UP`, charged-student split denominators, gross-tax extraction and tutor payment once per lesson.

Both modes also passed the dedicated duplicate-line and missed-attendance searches: four successful runs covering the large dataset.

#### Mistakes it makes

Only one of four general overcharge audits passed. Tools mode’s large audit read all `384` invoices but checked attendance selectively, missing three nonchargeable absences totalling `20625` pence.

Both code audits recalculated every existing line without enforcing one charge per student per lesson. They therefore reproduced duplicate charges in their expected totals, missing three large-dataset discrepancies totalling `17963` pence and one small-dataset discrepancy of `4050` pence. The dedicated duplicate detector used `Counter` correctly, but that check was absent from the broader audits.

The successful tools-mode missed-attendance search also relied on constructing consecutive lesson IDs from a partially retrieved lesson list—a fixture-dependent shortcut.

#### Tool calling compared with code mode

Across ten cases each, code mode used 57 model requests and `$1.4627`, versus 110 requests and `$18.1597` for tools: about 92% lower cost, but one fewer pass. These request counts are model requests, not underlying tool calls.

The largest savings came from keeping bulk records in Python and returning compact results. Duplicate detection fell from `$4.4135` to `$0.1701`; missed-attendance detection fell from `$6.9088` to `$0.2286`. Small tasks did not consistently benefit: invoice lookup cost more in code mode, and debt calculation used an extra request. Code improved processing efficiency, but did not ensure complete accounting logic.

## Runs

### small-invoice_total-1

**Tool calling: passed.** Correctly returned the tax-inclusive total of `89700` pence for `INV-00084`. ($0.047, 2 requests, 5 s)
- Right: Called `get_invoice` once and used its `total`; the returned `net` of `74752` plus `tax` of `14948` also equals `89700`.
- Right: Completed in two model requests without unnecessary lookups.

**Code mode: passed.** Correctly returned `89700` pence for `INV-00084` in two model requests. ($0.061, 2 requests, 4 s)
- Right: Used one `run_code` call containing `get_invoice(invoice_id='INV-00084')`, followed by the exact total in `final_result`.
- Mistake: The code call returned the whole invoice, including 14 lines, although returning `invoice['total']` would have sufficed.

### small-owed_on_invoices-1

**Tool calling: passed.** Correctly calculated Emeka Brown’s remaining invoice debt as `85204` pence. ($0.052, 3 requests, 6 s)
- Right: Resolved `CL-0007`, then requested unpaid invoices and allocations together.
- Right: Used `39452 + 49315 - 3563 = 85204`, subtracting the allocation to `INV-00155` rather than payments allocated to older invoices.

**Code mode: passed.** Correctly returned `85204` pence after subtracting active allocations from unpaid invoice totals. ($0.077, 4 requests, 7 s)
- Right: Used `search_clients`, `list_invoices` and `list_allocations` for `CL-0007`.
- Right: Filtered allocations by unpaid invoice IDs and `released_on is None`, yielding `39452 + 49315 - 3563`.
- Mistake: Used a separate third `run_code` call solely for the sum after already returning both record sets, taking four model requests versus three in tools mode.

### large-tutor_margin-3

**Tool calling: passed.** Correctly returned `120741` pence for Chen Mensah’s October margin. ($0.21, 5 requests, 22 s)
- Right: Used `search_tutors`, `get_settings` and `list_lessons` for `TU-002` over `2026-10-01` through `2026-10-31`.
- Right: Requested attendance for the `67` billable lessons out of `75`, excluding eight cancelled lessons.
- Right: Limited `get_client` checks to three clients relevant to gross-price tax treatment.

**Code mode: passed.** Correctly calculated `360316 - 239575 = 120741` pence of margin for Chen Mensah. ($0.20, 6 requests, 12 s)
- Right: Used `Decimal` and `ROUND_HALF_UP` for student costs, included tax and tutor pay.
- Right: Paid the tutor once per billable lesson, divided split prices by charged attendance, and removed included tax only for taxable clients with gross pricing.
- Mistake: At the client-fetch step, retrieved all `18` attendance clients; the tools run needed only three tax checks for gross-priced lessons.

### small-tutor_margin-3

**Tool calling: passed.** Correctly returned `65045` pence for Kai Iyer’s October margin. ($0.13, 5 requests, 16 s)
- Right: Retrieved `TU-001` and tax settings, then October lessons and attendance for all `37` complete lessons, excluding two cancelled lessons.
- Right: Checked `CL-0037`, `CL-0002` and `CL-0008` with `get_client` to establish relevant tax treatment.

**Code mode: passed.** Correctly calculated Kai Iyer’s margin as `187435 - 122390 = 65045` pence. ($0.14, 6 requests, 12 s)
- Right: Used `Decimal` with `ROUND_HALF_UP`, actual hourly duration, charged-student split denominators and per-lesson tutor pay.
- Right: Removed gross-price tax per student only when the client was taxable.
- Mistake: Retrieved all seven attendance clients with `get_client`; the tools run resolved the relevant gross-price tax treatment with three client calls.

### large-duplicate_lines-1

**Tool calling: passed.** Correctly identified all three invoices with repeated student–lesson pairs: `INV-06060`, `INV-06073` and `INV-06097`. ($4.41, 17 requests, 82 s)
- Right: Retrieved all four `list_invoices` pages and called `get_invoice` for all `384` nonvoid invoices.
- Right: Detected duplicated pairs `LS-044150`/`ST-0461`, `LS-042250`/`ST-0483` and `LS-044126`/`ST-0515`.
- Mistake: The exhaustive retrieval exposed all invoice details through 14 batches of `get_invoice` calls, costing `17` model requests and `$4.4135`; code mode processed the same coverage much more cheaply.

**Code mode: passed.** Correctly found the three duplicate-line invoices using a Python counter over all nonvoid October invoices. ($0.17, 7 requests, 14 s)
- Right: Paginated all `394` invoices, excluded `10` void invoices, and fetched `384` details with `asyncio.gather`.
- Right: Used `Counter([(line['student_id'], line['lesson_id']) for line in inv['lines']])` and `any(n > 1 for n in counts.values())`.
- Right: Returned the exact three IDs in seven model requests at `$0.1701`.

### large-missed_billed-1

**Tool calling: passed.** Correctly returned `INV-05821`, `INV-05846` and `INV-06080` after finding invoiced attendance marked `missed`. ($6.91, 37 requests, 2.9 min)
- Right: Retrieved all four October invoice pages and ultimately checked the three candidate invoices with `get_invoice`.
- Right: Found `missed` attendance for `LS-044224`/`ST-0088`, `LS-041761`/`ST-0127` and `LS-043071`/`ST-0491`.
- Mistake: After initially fetching 21 invoice details and an attendance batch, switched to a broad attendance scan, producing `31` `list_attendance` calls and `37` model requests at `$6.9088`.
- Mistake: After reading only page 1 of `list_lessons` (`2957` lessons, `30` pages), constructed consecutive lesson identifiers through `LS-044678` instead of retrieving the remaining pages. This happened to cover the fixture; identifiers should come from returned records.

**Code mode: passed.** Correctly identified all three invoices billing students marked `missed`. ($0.23, 8 requests, 16 s)
- Right: Fetched `384` nonvoid invoice details and attendance for their `2655` distinct lesson IDs in batches of `100`.
- Right: Built a set of `(lesson_id, student_id)` pairs with `status == 'missed'`, then matched positive invoice lines using `l['total'] > 0`.
- Right: Completed in eight model requests at `$0.2286`.

### large-wrong_invoices-1

**Tool calling: failed.** Returned nine correct overcharges but omitted three invoices charging for nonchargeable absences, so the audit failed. ($4.78, 17 requests, 2.4 min)
- Right: Read all `384` nonvoid invoice details and correctly reported the nine returned amounts, including duplicate charges of `3563`, `4500` and `9900` pence.
- Mistake: During evidence gathering, focused `list_lessons` on `cancelled` and `planned` lessons, then requested attendance for only 100 cancelled lessons and 13 selected lessons. It did not check attendance across all invoiced student–lesson pairs.
- Mistake: The final result omitted `INV-05821` (`4875`), `INV-05846` (`11700`) and `INV-06080` (`4050`). It should have joined every invoice line to attendance and assigned zero cost when the student was `missed`, even in a billable lesson.

**Code mode: failed.** Correctly found nine overcharges but missed all three duplicate-line invoices despite retrieving the necessary records. ($0.29, 12 requests, 28 s)
- Right: Retrieved `384` nonvoid invoice details, `2655` lessons, attendance and all `384` client records.
- Right: Correctly handled billable status, missed attendance, split charging, tax and half-up rounding for the nine reported discrepancies.
- Mistake: In the final calculation call, `for line in inv['lines']` followed by `expected += total` counted duplicate student–lesson pairs repeatedly. This made duplicate charges appear legitimate.
- Mistake: Omitted `INV-06060` (`3563`), `INV-06073` (`4500`) and `INV-06097` (`9900`). Expected charges should be calculated once per unique `(lesson_id, student_id)` pair, then compared with the recorded invoice total.

### small-wrong_invoices-1

**Tool calling: passed.** Correctly identified all four overcharged invoices and their exact amounts: `4050`, `863`, `600` and `6000` pence. ($1.49, 14 requests, 57 s)
- Right: Read `37` invoice details, all four pages containing `315` September lessons, attendance and client tax records.
- Right: Detected the duplicate `LS-001226`/`ST-0016` line on `INV-00158`, incorrect tax on `INV-00162`, incorrect pricing on `INV-00172`, and missed attendance on `INV-00176`.
- Mistake: The broad retrieval included `search_clients(name='')`, all September lessons and `37` client lookups, taking `14` model requests and `$1.492`.

**Code mode: failed.** Returned three correct discrepancies but missed the `4050`-pence duplicate charge on `INV-00158`. ($0.16, 5 requests, 13 s)
- Right: Retrieved invoice details, client tax records, and lessons and attendance for `280` distinct lesson IDs.
- Right: Correctly reported `INV-00162` at `863`, `INV-00172` at `600`, and `INV-00176` at `6000` pence.
- Mistake: In the fourth `run_code` call, `expected = sum(price(line, cm[inv['client_id']]) for line in inv['lines'])` priced both copies of `LS-001226`/`ST-0016`. It should have deduplicated student–lesson pairs before summing expected charges.
- Mistake: The final answer consequently omitted `INV-00158`, although its invoice details had been fetched.

### large-correction-2

**Tool calling: passed.** Correctly marked Yara Baker’s attendance as `missed`, voided `INV-06372`, and created paid replacement `INV-06548` for `17100` pence. ($0.048, 5 requests, 12 s)
- Right: Called `update_attendance` for `LS-045235`/`ST-0332`, then `void_invoice`, then `create_invoice`, with both invoice actions dated `2026-11-13`.
- Right: Retained the three remaining lines at `5700` pence each; the recorded changes correctly released `22800` pence and applied `17100` to the replacement.
- Mistake: At initial retrieval, `search_clients(name='Yara Baker')` was redundant: `get_invoice` already supplied the client, student and lesson identifiers.

**Code mode: passed.** Correctly completed the attendance correction, void and paid replacement invoice in three model requests. ($0.043, 3 requests, 8 s)
- Right: Sequenced `update_attendance`, `void_invoice` and `create_invoice` within one `run_code` call.
- Right: Filtered out exactly `LS-045235`/`ST-0332` from the original lines and created `INV-06548` for `17100` pence dated `2026-11-13`.
- Mistake: The first code call redundantly ran `search_clients` after `get_invoice` had already supplied the necessary client identifier.

### large-record_payment-1

**Tool calling: passed.** Correctly recorded Jane Kelly’s `50126`-pence payment and allocated it oldest due first. ($0.078, 5 requests, 11 s)
- Right: Used `search_clients`, `list_invoices(status='unpaid')` and `list_allocations` to identify `CL-0294` and its outstanding invoices.
- Right: Calculated `58778 - 21152 = 37626` for `INV-02840`, then passed allocations of `37626` and `12500` to `record_payment`, dated `2026-11-13`.

**Code mode: passed.** Correctly recorded `50126` pence, cleared `INV-02840` and part-paid `INV-03247`, leaving no unallocated amount from the payment. ($0.097, 4 requests, 10 s)
- Right: Converted pounds with `int(Decimal('501.26') * 100)` and sorted invoices by `(due_date, id)`.
- Right: Counted only allocations with `released_on is None` and used `min(remaining, inv['total'] - paid)`.
- Right: Called `record_payment` with `37626` and `12500` allocations dated `2026-11-13`.
