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

# Gemini 4 Neon on Pydantic AI Accounting

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

| Mode         | Score | Tasks passed | Cost   | Requests | Tool calls | Time     |
| ------------ | ----- | ------------ | ------ | -------- | ---------- | -------- |
| Tool calling | 100%  | 10 of 10     | $12.76 | 91       | 1074       | 48.5 min |

Each task was run once per mode.

## Review

Written by an LLM from the runs' transcripts.

#### Overall

The model passed all 20 runs: 10 cases, each run once with tools and once in code mode. Request counts were similar in both modes (91 with tools, 88 in code mode). Cost was not: $12.76 with tools against $1.82 in code mode, about 7× more. The mistakes the reviewers noted were inefficiencies or unverified assumptions, not wrong answers.

#### Where it does well

- **Write tasks are careful and correctly ordered.** In `large-correction-2` it updated attendance, then voided the invoice, then reissued it, then checked allocations. In `large-record_payment-1` it allocated oldest due date first (37626 to INV-02840, 12500 to INV-03247). In both it gathered state before changing anything and verified the result afterwards.
- **It applies the handbook's business rules correctly:**
  - It counts only unreleased allocations (`small-owed_on_invoices-1`, 85204).
  - It catches tax charged to non-taxable clients.
  - It pays tutors for lessons where every student missed while charging clients nothing.
  - It excludes void invoices.
  - It uses half-up rounding per line.
- **Audit-style cases come out exact.** `large-wrong_invoices-1` returned all 12 overcharged invoices with exact amounts in both modes.
- **Code mode verifies its own work.** In `large-tutor_margin-3` it compared 74 computed lines with the real invoice lines and found 0 mismatches. In `small-owed_on_invoices-1` it checked the answer against the ledger balance.

#### Mistakes it makes

- **Unnecessary calls.** All four tutor-margin runs fetched payment orders that the answer did not need. Several runs fetched void invoices, out-of-period invoices, or all clients after the answer was already settled.
- **Unchecked pagination.** Some runs relied on page 1 without confirming there were no further pages: `large-record_payment-1` and `small-tutor_margin-3` in code mode, and `large-tutor_margin-3` with tools. The answers were still correct.
- **Code-mode execution errors.** Four runs hit the 100-nested-call limit before switching to batches of about 95. Other failures included `next()` called on a list (2 runs), a `globals()` NameError, and a broken pagination loop. Each error cost one `run_code` request.
- **One logic slip, later fixed.** In `small-wrong_invoices-1` the first pass reported INV-00158 as having no overcharge because it did not handle the duplicate line correctly.
- **Opaque reasoning in tool mode.** The tutor-margin answers in tool mode show no visible arithmetic. `large-missed_billed-1` relied on the attendance "invoiced" flag as a shortcut and looked only at September lessons.

#### Tool calling compared with code mode

Both modes reached the same accuracy (10/10 each). The difference is cost on bulk work:

| Case                      | Tools                                 | Code mode |
| ------------------------- | ------------------------------------- | --------- |
| `large-wrong_invoices-1`  | $5.53                                 | $0.48     |
| `large-duplicate_lines-1` | $2.87 (about 390 `get_invoice` calls) | $0.19     |
| `large-missed_billed-1`   | $1.97                                 | $0.15     |
| `small-wrong_invoices-1`  | $1.25                                 | $0.38     |

On small lookups, tool calling was slightly cheaper. For example, `small-invoice_total-1` cost $0.026 with tools against $0.037 in code mode, and `large-correction-2` cost $0.116 against $0.129.

Code mode also produced checkable computations, such as exact recomputation and cross-checks. Its costs are occasional crashes from limits and bugs, each of which wastes a request.

**Recommendation:** use code mode for multi-record audits and calculations. Either mode is fine for simple lookups and writes.

## Runs

### small-invoice_total-1

**Tool calling: passed.** The agent made a single get_invoice call for INV-00084, read the stored total of 89700 and returned it. That matches the expected answer. ($0.026, 2 requests, 9 s)
- Right: Read the invoice total straight from the record, which is all this question needed, and did not recompute it.
- Right: Answered in two calls and gave the figure in pence as an integer.

### small-owed_on_invoices-1

**Tool calling: passed.** The agent found Emeka Brown (CL-0007), listed the unpaid invoices INV-00155 (39452) and INV-00192 (49315) and the client's allocations, subtracted the one unreleased allocation on INV-00155 (3563), and answered 85204, which is correct. ($0.062, 4 requests, 19 s)
- Right: Identified both unpaid invoices and checked allocations rather than summing invoice totals naively (88767).
- Right: Correctly subtracted the 3563 credit allocation (id 169, released_on None) applied to INV-00155, giving 39452-3563+49315=85204.
- Right: Ran calls in parallel and finished quickly.
- Mistake: Called list_ledger_entries and an unfiltered list_invoices that the answer did not need. These calls were redundant, though they did no harm.

### large-tutor_margin-3

**Tool calling: passed.** The agent fetched settings, the tutor, all of Chen Mensah's October 2026 lessons, their attendance and the tutor's payment orders. It spot-checked several client invoices to confirm gross/non-taxable net handling and split rounding, then submitted 120741, which matches the expected answer. ($0.53, 7 requests, 4.0 min)
- Right: Filtered list_lessons by tutor_id TU-002 and the date range 2026-10-01 to 2026-10-31, so lessons were counted by the date they took place.
- Right: Got attendance for all 67 lessons in one list_attendance call.
- Right: Checked real invoice lines to confirm its handling of non-taxable clients: CL-0097 has tax 0 and net equal to cost.
- Right: Checked real invoice lines to confirm gross pricing: INV-06406 has 2125 total with 1771 net, and 7500 total with 6250 net.
- Right: Checked real invoice lines to confirm split rounding: 1313 per student for a 5250 rate split four ways.
- Right: Final answer matches the expected 120741.
- Mistake: The arithmetic is not visible in the transcript, so it is unclear whether the margin was computed rigorously or only partly confirmed by the invoice spot-checks.
- Mistake: Calling list_payment_orders was unnecessary, since margin should be computed from the lessons' tutor rates and not from payment orders.
- Mistake: The list_lessons result showed page 1 but the transcript does not show a check that there was no second page; the answer still matched.

### small-tutor_margin-3

**Tool calling: passed.** The agent looked up tutor Kai Iyer and listed his October 2026 lessons, attendance and the taxable status of each client. It checked two November invoices to confirm how gross-priced lines were netted, then answered 65045 pence, which matches the expected figure. ($0.30, 7 requests, 2.2 min)
- Right: It filtered list_lessons by tutor TU-001 and the full October range, 2026-10-01 to 2026-10-31, both ends included.
- Right: It pulled attendance for all 39 lessons in one call, so missed students could be left out of the charges.
- Right: It fetched every client involved to check is_taxable. CL-0030 and CL-0037 are non-taxable, so the cost counts as net even on gross-priced lessons.
- Right: It used invoices INV-00187 (taxable, gross Piano lesson LS-001408 with net 4687) and INV-00220 (non-taxable, gross History lesson with net 5500) to confirm how gross-priced lines are netted.
- Right: It counted lessons by the date they took place, not by whether they had been invoiced, as the handbook requires.
- Mistake: It called list_payment_orders, which turned out not to be needed: the November order covers more than one tutor's lesson pay set, and the tutor rate per lesson was already in the lesson records.
- Mistake: No working is shown in the transcript, so the final figure cannot be traced step by step. The run seems to have done the calculation in its head and still got it right.

### large-duplicate_lines-1

**Tool calling: passed.** The agent listed all October 2026 invoices over 4 pages, fetched every invoice's lines with get_invoice, and returned INV-06060, INV-06073 and INV-06097. This matches the expected answer and the run passed. ($2.87, 12 requests, 7.9 min)
- Right: Paged through list_invoices with sent_from/sent_to filters for October 2026 until all invoices were retrieved.
- Right: Fetched the line-level detail of every non-void invoice, which the question needs because duplicates only show at line level.
- Right: Left out void invoices and correctly kept their reissued replacements (e.g., INV-06146, INV-06151), since cross-invoice overlaps are not same-invoice duplicates.
- Right: Final answer matches the expected IDs exactly.
- Mistake: After the full sweep, the agent also fetched void invoices (INV-05817, INV-05959, INV-06069, etc.) that the question says to leave out. These calls were wasted, though they did no harm.
- Mistake: Very costly approach: roughly 390 get_invoice calls with no visible programmatic check for duplicates. The middle of the transcript was cut, so it is unclear how the duplicates were found, but the result was correct.

### large-missed_billed-1

**Tool calling: passed.** The agent listed the October 2026 invoices and pulled attendance for every September lesson. It looked for rows marked 'missed' but invoiced=True, matched them to non-void invoices, checked the candidate lessons and returned the three correct invoice IDs. ($1.97, 13 requests, 7.9 min)
- Right: Paged through every October invoice and every September lesson's attendance in batches of 100 IDs.
- Right: Used the 'invoiced' flag on attendance rows to spot students marked 'missed' who were still invoiced (e.g. LS-044224 / ST-0088 / CL-0065).
- Right: Confirmed each candidate by fetching the invoice (INV-05821, INV-05846, INV-06080) and checking the lesson line was on it.
- Right: Left out void invoices, using INV-05811 vs its re-issue INV-06146 to see how voiding and re-invoicing work.
- Mistake: It only looked at lessons from September 2026. Invoices sent in October could in principle cover earlier uninvoiced lessons, for example ones re-invoiced after a void. This was not checked, though it happened not to matter.
- Mistake: It fetched many re-issued invoices (INV-06145 to INV-06154) and the void-invoice list for Jan–Sep without a clear use, which wasted requests.
- Mistake: Relying on the attendance 'invoiced' flag was a shortcut: a flag left set from a voided invoice could mislead. The agent did check the candidate invoices, but other missed students could have been charged without the flag being set.

### large-wrong_invoices-1

**Tool calling: passed.** The agent listed every invoice sent in October 2026 and pulled the lines of each one. It checked suspicious lines against lesson, attendance and client records, which turned up wrongly taxed lines for non-taxable clients and charges that were wrong or duplicated. It returned 12 overcharged invoices and amounts, matching the expected answer exactly. ($5.53, 25 requests, 19.4 min)
- Right: Paged through all 4 pages of list_invoices for October and fetched invoice details, so it had the full set.
- Right: It caught tax wrongly applied to non-taxable clients by checking is_taxable on the client. For example, INV-05851 and CL-0097 gave 1050, INV-06016 and CL-0270 gave 1150, and INV-06105 and CL-0361 gave 1875.
- Right: It cross-checked lesson rates and attendance with get_lessons and list_attendance before deciding a line was wrong. For example, LS-043580 turned out to be a single Spanish lesson charged twice in INV-05851.
- Right: Left void invoices out as asked, and compared voided invoices with their reissues (INV-05811 against INV-06146, INV-05959 against INV-06147, INV-06079 against INV-06152) to see why lessons had been dropped.
- Right: The amounts it returned are exact pence integers.
- Mistake: The run was very expensive: it fetched almost every October invoice one by one, which produced a huge transcript (about 485k characters were cut).
- Mistake: It fetched September and November invoice lists and searched all clients with search_clients(name=''); none of this was clearly needed to answer an October question.

### small-wrong_invoices-1

**Tool calling: passed.** The agent pulled all 37 October invoices with their lines, the September lessons, attendance and client tax flags. It found four overcharged invoices: a duplicated line in INV-00158 (4050), tax wrongly charged to a non-taxable client on INV-00162 (863), a wrong rate on INV-00172 (600) and an extra charge on INV-00176 (6000). The answer matched the expected result and the run passed. ($1.25, 8 requests, 5.5 min)
- Right: It fetched every October invoice with get_invoice and set them against the lesson records (list_lessons pages 1-4) and the attendance records (list_attendance), so the check was systematic.
- Right: It called get_client for every client to read is_taxable, which caught that INV-00162 (CL-0014, not taxable) carried 863 of tax on line LS-001133.
- Right: It spotted the duplicate LS-001226 line in INV-00158 (4050).
- Right: It checked for void October invoices (list_invoices with status 'void' returned none), as the question requires.
- Right: It cross-checked the suspect clients' invoice histories before answering.
- Mistake: Fetching all 37 clients and all of the September attendance was heavy, though it was arguably needed to find every error. The later list_ledger_entries call and the per-client list_invoices calls added little.

### large-correction-2

**Tool calling: passed.** The agent marked ST-0332 as missed for LS-045235, voided INV-06372 dated 2026-11-13, and created a new invoice INV-06548 for the three remaining October lessons. The system auto-paid it from released credit. The state changes match the expected answer exactly. ($0.12, 7 requests, 38 s)
- Right: Gathered settings, invoice lines, lessons, attendance and allocations before changing anything, which confirmed the four lines and the one_off net pricing.
- Right: Did the steps in the right order: update_attendance to missed, then void_invoice dated 2026-11-13, then create_invoice dated 2026-11-13 with only LS-045914, LS-046583 and LS-047246.
- Right: Checked the result afterwards by re-listing attendance and allocations.
- Right: The summary's figures were correct: new total 17100 paid from released credit 22800, leaving 5700 unallocated.
- Mistake: Minor redundancy: list_lessons for October repeated data already returned by get_lessons, and list_invoices was not really needed.

### large-record_payment-1

**Tool calling: passed.** The agent looked up Jane Kelly (CL-0294), checked her unpaid invoices and existing allocations, and recorded a 50126p payment dated 2026-11-13. It allocated 37626p to INV-02840 (the oldest due, partly paid) and 12500p to INV-03247. The result matched the expected changes exactly. ($0.11, 6 requests, 34 s)
- Right: Converted £501.26 to 50126 pence and dated the payment today (2026-11-13).
- Right: Checked list_allocations and the ledger to find what was still owed on INV-02840 (58778 total, 21152 already allocated, 37626 remaining) before allocating.
- Right: Applied the payment oldest due date first: it cleared INV-02840 and put the remaining 12500 on INV-03247, as the handbook requires.
- Right: Called get_invoice on both invoices afterwards to confirm INV-02840 was now paid and INV-03247 was still unpaid.
- Mistake: No substantive mistakes. The allocated-to-date figure for INV-02840 (21152) came from the truncated allocation/ledger output. The transcript does not show the agent explicitly checking that the earlier allocations on INV-02840 had no released_on date, though the result was correct.
