---
title: "Grok 4.6 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/grok-4.6/accounting_platform/
---

# Grok 4.6 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/grok-4.6/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/grok-4.6.md

| Mode         | Score | Tasks passed | Cost  | Requests | Tool calls | Time     |
| ------------ | ----- | ------------ | ----- | -------- | ---------- | -------- |
| Tool calling | 90%   | 9 of 10      | $5.32 | 73       | 616        | 10.9 min |
| Code mode    | 80%   | 8 of 10      | $1.16 | 97       | 97         | 5.9 min  |

Each task was run once per mode.

## Review

Written by an LLM from the runs' transcripts.

#### Overall

Grok-4.6 passed **17/20 runs**: **9/10 tools** and **8/10 code_mode**. All three failures concerned broad invoice-error audits. Routine lookups, balances, margin calculations, and account changes were consistently correct in these cases.

Evidence has limits: five code-mode spans expose only their opening prompts, and the large tools missed-billing transcript ends during collection. Their outcomes are supported by the supplied results; unrecorded implementation details are not assumed.

#### Where it does well

Both modes passed all **four mutation runs**, correctly handling attendance correction, invoice voiding, released allocations, replacement-invoice credit, and oldest-due-first payment allocation.

All **four margin runs** passed. Visible code correctly applied `ROUND_HALF_UP`, charged-student split denominators, gross-price tax extraction, and tutor pay once per billable lesson. Both modes also passed the **four invoice-total and outstanding-debt runs** and the **four dedicated duplicate/missed-billing detection runs**.

#### Mistakes it makes

Audit completeness is the main weakness. The large tools audit switched from comprehensive checking to unusual-tax screening, returning only **3/12** errors. It never inspected the other invoices’ lines and overstated its coverage.

Code mode returned **9/12** large-audit errors and **3/4** small-audit errors, omitting duplicate charges in both. The visible small-audit code explains why: it repriced every existing line, so a duplicate increased both actual and supposedly correct totals. It needed uniqueness checks on `(lesson_id, student_id)`.

That small code audit also recovered from exceeding the `100`-lesson limit and using unsupported `next(generator)` behavior. These were model/tool-use errors, not provider failures.

#### Tool calling compared with code mode

Code mode cost **$1.1565**, versus **$5.3168** for tools—about **78% less**—but used **97 versus 73 requests** and passed one fewer case. Savings were concentrated in large duplicate and missed-billing searches. Code mode was not uniformly cheaper: the small margin calculation doubled requests and nearly doubled cost through extra inspection and recalculation.

For these cases, code mode substantially reduced data-processing cost, but did not ensure complete accounting logic. Neither mode demonstrated reliable comprehensive invoice auditing.

## Runs

### small-invoice_total-1

**Tool calling: passed.** Retrieved `INV-00084` and correctly returned its tax-inclusive total of `89700` pence. ($0.012, 2 requests, 2 s)
- Right: Used one `get_invoice` call followed by `final_result`.
- Right: Selected `total: 89700`, rather than net `74752` or tax `14948`.

**Code mode: passed.** Correctly returned `89700` pence after reading `INV-00084`. ($0.017, 2 requests, 2 s)
- Right: Ran `await get_invoice(invoice_id="INV-00084")`, then submitted `final_result`.
- Right: Completed the lookup in two requests without unnecessary calculations.

### small-owed_on_invoices-1

**Tool calling: passed.** Correctly calculated Emeka Brown’s unpaid-invoice debt as `85204` pence. ($0.019, 4 requests, 11 s)
- Right: Resolved `CL-0007`, fetched unpaid invoices, and checked `list_allocations`.
- Right: Calculated `(39452 - 3563) + 49315 = 85204`, including the credit allocation with `payment_id: null`.
- Mistake: Alongside allocations, fetched `get_client`; the client’s personal and tax details were unnecessary for the outstanding-invoice calculation.

**Code mode: passed.** Correctly returned `85204` pence outstanding on Emeka Brown’s unpaid invoices. ($0.027, 4 requests, 5 s)
- Right: Used `search_clients`, `list_invoices(status="unpaid")`, and invoice-specific `list_allocations` calls.
- Right: Correctly accounted for the `3563`-pence allocation: `39452 - 3563 + 49315 = 85204`.
- Mistake: Fetched an unnecessary `get_client` record.
- Mistake: Executed the two independent allocation reads sequentially despite importing `asyncio`.

### large-tutor_margin-3

**Tool calling: passed.** Correctly returned `120741` pence for Chen Mensah’s October margin. ($0.15, 5 requests, 83 s)
- Right: Resolved `TU-002` with `search_tutors`, then fetched October lessons, settings, attendance, and `18` client tax records.
- Right: Retrieved attendance for `75` lessons, including split lessons and chargeable cancellations.
- Right: Returned the expected net-of-tax margin in five requests.

**Code mode: passed.** Computed `360316 - 239575 = 120741` pence, correctly matching Chen Mensah’s margin. ($0.092, 8 requests, 47 s)
- Right: Fetched `75` lessons, `90` attendance records, and `18` client records, using `asyncio.gather` for clients.
- Right: Used `Decimal` and `ROUND_HALF_UP`, filtered billable lessons and charged attendance, and divided split rates by charged-student count.
- Right: Counted tutor pay once per billable lesson; included `67` billable lessons and excluded eight cancelled lessons.
- Right: For gross pricing, calculated rounded tax with `cost * tax_rate / (1 + tax_rate)` before subtracting it.
- Mistake: Spent a separate `run_code` request merely deriving client IDs, then another fetching them; these could have been combined.

### small-tutor_margin-3

**Tool calling: passed.** Correctly returned `65045` pence for Kai Iyer’s October margin. ($0.081, 5 requests, 58 s)
- Right: Used `search_tutors` to identify `TU-001`, then obtained October lessons, settings, attendance for `39` lessons, and seven client records.
- Right: Returned the expected result in five requests, using lesson-date records rather than invoice totals.

**Code mode: passed.** Correctly computed `187435 - 122390 = 65045` pence for Kai Iyer’s October margin. ($0.16, 10 requests, 59 s)
- Right: Read `39` lessons and attendance records, identifying `37` billable lessons and `33` charged student lines.
- Right: Used `Decimal` and `ROUND_HALF_UP` for costs, tutor pay, and gross-price tax extraction.
- Right: Included tutor pay for billable lessons even where attendance generated no client charge.
- Mistake: Used separate requests for attendance distributions and tax-map inspection, then repeated the client-net calculation after obtaining the correct result. This took `10` requests and `$0.1574`, versus five and `$0.0806` in tools mode.
- Mistake: Fetched seven independent client records sequentially.

### large-duplicate_lines-1

**Tool calling: passed.** Scanned October invoices and correctly returned `INV-06060`, `INV-06073`, and `INV-06097`. ($1.66, 14 requests, 2.1 min)
- Right: Retrieved all four `list_invoices` pages, covering `394` invoices.
- Right: Made `393` distinct `get_invoice` calls, largely in batches of `40`, and identified repeated student–lesson pairs.
- Right: Continued checking after finding the first two duplicates.
- Mistake: During the scan, fetched details for void invoices such as `INV-05817`, although their status was already available and they were excluded from the question. The extensive detail retrieval cost `$1.6637`.

**Code mode: passed.** Correctly returned the three duplicate-billing invoices. Logfire exposes only the opening prompt for this span, so the detection implementation is unavailable. ($0.17, 12 requests, 35 s)
- Right: Returned exactly `INV-06060`, `INV-06073`, and `INV-06097`.
- Right: Used `12` requests and cost `$0.1698`, versus `14` requests and `$1.6637` in tools mode.

### large-missed_billed-1

**Tool calling: passed.** Correctly returned `INV-05821`, `INV-05846`, and `INV-06080`. The retrieved conversation stops during data collection, so later matching steps are not observable. ($2.50, 16 requests, 46 s)
- Right: Fetched October `list_invoices` pages `1`–`4`.
- Right: Started collecting September lessons with `list_lessons`, requesting pages `1`–`10` in the visible record.
- Right: The supplied final result contains exactly the three expected invoices.
- Mistake: The visible collection strategy assumed October invoices mostly concerned September lessons; invoice-line lesson IDs would provide a firmer scope. The supplied run cost was `$2.5016`, the highest of these cases.

**Code mode: passed.** Correctly identified all three invoices billing missed students. The queried conversation contains only the opening prompt. ($0.14, 14 requests, 31 s)
- Right: Returned exactly `INV-05821`, `INV-05846`, and `INV-06080`.
- Right: The supplied run used `14` requests and cost `$0.1419`, substantially less than tools mode.

### large-wrong_invoices-1

**Tool calling: failed.** Returned three correct tax overcharges but missed nine of the twelve incorrect invoices. ($0.32, 7 requests, 2.6 min)
- Right: Fetched all four October invoice pages and confirmed that `CL-0097`, `CL-0270`, and `CL-0361` were not taxable.
- Right: Correctly reported `INV-05851: 1050`, `INV-06016: 1150`, and `INV-06105: 1875`.
- Mistake: After requesting only page `1` of complete and chargeable-cancelled September lessons, narrowed the audit to invoices whose tax looked unlike `0%` or approximately `20%`.
- Mistake: Called `get_invoice` for only the three tax anomalies, then treated a few client tax spot-checks as sufficient coverage. It should have checked every non-void invoice’s unique student–lesson charges against lesson, attendance, and tax records.
- Mistake: Omitted `INV-05791`, `INV-05821`, `INV-05846`, `INV-05877`, `INV-06017`, `INV-06060`, `INV-06073`, `INV-06080`, and `INV-06097`.
- Mistake: The final claim that tax flags matched 'everywhere except those three invoices' exceeded the checks performed.

**Code mode: failed.** Returned nine correct overcharges but omitted all three duplicate-billing invoices. The queried span contains only the opening prompt, so the exact faulty code step is not observable. ($0.30, 23 requests, 79 s)
- Right: Correctly reported nine of twelve expected rows, including the tax errors and missed-student charges omitted by tools mode.
- Right: All nine reported amounts match the expected values.
- Mistake: The final result omitted `INV-06060: 3563`, `INV-06073: 4500`, and `INV-06097: 9900`, the three invoices identified by the separate duplicate-lines case.
- Mistake: A complete audit needed to enforce one charge per `(lesson_id, student_id)` and include duplicate charges in each invoice’s excess. The available transcript does not establish how that check was omitted.

### small-wrong_invoices-1

**Tool calling: passed.** Correctly found all four overcharged invoices, covering duplicate billing, tax, rate, and attendance errors. ($0.50, 10 requests, 2.2 min)
- Right: Fetched all `37` October invoices with `get_invoice`, four September lesson pages, attendance batches, and client tax records.
- Right: Returned `INV-00158: 4050`, `INV-00162: 863`, `INV-00172: 600`, and `INV-00176: 6000`.
- Right: Explicitly recognized the duplicate-line error that code mode missed.
- Mistake: Collected the full September lesson range rather than retrieving only the lessons referenced by invoice lines, increasing data volume.

**Code mode: failed.** Repriced the invoice lines and found three correct overcharges, but missed the `4050`-pence duplicate charge on `INV-00158`. ($0.17, 13 requests, 74 s)
- Right: Collected `37` invoices, `325` lines, `280` distinct lessons, and `331` attendance records.
- Right: Correctly implemented billability, attendance eligibility, split pricing, taxability, and half-up rounding.
- Right: Returned correct amounts for `INV-00162: 863`, `INV-00172: 600`, and `INV-00176: 6000`.
- Mistake: In the repricing loop, `for line in inv["lines"]` added `c_tot` to `correct_total` for every occurrence without tracking `(lesson_id, student_id)`. It therefore counted the duplicate as a legitimate second charge. It should have priced each unique pair once.
- Mistake: The fifth `run_code` call passed all `280` lesson IDs to `get_lessons`, violating its `100`-ID limit; recovered with batches of `100`, `100`, and `80`.
- Mistake: The tenth `run_code` call used `next(i for i in full_invoices ...)`, producing `TypeError: 'list' object is not an iterator` under Monty. Recovered with an explicit loop.
- Mistake: Later verification revisited detected mismatches and pricing samples without adding a duplicate check.

### large-correction-2

**Tool calling: passed.** Correctly changed Yara’s attendance, voided `INV-06372`, and created `INV-06548` for `17100` pence, paid automatically from released credit. ($0.033, 5 requests, 18 s)
- Right: Used `get_invoice`, `get_lessons`, `list_attendance`, `get_client`, `get_settings`, and `list_allocations` to establish the affected records.
- Right: Called `update_attendance` for `LS-045235`/`ST-0332`, `void_invoice` dated `2026-11-13`, then `create_invoice` with the three remaining lessons.
- Right: Retained the `missed_chargeable` lesson; the replacement had net `14250`, tax `2850`, and due date `2026-11-27`.
- Mistake: The final summary expressed the total as `£171.00`, despite the handbook requiring integer pence.

**Code mode: passed.** The supplied changes exactly match the required correction and reissue. The queried Logfire conversation contains only the opening user message, so execution code cannot be assessed. ($0.041, 6 requests, 3 s)
- Right: Changed `LS-045235`/`ST-0332` to `missed` and voided the original `22800`-pence invoice.
- Right: Created the three-line replacement for `17100` pence, dated `2026-11-13`, due `2026-11-27`, and paid from released credit.
- Right: Released the original `22800` allocation and applied `17100` to the replacement.

### large-record_payment-1

**Tool calling: passed.** Recorded Jane Kelly’s `50126`-pence payment correctly, settling the oldest unpaid invoice and partially paying the next. ($0.045, 5 requests, 24 s)
- Right: Used `search_clients`, `list_invoices`, `list_ledger_entries`, and `list_allocations` to identify `CL-0294` and existing payments.
- Right: Calculated `58778 - 21152 = 37626` remaining on `INV-02840`.
- Right: Called `record_payment` dated `2026-11-13` with allocations of `37626` to `INV-02840` and `12500` to `INV-03247`.
- Mistake: The final wording 'left 12500 pence on INV-03247' is ambiguous: `12500` was allocated, while `12504` remained outstanding.
- Mistake: Fetched `get_settings` and `get_client`, although neither was needed to calculate these allocations.

**Code mode: passed.** The supplied changes correctly record and allocate the `50126`-pence payment. Execution steps are absent from the queried conversation. ($0.044, 5 requests, 15 s)
- Right: Recorded the payment for `CL-0294` on `2026-11-13`.
- Right: Allocated `37626` to settle `INV-02840` and `12500` to partially pay `INV-03247`.
- Right: The final summary correctly distinguished settlement from partial allocation.
- Mistake: The final summary used pounds (`£501.26`, `£376.26`, and `£125.00`) instead of the required integer pence.
