---
title: "Gemini 3.8 Flash on Pydantic AI Accounting"
description: "Questions about and changes to a tutoring agency's books, checked to the penny. Tool calling 70%, code mode 100%; rank 12 of 20."
canonical: https://models.pydantic.dev/models/gemini-3.8-flash/accounting_platform/
---

# Gemini 3.8 Flash on Pydantic AI Accounting

> Questions about and changes to a tutoring agency's books, checked to the penny. Tool calling 70%, code mode 100%; rank 12 of 20.
>
> Markdown copy of https://models.pydantic.dev/models/gemini-3.8-flash/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>`

Add `intent=<intent>&stack=<stack>&harness=<harness>` to the query string of the first three. An `OPTIONS` request to any endpoint returns its schema. The same four 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/gemini-3.8-flash.md

| Mode         | Score | Tasks passed | Cost  | Requests | Tool calls | Time     |
| ------------ | ----- | ------------ | ----- | -------- | ---------- | -------- |
| Tool calling | 70%   | 7 of 10      | $2.30 | 188      | 702        | 34.0 min |

Each task was run once per mode.

## Review

Written by an LLM from the runs' transcripts.

#### Overall

The model passed **17 of 20** runs: **7/10 in tool calling** and **10/10 in code mode**. All three failures were tool-calling runs on audit-style tasks that require checking hundreds of invoice lines. Code mode cost about **$1.00 in total** against **$2.30** for tool calling, with similar request counts (200 vs 188).

#### Where it does well

- **Simple lookups and writes are reliable in both modes.** `invoice_total` (2 requests), `owed_on_invoices`, `record_payment` and `correction-2` all passed. In these runs it read state before writing, put steps in the right order (attendance → void → reissue), allocated payments oldest-due first and accounted for existing allocations (37626 outstanding, not 58778).
- **It applies the handbook rules correctly.** It worked in integer pence, excluded void invoices, used net-of-tax margins, and in code mode used Decimal half-up rounding and charged-student splits.
- **Code mode verifies its own answers.** In the `tutor_margin` runs it reconciled its figures against actual invoice lines and payment orders (PO-0041 = 122390). In `wrong_invoices` it checked that header totals equal the sum of their lines.

#### Mistakes it makes

- **Spot-checking instead of recomputing (tools).** In `large-wrong_invoices-1` it looked only for tax on non-taxable clients and found 3 of 12 invoices. In `small-wrong_invoices-1` it compared lines by eye and missed INV-00172's 600 overcharge, even though it had the lesson record.
- **No request budgeting (tools).** In `large-missed_billed-1` it spent about 25 calls on clean reissued invoices, then paged through roughly 3000 September lessons. It hit the 60-request limit holding 2 of 3 answers and returned nothing.
- **Code-mode friction.** It repeatedly guessed response keys (`invoices`/`total_pages` instead of `items`/`pages`), used `next()` on lists, imported `pprint`, which was unavailable, and exceeded the 100-nested-call limit per `run_code`. In `large-wrong_invoices-1` it used up the 1000-suspension sandbox budget and had to re-fetch everything. None of these errors changed an answer.
- **Redundant calls in both modes**, such as repeated allocation lookups and unneeded `get_client` calls for taxability. In several tool-calling runs the final arithmetic was not shown, so the correct answers could not be traced step by step.

#### Tool calling compared with code mode

|                | Tools | Code mode |
| -------------- | ----- | --------- |
| Pass rate      | 7/10  | 10/10     |
| Total cost     | $2.30 | $1.00     |
| Total requests | 188   | 200       |

- **Bulk scanning is where code mode pulls ahead.** `large-duplicate_lines-1` cost $0.618 in 27 requests with tools (about 400 `get_invoice` calls) and $0.034 in 13 requests in code mode. `large-missed_billed-1` failed with tools at $0.775 and passed in code mode in 18 requests for $0.068. Both `wrong_invoices` cases passed only in code mode, because the code recomputed every line systematically.
- **On small tasks tools are slightly cheaper.** For example, `record_payment` cost $0.030 with tools against $0.043 in code mode, and `owed_on_invoices` cost $0.027 against $0.040.
- **Recommendation:** use code mode for any task that requires checking many records.

## Runs

### small-invoice_total-1

**Tool calling: passed.** The agent called get_invoice for INV-00084, read the stored total of 89700 pence, and returned it. This matches the expected answer. ($0.0063, 2 requests, 7 s)
- Right: Used the single right tool call (get_invoice) and read the invoice's stored 'total' field (89700) directly, with no unneeded recomputation.
- Right: Gave the answer in integer pence as the handbook requires.

### small-owed_on_invoices-1

**Tool calling: passed.** The agent found client CL-0007 and listed their invoices, picking out the two unpaid ones (INV-00155 total 39452, INV-00192 total 49315). It subtracted the single unreleased allocation of 3563 on INV-00155 and answered 85204, which is correct. ($0.027, 7 requests, 28 s)
- Right: It used the handbook rule that what is still owed on an unpaid invoice is its total less the allocations applied to it: (39452-3563)+49315 = 85204.
- Right: It checked allocations per invoice for INV-00155 and INV-00192 to confirm only one allocation of 3563, not released, applied to the unpaid invoices.
- Right: It ignored the void invoice INV-00032 and did not use the ledger balance as the answer.
- Mistake: The list_allocations calls for INV-00155 and INV-00192 repeated data already returned by the client-level allocation call. The list_ledger_entries call was also not needed. These calls were harmless but wasted requests.

### large-tutor_margin-3

**Tool calling: passed.** The agent pulled Chen Mensah's (TU-002) October 2026 lessons and their attendance, looked up the clients' taxable flags and sampled a few November invoices. It answered a margin of 120741 pence, which matches the expected answer. ($0.18, 12 requests, 3.8 min)
- Right: Found the tutor ID TU-002 and limited list_lessons to 2026-10-01 to 2026-10-31, counting lessons by the date they took place as the handbook requires.
- Right: Fetched attendance for all 75 lessons in a single list_attendance call.
- Right: Checked the sampled invoice lines (INV-06194, INV-06213, INV-06243) against its own per-student pricing, including hourly_split shares such as 1313 vs 1750 when fewer students were charged.
- Mistake: It made about 18 get_client calls to read is_taxable, which does not affect the margin: the margin is the charge net of tax, and every lesson in the list was priced 'net', so the net amount is simply the cost.
- Mistake: The list_payment_orders call and the list_invoices call for 2026-11-01 were not needed for the margin and only partly served as cross-checks.
- Mistake: The final arithmetic is not shown anywhere in the transcript, so the 120741 total cannot be traced step by step, though it is correct.

### small-tutor_margin-3

**Tool calling: passed.** The agent found tutor TU-001 and listed Kai Iyer's 39 October lessons and their attendance. It checked client taxability and cross-checked invoice line net amounts against several clients' 1 Nov invoices, then submitted 65045, which matches the expected answer. ($0.14, 26 requests, 2.6 min)
- Right: Looked up the tutor ID and the tax setting, then pulled all October lessons for TU-001 with list_attendance in a single batched call.
- Right: Checked each client's is_taxable flag (CL-0030 and CL-0037 are non-taxable), which matters for the net amount on gross-priced lessons.
- Right: Used the November invoices' line nets (e.g. LS-001408 gross 5625 → net 4687 for taxable CL-0002, and LS-001398 net 5500 for non-taxable CL-0037) to confirm the net-of-tax charge per line.
- Right: Got the correct final figure of 65045.
- Mistake: Wasteful calls: list_payment_orders was fetched but is not needed for margin, since tutor pay comes from lesson tutor_rate and the November payment order covers all lessons, not just this tutor's October ones.
- Mistake: Called list_invoices for CL-0001 without opening the invoice, so the cross-check was uneven. The arithmetic was never shown in the transcript, so how the final figure was reached cannot be checked.

### large-duplicate_lines-1

**Tool calling: passed.** The agent listed the October 2026 invoices across four pages, then fetched invoice details one by one to find lines repeating the same lesson and student. It checked three suspect lessons with list_attendance and returned INV-06060, INV-06073 and INV-06097, which matches the expected answer. ($0.62, 27 requests, 4.9 min)
- Right: It paged through list_invoices for the whole October range, pages 1 to 4.
- Right: It left out void invoices such as INV-05811, INV-05817, INV-06069 and INV-06085 and did not confuse the reissued replacements with duplicates.
- Right: It confirmed the three suspect lessons (LS-044150, LS-042250, LS-044126) with list_attendance. Each had a single attendance row for the student, which shows the extra invoice lines were genuine duplicates.
- Right: The final answer matched the expected set exactly.
- Mistake: It used a very large number of get_invoice calls, roughly 400 or more, one per invoice. This was the only route the tools allowed, but it was costly.
- Mistake: Early on it went down a side path, comparing void and reissued invoice pairs and calling list_lessons for all of September. That had no bearing on spotting duplicate lines inside one invoice.
- Mistake: It fetched page 4 before page 3, so the order of work was haphazard. It did still cover every page.

### large-missed_billed-1

**Tool calling: error.** The agent tried to find October 2026 non-void invoices with a line for a student marked 'missed'. It spent many calls on void/reissued invoices and then brute-forced attendance for every September lesson page by page. It hit the 60-request limit before answering. Along the way it had found INV-05846 and INV-06080 (two of the three expected), but it never reported anything. ($0.77, 60 requests, 15.5 min)
- Right: Correctly understood that void invoices should be excluded and that the task is to cross-check invoice lines against attendance status 'missed'.
- Right: Found INV-05846 (CL-0092) and INV-06080 (CL-0334) as candidates by spotting the anomalies in the attendance data, and fetched those invoices.
- Right: Batched list_attendance calls with 100 lesson IDs each, which made the brute-force scan less costly.
- Mistake: Spent about 25 early calls (get_invoice on each void invoice and its reissue INV-06145..INV-06154, plus list_attendance on each) checking reissued invoices. These were all clean, so the calls yielded nothing.
- Mistake: Chose to page through every September lesson (list_lessons pages 1–21+) and then fetch attendance for each block. With ~3000 lessons this could never fit in a 60-request budget. Mismatches only show up by comparing attendance against invoice lines, so this scan was costly.
- Mistake: Did not budget its requests or give a partial answer. By the end it had evidence for INV-05846 and INV-06080 but never wrote a final reply, so the run produced no output.
- Mistake: Never confirmed which line of INV-05846 or INV-06080 matched a 'missed' attendance, and never found INV-05821.

### large-wrong_invoices-1

**Tool calling: failed.** The agent was asked to find October 2026 invoices (excluding void ones) that charge the wrong amount and give the overcharge for each. It found only the three invoices where tax was wrongly put on a non-taxable client's line (INV-05851, INV-06016, INV-06105) and missed the other 9 overcharged invoices in the expected answer. ($0.22, 19 requests, 2.1 min)
- Right: Paged through all four pages of October invoices.
- Right: Spotted invoices whose summary showed tax on non-taxable clients, checked is_taxable with get_client, and got the correct overcharge for those three (1050, 1150, 1875).
- Right: Correctly left out void invoices such as INV-05811, INV-06100 and INV-06069.
- Mistake: It only looked for one kind of error: tax charged to non-taxable clients. It never recomputed line amounts against lesson rates, lengths and charge types. So it missed overcharges like INV-05821: line LS-042180 is a gross 45-minute lesson at 6500/hr, so its total should be 4875, but the expected overcharge for INV-05821 is 4875, which suggests a duplicate or extra line.
- Mistake: It fetched INV-05821 and INV-05834 and the lesson LS-042180 but drew no conclusion from them. It never checked attendance for those invoices' lines to find lines for missed students, cancelled lessons or duplicated lessons.
- Mistake: After seeing INV-05811 wrongly bill a 'missed' lesson (LS-042858), it did not run that same attendance check across the non-void October invoices. Missed-student lines, unbillable lessons, wrong split amounts and similar errors would explain INV-05791, INV-05846, INV-05877, INV-06017, INV-06060, INV-06073, INV-06080 and INV-06097.
- Mistake: It made unproductive calls (search_clients with 'a', credit-note ledger pages, a list of November invoices, all of September's lessons) without using them to check invoice lines systematically. It then submitted after checking only a handful of invoices.

### small-wrong_invoices-1

**Tool calling: failed.** The agent pulled every October 2026 invoice, every client and all September lessons and attendance, then reported three overcharged invoices: INV-00158 (4050), INV-00162 (863) and INV-00176 (6000). It missed the fourth, INV-00172 (600), so the run failed. ($0.28, 22 requests, 2.8 min)
- Right: Fetched settings and every October invoice with get_invoice, so every line was available to check.
- Right: Caught the duplicated LS-001226 line on INV-00158 (4050) by checking the lesson and its single attendance record.
- Right: Caught the 863 tax wrongly charged on LS-001133 for non-taxable client CL-0014 on INV-00162.
- Right: Looked up every client's is_taxable flag and paged through all September lessons and attendance to check pricing.
- Right: Identified the 6000 overcharge on INV-00176 for non-taxable client CL-0030.
- Mistake: Missed INV-00172 (CL-0025). Its line for LS-001295 on 2026-09-23 is net 6500, tax 1300, total 7800. The same Spanish lesson for the same student is 6000/1200/7200 on every other week, so the client was overcharged 600 on that line. The agent had the lesson record (list_lessons page 3) but evidently never compared that line's amount against the lesson's charge_rate.
- Mistake: The checks were done by eye rather than by recomputing every line from charge_type, charge_rate, duration, attendance and taxability. That is how an obvious odd-one-out line amount slipped through.
- Mistake: The run was inefficient: dozens of separate get_client and get_invoice calls, yet still no complete line-by-line reconciliation.

### large-correction-2

**Tool calling: passed.** The agent marked ST-0332 as missed on LS-045235, voided the paid invoice INV-06372 dated 2026-11-13, and created INV-06548 for the three remaining lessons. The released credit paid the new invoice automatically. The result matches the expected changes and the run passed. ($0.026, 7 requests, 37 s)
- Right: Read the invoice and settings first and confirmed the 7 Oct lesson was LS-045235 before changing anything.
- Right: Changed attendance to 'missed' before voiding, so the new invoice could not pick up that lesson.
- Right: Voided INV-06372 and created the replacement with date 2026-11-13. The replacement has exactly the three remaining lesson lines (LS-045914, LS-046583, LS-047246).
- Right: Ran a final list_attendance check showing the void had freed LS-045235 (invoiced False) and the other three lessons were on the new invoice.
- Mistake: The agent never checked whether CL-0234 had other uninvoiced billable lessons up to 31 October that should also go on the reissued invoice. It worked out here, but it was an unverified assumption.
- Mistake: Minor: the summary did not say that the 22800 released from the voided invoice became credit, that 17100 of it paid INV-06548 in full, or that 5700 is left as unallocated credit.

### large-record_payment-1

**Tool calling: passed.** The agent found Jane Kelly (CL-0294) and pulled her invoices, allocations and ledger entries. It recorded a 50126p payment dated 2026-11-13, allocating 37626 to clear INV-02840 (the oldest unpaid invoice) and the remaining 12500 to INV-03247. This matched the expected changes and the run passed. ($0.030, 6 requests, 68 s)
- Right: Converted £501.26 to 50126 pence correctly.
- Right: Checked existing allocations before allocating, so INV-02840's outstanding amount came out as 37626 rather than its full 58778 total.
- Right: Allocated oldest due date first: INV-02840 (due 2026-02-15) was cleared before the leftover went to INV-03247.
- Right: The payment was dated today and was recorded in one record_payment call with no extra or mistaken writes.
- Mistake: The transcript shows no computation of the outstanding amounts, and the allocation output for INV-02840 was truncated in view. The 37626 figure is right per the expected answer, but its derivation from the visible data cannot be checked.
