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

# Gemini 4 Hydrogen on Pydantic AI Accounting

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

| Mode         | Score | Tasks passed | Cost  | Requests | Tool calls | Time     |
| ------------ | ----- | ------------ | ----- | -------- | ---------- | -------- |
| Tool calling | 90%   | 9 of 10      | $5.76 | 83       | 733        | 27.3 min |

Each task was run once per mode.

## Review

Written by an LLM from the runs' transcripts.

#### Overall

The model passed 18 of 20 runs: 9 of 10 in tools mode and 9 of 10 in code mode. Each mode failed one "wrong_invoices" audit, and the two failures were on different cases. Both modes used 83 requests in total, but costs differed sharply: about $5.76 for tools and about $0.74 for code mode.

#### Where it does well

- **Write tasks:** It completed both modes of `large-correction-2` (attendance update, void, reissue) and `large-record_payment-1` with exactly the expected end state.
  - It followed the requested step order.
  - It converted £501.26 to 50126p.
  - It allocated payments oldest-due-first.
  - It kept November lessons off the reissued invoice.
- **Lookups and arithmetic:** It answered `invoice_total` and `owed_on_invoices` correctly in 2–5 requests. It handled unreleased allocations correctly (85204).
- **Tutor margin:** It got both margin cases right in both modes (120741 and 65045).
  - It applied the gross-tax netting, split-lesson and non-taxable-client rules correctly.
  - In code mode it checked its computed lines against real November invoices (74 and 33 lines, 0 mismatches). It also checked tutor pay against payment orders.

#### Mistakes it makes

- **Incomplete audits:** Both failures were partial coverage of overcharge checks.
  - In tools mode, `large-wrong_invoices-1` opened only about 25 of roughly 390 invoices. It relied mainly on attendance "invoiced" flags and found 6 of 12 overcharged invoices, missing those with wrong rates or split counts.
  - In code mode, `small-wrong_invoices-1` repriced every line but never checked for duplicate (lesson, student) lines. It therefore missed INV-00158's 4050 overcharge.
- **Wasted calls:** Common examples:
  - unneeded `list_payment_orders` or unfiltered `list_invoices` calls
  - about 30 pages of lesson listings in `large-missed_billed-1`
- **Code-mode errors:**
  - It hit the 100-nested-call limit twice before batching.
  - It hit a TypeError once and a NameError once.
  - One pagination loop stopped after page 1 without checking `pages`.
- **Unauditable answers:** In tools mode, margin answers sometimes appeared without any visible calculation.

#### Tool calling compared with code mode

| Mode      | Passed | Requests | Cost   |
| --------- | ------ | -------- | ------ |
| tools     | 9/10   | 83       | ~$5.76 |
| code_mode | 9/10   | 83       | ~$0.74 |

- **Small tasks:** Costs were similar ($0.01–$0.08), and tools mode was sometimes slightly cheaper.

- **Large data-scanning tasks:** Code mode was much cheaper:

  | Case                      | tools | code_mode |
  | ------------------------- | ----- | --------- |
  | `large-missed_billed-1`   | $2.35 | $0.067    |
  | `large-wrong_invoices-1`  | $1.77 | $0.22     |
  | `large-duplicate_lines-1` | $0.79 | $0.057    |

- **Thoroughness:** Code mode was also more thorough on large audits. It repriced all 384 non-void invoices in `large-wrong_invoices-1` and found all 12, where tools mode found 6. It also verified its own results more often.

- **Trade-off:** Code mode adds its own failure types (call limits and coding errors). It can still miss a whole category of check, as `small-wrong_invoices-1` shows.

- **Recommendation:** For bulk reconciliation, prefer code mode.

## Runs

### small-invoice_total-1

**Tool calling: passed.** The agent made one get_invoice call for INV-00084, read the stored total of 89700 and returned it. This matched the expected answer. ($0.014, 2 requests, 4 s)
- Right: It went straight to get_invoice and used the invoice's recorded 'total' field (89700). The question asks about an existing invoice, so the stored figure is the right source and nothing needed recomputing.
- Right: It used only two calls and no redundant steps.

### small-owed_on_invoices-1

**Tool calling: passed.** The agent found client CL-0007, listed the two unpaid invoices (39452 and 49315) and their allocations (only 3563 on INV-00155, not released), and answered 39452−3563+49315 = 85204. This matches the expected answer. ($0.028, 4 requests, 24 s)
- Right: Filtered invoices by status 'unpaid' for CL-0007 and got both INV-00155 and INV-00192.
- Right: Subtracted the unreleased credit allocation (id 169, 3563) on INV-00155, so the part-paid invoice was handled correctly.
- Right: Checked allocations per invoice to confirm INV-00192 had none.
- Right: Arithmetic was correct: 35889 + 49315 = 85204.
- Mistake: Two redundant list_allocations calls: the client-wide list_allocations result already showed every allocation for both invoices, so the per-invoice calls were not needed. They did no harm.

### large-tutor_margin-3

**Tool calling: passed.** The agent pulled Chen Mensah's (TU-002) October 2026 lessons, their attendance and the tax settings, spot-checked invoice lines for a few clients against the pricing rules, and returned 120741 pence, which matches the expected answer. ($0.21, 7 requests, 2.2 min)
- Right: Found the tutor ID first (TU-002), then listed October lessons filtered by tutor with both ends of the date range included.
- Right: Ran a second list_lessons call on 2026-10-31 to 2026-11-01 to make sure no boundary lessons were missed (it returned none).
- Right: Fetched attendance for all 68 lessons in a single list_attendance call.
- Right: Checked its pricing logic against real invoices (INV-06213, INV-06406), including the net line amounts of split lessons, and confirmed CL-0097 is not taxable. This bears on gross-priced lessons but not on net margin for net-priced ones.
- Right: Final answer 120741 matches the expected answer.
- Mistake: The list_payment_orders call was not needed, since the margin should come from per-lesson tutor rates and not from payment order totals.
- Mistake: list_invoices for CL-0097 and CL-0043 returned invoice headers that were never opened or used, so these calls were wasted.
- Mistake: The transcript shows no step where the margin is actually calculated. The figure appears without visible working, which makes it hard to audit.

### small-tutor_margin-3

**Tool calling: passed.** The agent found tutor Kai Iyer, listed his 39 October lessons and their attendance, and checked which clients were taxable. It then looked at two invoices to confirm how gross-priced lines are netted, both for taxable and non-taxable clients, and returned 65045, which is correct. ($0.12, 7 requests, 70 s)
- Right: It fetched all October lessons for TU-001 together with their attendance in one batch call, which gave the charged/not-charged status of each student.
- Right: It checked is_taxable for every client involved and saw that CL-0037 and CL-0030 are not taxable, so their gross lessons count at full cost as net.
- Right: It checked the gross-netting rule against real invoice lines: INV-00187 shows LS-001408 at net 4687 for the taxable client, and INV-00220 shows LS-001398 at net 5500 for the non-taxable one.
- Right: It left out lessons where the only student was 'missed' (e.g. LS-001419, LS-001445, LS-001463), but the tutor cost of billable lessons still counted, as the margin rule requires.
- Mistake: It called list_payment_orders for TU-001, but the result was never needed because tutor pay comes from each lesson's tutor_rate. This was a wasted call.
- Mistake: The calculation itself does not appear in the transcript, so the final figure cannot be traced line by line. Even so, the answer matched the expected 65045.

### large-duplicate_lines-1

**Tool calling: passed.** The agent listed every invoice sent in October 2026 (4 pages), then called get_invoice on each non-void one, checked the lines for a repeated (lesson, student) pair, and returned INV-06060, INV-06073 and INV-06097. That matches the expected answer. ($0.79, 10 requests, 3.3 min)
- Right: Used the sent_from/sent_to filters on list_invoices to restrict to October 2026 and paged through all 4 pages.
- Right: Skipped void invoices (e.g. INV-05811 and INV-05817 were not fetched), as the question asked.
- Right: Fetched the lines of every candidate invoice, including the late-sent ones INV-06144 to INV-06154 dated 3 to 10 October, so no invoice was missed.
- Right: The final IDs exactly match the expected answer.
- Mistake: The unfiltered list_invoices page 1 and list_lessons page 1 calls were unnecessary for this question.
- Mistake: It made roughly 390 separate get_invoice calls, which was costly but was effectively the only way to inspect invoice lines with these tools.

### large-missed_billed-1

**Tool calling: passed.** The agent listed every invoice sent in October 2026 and pulled attendance for all September lessons. It found lessons whose attendance said 'missed' but 'invoiced': True, then checked those invoices (INV-05821, INV-05846, INV-06080) and returned them. This matches the expected answer. ($2.35, 9 requests, 5.7 min)
- Right: Worked out that October invoices bill September lessons, so it fetched all September lessons and their attendance.
- Right: Spotted the anomaly signal: attendance rows with status 'missed' but invoiced True (for example LS-044224 for ST-0088).
- Right: Checked candidates by opening each invoice with get_invoice and confirming the line for the missed student was present (LS-044224 on INV-05821, LS-041761 on INV-05846, LS-043071 on INV-06080).
- Right: Looked at the void INV-05811 against its replacement INV-06146 and correctly saw that the void invoice should be left out.
- Right: Caught a stray lesson ID typo (LS-043139 sent in place of LS-044139) and re-fetched LS-044139 on its own.
- Mistake: Very costly approach: about 30 pages of list_lessons for September, plus August and October lesson pages that were never needed, plus nine speculative get_invoice calls (INV-06145 to INV-06154).
- Mistake: Typo in one list_attendance batch (LS-043139 instead of LS-044139) needed an extra call.
- Mistake: Did not show that it checked invoices sent later in October (for example INV-06146 on 2026-10-04) for missed students, though the answer turned out correct.

### large-wrong_invoices-1

**Tool calling: failed.** The agent looked for wrongly charged October 2026 invoices by checking attendance with invoiced flags and by spot-checking some invoices. It found 6 of the 12 overcharged invoices (INV-05821, 05846, 05851, 06016, 06080, 06105) and missed INV-05791, 05877, 06017, 06060, 06073 and 06097. ($1.77, 26 requests, 10.8 min)
- Right: Correctly left out void invoices and their replacements.
- Right: Found tax wrongly charged to non-taxable clients on INV-05851, INV-06016 and INV-06105, using get_client to confirm is_taxable=False.
- Right: Found a line billed for a 'missed' student (LS-044224 on INV-05821, 4875) and duplicate or extra lines on INV-05846 and INV-06080 with the correct amounts.
- Mistake: Never recomputed every line of every non-void October invoice against the lesson records (rate × duration, split shares, net/gross tax, rounding). It only fetched a handful of invoices (around 25 of roughly 390), so errors like wrong rates or wrong split counts (e.g. INV-06097 9900, INV-06060 3563, INV-06073 4500) were never caught.
- Mistake: Relied mainly on the attendance 'invoiced' flags against status. That only catches missed students who were billed, not mispriced lines.
- Mistake: Spent many calls on irrelevant data (September invoices, November invoices, ledger entries for clients already identified, refunds and credit notes, August attendance) instead of fetching every October invoice's lines and checking them.
- Mistake: Gave the final answer with only 6 rows and never checked that the whole set had been covered.

### small-wrong_invoices-1

**Tool calling: passed.** The agent pulled all 37 October invoices, every September lesson, every client and all the attendance records, checked for void invoices, and reported four overcharged invoices with amounts that match the expected answer exactly. ($0.41, 8 requests, 3.1 min)
- Right: It listed the October invoices and opened every one with get_invoice (INV-00149 to INV-00185) to get line-level detail.
- Right: It fetched all four pages of September lessons and all the attendance records, so it could recompute each line from the charge type, rate, duration and attendance.
- Right: It checked client is_taxable flags. This exposed INV-00162 (CL-0014, not taxable) charging 863 tax on one line, and INV-00176 (CL-0030), where a 6000 overcharge appears.
- Right: It spotted the duplicated LS-001226 line on INV-00158 (4050) and the 7800-vs-7200 line on INV-00172 (600 overcharge).
- Right: It checked for void invoices in October (none) to honour the exclusion in the question.
- Right: It batched the attendance lookups into large lesson_id lists, which kept the call count down.
- Mistake: The run made a lot of calls, including get_client for every client, though most were needed for the tax check. No real errors are visible.
- Mistake: Its reasoning is not visible, so it is hard to confirm whether every invoice was fully recomputed or the anomalies were found by pattern-matching. The result is correct either way.

### large-correction-2

**Tool calling: passed.** The agent marked ST-0332 as missed on LS-045235, voided INV-06372 dated 2026-11-13, and issued INV-06548 for the three remaining October lessons (17100), which auto-paid from credit. The resulting changes match the expected state exactly. ($0.042, 6 requests, 19 s)
- Right: It found the client (CL-0234) and student (ST-0332) by reading INV-06372 directly rather than guessing among the many Baker clients.
- Right: It checked the lesson statuses and attendance before acting, which confirmed the other three lines were still chargeable (LS-045914 is cancelled_chargeable with missed_chargeable attendance).
- Right: It called list_lessons from 2026-10-01 to 2026-11-13 and correctly kept the November lessons (LS-047906, LS-048556) off the reissue, since the replacement only covers INV-06372's lessons.
- Right: It carried out the steps in the order asked: update_attendance, void_invoice dated today, then create_invoice dated today with only the three remaining lines.
- Right: The final summary is accurate: 17100 auto-paid from the 22800 released credit, leaving 5700 credit.

### large-record_payment-1

**Tool calling: passed.** The agent looked up Jane Kelly (CL-0294), her invoices, allocations and ledger. It recorded a 50126p payment dated 2026-11-13, putting 37626p on INV-02840 to clear it and 12500p on INV-03247, oldest due date first. This matches the expected changes exactly. ($0.035, 4 requests, 16 s)
- Right: Converted £501.26 to 50126 pence correctly.
- Right: Fetched settings, invoices, allocations and ledger entries in parallel before acting.
- Right: Allocated to unpaid invoices oldest due date first: INV-02840 (due 2026-02-15) remaining 37626, then the rest (12500) to INV-03247.
- Right: Dated the payment today (2026-11-13) and gave a concise summary.
- Mistake: The tool results were truncated, so the transcript does not show where the 37626 outstanding figure for INV-02840 came from. The figure was correct, and the run passed.
