---
title: "Gemini 4 Argon on Pydantic AI - Billing ops"
description: "Questions about and changes to a tutoring agency's books, checked to the penny. Tool calling 100%, code mode 90%; rank 1 of 44."
canonical: https://pydantic.dev/models/list/gemini-4-argon/billing_ops/
---

# Gemini 4 Argon on Pydantic AI - Billing ops

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

About the benchmark: https://pydantic.dev/models/benchmarks/billing_ops.md. The model on every Pydantic AI benchmark: https://pydantic.dev/models/list/gemini-4-argon/pydantic_ai.md

| Mode         | Score | Tasks passed | Cost  | Requests | Tool calls | Time     |
| ------------ | ----- | ------------ | ----- | -------- | ---------- | -------- |
| Tool calling | 100%  | 10 of 10     | $7.54 | 66       | 718        | 44.3 min |
| Code mode    | 90%   | 9 of 10      | $0.63 | 71       | 71         | 8.9 min  |

Each task was run once per mode.

## Review

Written by an LLM from the runs' transcripts.

#### Overall

Gemini-4-argon passed 19 of 20 cases: 10 of 10 with tools and 9 of 10 in code mode. The one failure was code-mode `large-wrong_invoices-1`, where it found 9 of the 12 wrong invoices. No provider errors.

#### Where it does well

- **Changes to the books (4 of 4):** Both `large-correction-2` runs used `update_attendance`, then `void_invoice` dated 2026-11-13, then `create_invoice` for the three remaining lessons. Every change matched the expected one, in 3–4 requests. Both `large-record_payment-1` runs split 50126 into 37626 for INV-02840 and 12500 for INV-03247, oldest due date first.
- **Money rules:** Its code used `Decimal` with `ROUND_HALF_UP`, per-line tax, gross/net pricing and `is_taxable` correctly. Every amount it reported was exact, including 3563 and 863.
- **Simple questions** (invoice total, amount owed, both tutor-margin cases) passed in both modes in 2–8 requests.

#### Mistakes it makes

- **Checking each line on its own misses duplicate lines.** In the failed run, its script compared each line with its own recomputed value and summed the expected total from the invoice's own lines. A duplicated line looks correct that way, so INV-06060, INV-06073 and INV-06097 were left out. A code comment planned a check for extra lines, but the script never did it. In `small-wrong_invoices-1` it did compare against the billable September lessons, and that run passed. So whether it does the complete check varies from run to run.
- **Guessing response shapes:** in code-mode `large-missed_billed-1` it guessed key names (`has_more`, `total_pages`, `attendance`) and spent 2 extra requests.
- **Heavy fetching in tools mode:** it paged through more than 20 September `list_lessons` pages and made hundreds of `get_invoice` calls.

#### Tool calling compared with code mode

Tools mode was more accurate here (10/10 against 9/10) but far more expensive on the large data cases:

| Case              | Tools          | Code mode      |
| ----------------- | -------------- | -------------- |
| `wrong_invoices`  | $3.92 (passed) | $0.12 (failed) |
| `missed_billed`   | $1.85          | $0.08          |
| `duplicate_lines` | $0.92          | $0.07          |

The tools-mode win on `wrong_invoices` came from a broader, slower search that happened to cover duplicates. The same model wrote a correct duplicate check in code mode for `large-duplicate_lines-1`, but did not include it in the general "wrong amount" check. On small cases and change tasks the two modes cost and performed about the same.

## Runs

### small-invoice_total-1

**Tool calling: passed.** It answered 89700 correctly in 2 requests. ($0.017, 2 requests, 8 s)
- Right: It took the fewest steps possible

**Code mode: passed.** It answered 89700 correctly in 2 requests. ($0.015, 2 requests, 9 s)
- Right: It took the fewest steps possible

### small-owed_on_invoices-1

**Tool calling: passed.** It answered 85204 correctly in 3 requests. ($0.021, 3 requests, 22 s)
- Right: It subtracted the allocations correctly

**Code mode: passed.** It answered 85204 correctly in 4 requests. ($0.027, 4 requests, 17 s)
- Right: The answer was correct

### large-tutor_margin-3

**Tool calling: passed.** It worked out the margin as 120741 pence, which was correct, in 5 requests. ($0.19, 5 requests, 2.9 min)
- Right: It applied the margin rule (client net of tax less tutor pay) correctly

**Code mode: passed.** It answered 120741 correctly in 7 requests. ($0.065, 7 requests, 61 s)
- Right: It got the margin right for $0.065

### small-tutor_margin-3

**Tool calling: passed.** It answered 65045 correctly in 6 requests. ($0.11, 6 requests, 1.7 min)
- Right: It got the margin right

**Code mode: passed.** It answered 65045 correctly in 8 requests. ($0.077, 8 requests, 1.7 min)
- Right: The answer was correct

### large-duplicate_lines-1

**Tool calling: passed.** It paged through `list_invoices` for October, then called `get_invoice` on all 394 invoices across batches of parallel calls and found the duplicated lesson/student lines in INV-06060, INV-06073 and INV-06097. Passed. ($0.92, 10 requests, 5.0 min)
- Right: It got the correct three invoices
- Right: It checked every invoice instead of sampling
- Mistake: It read 394 invoices one call at a time in the conversation, which cost $0.92 against $0.07 in code mode
- Mistake: It also fetched a `list_lessons` page for September that it did not need

**Code mode: passed.** It fetched the 384 non-void October invoices with `asyncio.gather` in batches of 100. It then checked for repeated `(student_id, lesson_id)` keys, both within an invoice and across invoices, and returned the correct three. Passed for $0.07. ($0.066, 7 requests, 64 s)
- Right: The duplicate check was simple and correct
- Right: It cost about a fourteenth of the tools-mode run

### large-missed_billed-1

**Tool calling: passed.** It paged through every September `list_lessons` page (more than 15) and ran large `list_attendance` batches to find `missed` students. It then confirmed the matches with `get_invoice` on INV-05846, INV-06080 and INV-05821 and answered correctly. ($1.85, 9 requests, 8.9 min)
- Right: It found the correct three invoices
- Right: It checked the candidates against the actual invoice lines
- Mistake: It loaded every September lesson and attendance record into the context, so the run cost $1.85. Code mode got the same answer for $0.08

**Code mode: passed.** It fetched all the invoice details and the `list_attendance` records for the lessons on them, then flagged lines whose attendance was `missed`. Passed. ($0.076, 11 requests, 74 s)
- Right: It looked only at lessons that appeared on invoices, not every September lesson
- Right: It checked the set of attendance statuses before it answered
- Mistake: It spent 2 requests guessing the response shape: it first used `has_more` and `total_pages`, then `attendance` and `students` keys, before checking the real structure

### large-wrong_invoices-1

**Tool calling: passed.** It worked through 18 requests: invoice pages, many `get_invoice` calls, the September `list_lessons` pages, `list_attendance` and client lookups. It found all 12 wrong invoices, including the three with duplicate lines, and got every amount right. Passed. ($3.92, 18 requests, 18.3 min)
- Right: It caught all three kinds of error: wrong rate or tax, missed students who were billed, and duplicated lines
- Right: Every overcharge figure was exact, including 3563 on INV-06060
- Mistake: It was very expensive at $3.92, because it pulled more than 20 pages of September lessons and hundreds of records into the context
- Mistake: Its order of exploration was scattered, for example it fetched September invoices it did not need

**Code mode: failed.** It fetched all 384 non-void invoices, their lessons, attendance and clients, and recomputed each line with `Decimal` half-up rounding. It reported 9 invoices and missed the three with duplicate lines: INV-06060 (3563), INV-06073 (4500) and INV-06097 (9900). ($0.12, 13 requests, 61 s)
- Right: The rounding, tax, gross/net and missed-student logic were all correct
- Right: All 9 invoices it reported had the exact amounts
- Mistake: In the final check script, it compared each line with its own recomputed value and added up the expected total from the invoice's own lines. A duplicated line recomputes correctly on its own, so duplicates never showed a difference. It should have checked for repeated `(lesson_id, student_id)` pairs, or compared against the billable September lessons, as it did in small-wrong_invoices and large-duplicate_lines
- Mistake: Its own code comment said "also check if any unbillable lessons were included or billable lessons missed", but the code never did that check before it answered

### small-wrong_invoices-1

**Tool calling: passed.** It found all 4 wrong invoices with the right overcharges in 5 requests. Passed. ($0.45, 5 requests, 6.0 min)
- Right: The rows and amounts were exact

**Code mode: passed.** It recomputed the lines, then explicitly checked for duplicate lines and wrong students. It then rebuilt the expected lines for each client from the billable September lessons and compared them with each invoice. All 4 answers were correct. ($0.12, 11 requests, 89 s)
- Right: It compared against the expected billable lessons, which catches duplicates and extra lines
- Mistake: It took 11 requests, partly to explore one invoice (INV-00158) step by step

### large-correction-2

**Tool calling: passed.** It ran `search_clients` and `get_invoice(INV-06372)`, then `update_attendance(LS-045235, ST-0332, missed)` with `void_invoice(date=2026-11-13)`, then `create_invoice` with the three remaining lessons. Every change matched what was expected. Passed in 4 requests. ($0.030, 4 requests, 23 s)
- Right: It used the voiding step and reissued the invoice as the handbook describes, dated today
- Right: It ran independent calls in parallel
- Right: It reissued only the three still-chargeable lessons, and the new invoice for 17100 was paid from the released credit

**Code mode: passed.** It ran `get_invoice` and `search_clients` together in one script. A second script called `update_attendance`, `void_invoice` and `create_invoice` for the three remaining lessons. Passed in 3 requests. ($0.028, 3 requests, 40 s)
- Right: It needed 3 requests, the fewest of any change task
- Right: It did every write in a single script

### large-record_payment-1

**Tool calling: passed.** It recorded the 50126 payment for CL-0294 dated 2026-11-13. The allocations were 37626 to INV-02840, which became paid, and 12500 to INV-03247. Passed in 4 requests. ($0.031, 4 requests, 31 s)
- Right: The allocations went to invoices oldest due date first and matched what was expected exactly
- Right: Its summary was short and correct

**Code mode: passed.** It recorded the payment and the allocations were exactly as expected. Passed in 5 requests. ($0.034, 5 requests, 20 s)
- Right: The allocations were correct
