---
title: "DeepSeek V4.1 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 60%; rank 12 of 20."
canonical: https://models.pydantic.dev/models/deepseek-v4.1-flash/accounting_platform/
---

# DeepSeek V4.1 Flash on Pydantic AI Accounting

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

| Mode         | Score | Tasks passed | Cost  | Requests | Tool calls | Time     |
| ------------ | ----- | ------------ | ----- | -------- | ---------- | -------- |
| Tool calling | 70%   | 7 of 10      | $0.27 | 109      | 296        | 17.4 min |

Each task was run once per mode.

## Review

Written by an LLM from the runs' transcripts.

#### Overall

The model passed **13 of 20** runs: **7/10 with tool calling** and **6/10 in code mode**. It reliably handles lookups, payments and corrections. It is weaker on multi-step audit and arithmetic questions: tutor margin and wrong-invoice cases failed in at least one mode. The most common failure was **giving up**, with 4 of 7 failures tagged `gave_up`. In those runs it submitted empty or placeholder answers.

#### Where it does well

- **Simple reads and balances:** `invoice_total` and `owed_on_invoices` passed in both modes with 2–6 requests. On `owed_on_invoices` it correctly subtracted only the unreleased 3563 allocation.
- **Write operations:** `correction-2` and `record_payment-1` passed in both modes.
  - In the correction, it identified Yara Baker as a student rather than a client. It then ran attendance → void → reissue in the right order and checked afterwards that the released credit was applied.
  - In the payment, it worked out the 37626 remaining on INV-02840 before splitting the payment oldest-due first.
- **Data-wide scans in code mode:** `duplicate_lines` and `missed_billed` covered all 394 October invoices. In both, it recovered from the 100-nested-call limit by batching in groups of 90.

#### Mistakes it makes

- **Giving up with placeholder answers (code mode):**
  - `large-tutor_margin-3` returned `{"pence": 0}` with no tool calls.
  - `small-wrong_invoices-1` returned the schema example.
  - `small-tutor_margin-3` returned `{"pence": 1}`.
- **Empty answers on audits:** `large-wrong_invoices-1` returned `{"rows": []}` in both modes, when the expected answer had 12 overcharged invoices.
  - In tool mode it never recomputed line charges.
  - In code mode it hit the 1000-suspension limit after 384 separate `get_client` calls. It then neither restarted the session nor used the 360 clients it had already loaded.
- **Misreading the question:** In tool mode on `duplicate_lines`, it treated void/reissue pairs as double-charges and never opened INV-06060/06073/06097.
- **Unshown, unchecked arithmetic:** On `small-tutor_margin-3` (tools), it did the margin in its head and skipped the clients' `is_taxable` flags. Its answer was 3668 short.
- **Redundant calls:** These are common, for example repeated `get_settings`, repeated `list_allocations`, an irrelevant `list_payment_orders` call, and six unneeded `get_client` lookups.

#### Tool calling compared with code mode

| Mode      | Passed | Requests | Cost    |
| --------- | ------ | -------- | ------- |
| tools     | 7/10   | 109      | $0.2681 |
| code_mode | 6/10   | 62       | $0.0334 |

- **Cost and efficiency:** Code mode was about **8× cheaper**. On the scans it was much better: `missed_billed` used 9 requests and $0.0059, against 26 requests and $0.0872 with tools. `duplicate_lines` passed in code mode but failed with tools.
- **Reliability:** Code mode was more prone to quitting without trying. Three of its four failures were placeholder answers with 1–3 requests. Tool calling instead passed `large-tutor_margin-3` and `small-wrong_invoices-1`, which code mode abandoned.
- **Recommendation:** Use code mode for bulk scans over many records. Watch for early `final_result` calls, and budget for sandbox call limits.

## Runs

### small-invoice_total-1

**Tool calling: passed.** The agent made one get_invoice call for INV-00084, read the stored total of 89700 off the record and returned it. That matches the expected answer. ($0.0008, 2 requests, 4 s)
- Right: Used the most direct tool, get_invoice, to fetch the invoice record.
- Right: Returned the invoice's own stored 'total' field (89700, which is net 74752 + tax 14948) as an integer in pence.
- Right: Did not spend extra calls recomputing line totals when the record already held the total.

### small-owed_on_invoices-1

**Tool calling: passed.** The agent looked up Emeka Brown (CL-0007), listed the two unpaid invoices (INV-00155 total 39452, INV-00192 total 49315) and the client's allocations, then subtracted the one unreleased allocation on INV-00155 (3563) to answer 85204, which matches the expected answer. ($0.0010, 4 requests, 5 s)
- Right: Filtered list_invoices by status 'unpaid' and checked that the result was a single page holding both invoices.
- Right: Fetched allocations so it did not just sum invoice totals, and found the 3563 credit allocation on INV-00155 that is not released.
- Right: Arithmetic was right: (39452 − 3563) + 49315 = 85204.
- Right: Efficient: four calls, nothing redundant.

### large-tutor_margin-3

**Tool calling: passed.** The agent found tutor TU-002 and pulled Chen Mensah's October 2026 lessons, attendance and settings. It checked the taxable status of three clients and submitted 120741 pence, which matches the expected answer. ($0.017, 5 requests, 89 s)
- Right: Found the tutor ID with search_tutors and asked list_lessons for 2026-10-01 to 2026-10-31, so both ends of the month were included.
- Right: Fetched attendance for all 75 lessons in one batch call.
- Right: Checked the is_taxable status of clients (CL-0097, CL-0065, CL-0269), which matters for gross-priced lessons where the net amount depends on tax.
- Right: Gave the answer as integer pence in the required format.
- Mistake: No computation steps appear in the transcript. The margin arithmetic over 75 lessons (split charges, gross-to-net conversion, tutor pay per hour) was not shown, so the result cannot be checked from the trace.
- Mistake: Only three clients were checked for taxability. Presumably these were the ones on gross-priced lessons, but the shortened output does not confirm that every relevant client was covered.

### small-tutor_margin-3

**Tool calling: failed.** The agent fetched Kai Iyer's October 2026 lessons and their attendance, then submitted a margin of 61377 pence with no visible calculation; the expected answer was 65045, a shortfall of 3668. ($0.0062, 4 requests, 33 s)
- Right: It found the tutor ID (TU-001) and read the settings, getting a 20% tax rate.
- Right: It filtered lessons by Kai Iyer's tutor ID with the range 2026-10-01 to 2026-10-31, matching the rule that lessons count by the date they took place.
- Right: It fetched attendance for all 39 lessons in one list_attendance call, which shows charged versus missed students.
- Mistake: It never looked up the clients' `is_taxable` flags, although several lessons were priced `gross` (e.g. LS-001398, LS-001408). For a non-taxable client the net amount on a gross lesson is the full cost, not cost/1.2. Skipping this would understate the net charge, which fits the answer being 3668 too low.
- Mistake: It did all the work for 39 lessons in its head and called final_result straight after list_attendance. There is no visible per-lesson working of hours × rate, per-line rounding, tax backed out of gross lessons, or tutor pay. It should have calculated per lesson in code and checked the total.
- Mistake: It did not check whether the list_lessons result (truncated in the transcript) was complete or paginated before treating it as all of October.

### large-duplicate_lines-1

**Tool calling: failed.** The agent was asked which non-void invoices sent in October 2026 charge the same student for the same lesson more than once. It answered with the 10 reissued invoices from 3–10 October (INV-06145..06154). Those invoices merely replaced void invoices. The expected answer was three 1 October invoices (INV-06060, INV-06073, INV-06097) that each contain a duplicate line inside the invoice. ($0.058, 19 requests, 4.9 min)
- Right: Paged through list_invoices and filtered to October 2026.
- Right: Noticed the void/reissue pairs, e.g. void INV-06085 reissued as INV-06145 and void INV-05811 reissued as INV-06146.
- Right: Began opening individual 1 October invoices (INV-05761 to INV-05786) and checked shared lessons such as LS-042204, which appears on several clients' invoices for different students.
- Mistake: Misread the question. 'Charge the same student for the same lesson more than once' means duplicate (lesson_id, student_id) lines within one invoice. The agent treated it as a lesson appearing on both a void invoice and its replacement.
- Mistake: The reasoning behind the answer does not hold up. The reissued invoices each contain fewer lines than the void originals, and the void originals no longer count, so none of the 10 invoices actually double-charges anyone.
- Mistake: Stopped checking 1 October invoices after INV-05786. It never opened INV-06060, INV-06073 or INV-06097, so the real duplicate-line invoices were never found.
- Mistake: Wasted calls fetching ledger entries and client invoice lists for CL-0339, CL-0350, CL-0054 and CL-0061, which were irrelevant to the question, and repeated identical list_invoices and get_settings calls.

### large-missed_billed-1

**Tool calling: passed.** The agent pulled October 2026 invoices and then attendance for every September 2026 lesson in batches of 100. It looked for records marked 'missed' but flagged invoiced=True, confirmed three candidates with get_invoice, and returned INV-05821, INV-05846 and INV-06080, which matches the expected answer. ($0.087, 26 requests, 3.5 min)
- Right: It saw that the attendance records carry an 'invoiced' flag and used the anomaly status='missed' with invoiced=True to find the bad charges, for example LS-044224 / ST-0088 / CL-0065.
- Right: It covered all September lessons, LS-041722 through LS-044678, so no candidates were missed.
- Right: It checked each candidate with get_invoice, confirming that a line for the missed student's lesson sits on an October invoice and that none of the three is void (all are 'paid').
- Right: Its final answer was the exact ID list in the required format.
- Mistake: It wasted calls: get_settings three times, list_invoices pages 2–4 that it barely used, search_clients with an empty name and again for 'Okoro' and 'Chen', an unfiltered list_lessons, and get_invoice on INV-05761, INV-06145 and INV-06154, none of which were needed.
- Mistake: It only checked lessons dated September 2026. Invoices sent in October (some on 2026-10-03 or 2026-10-10) could include earlier un-invoiced lessons from voided invoices. The answer was right, but that coverage was not verified.

### large-wrong_invoices-1

**Tool calling: failed.** The agent had to find non-void October 2026 invoices that overcharge and say by how much. It fetched the invoice list, a few invoices with their lessons and attendance, and some September lesson and attendance pages. It never systematically recomputed line charges and returned an empty list, while the expected answer has 12 overcharged invoices. ($0.032, 13 requests, 2.5 min)
- Right: Got the settings (20% tax) and paged through the October invoices list.
- Right: Checked a few invoice lines against their lessons and attendance, e.g. INV-05761 and INV-05762.
- Right: Correctly treated the void-and-reissue pairs (e.g. INV-06085/INV-06145, INV-05811/INV-06146) as corrections. The reissued invoices dropped lines for missed lessons.
- Mistake: Spent many calls on void invoices and their replacements (INV-06085, 05811, 05959, 06096, 05984, 06144, 06069, 06079, 06100, 05817). The question explicitly excludes void invoices, so these calls were mostly wasted.
- Mistake: Never fetched the lines of the invoices that were actually wrong (e.g. INV-05791, INV-05821, INV-05846, INV-06097). It did not recompute each line's expected cost from charge type, duration, split count and net/gross tax, so it could not compare against what was billed.
- Mistake: Started bulk list_lessons and list_attendance pulls (page 2, then jumped to page 30, plus attendance for only about 100 lessons) but never used them to check invoice lines.
- Mistake: Submitted final_result with empty rows and no analysis. In effect it gave up and asserted that no invoices were wrong, which contradicts the premise of the question.

### small-wrong_invoices-1

**Tool calling: passed.** The agent pulled all 37 October-2026 invoices and every September lesson record behind their lines. It also pulled attendance, client taxability and the void list, then reported four overcharged invoices with amounts that exactly match the expected answer. ($0.057, 16 requests, 3.6 min)
- Right: Got the full October invoice list with list_invoices(sent_from=2026-10-01, sent_to=2026-10-31) and opened every invoice with get_invoice to see line-level detail.
- Right: Batch-fetched lesson details (get_lessons) and attendance (list_attendance) for all invoiced lesson IDs, which let it recompute each line's correct charge.
- Right: Checked is_taxable for every client and so caught INV-00162 (CL-0014, not taxable) wrongly charging 863 tax on the LS-001133 line.
- Right: Caught the duplicated LS-001226 line in INV-00158 (an extra 4050), the wrong 6500 net on LS-001295 in INV-00172 (600 over after tax), and INV-00176's 6000 overcharge.
- Right: Called list_invoices(status=void) to confirm none of the October invoices were void.
- Mistake: Called get_settings a second time even though the first call had already returned tax_rate_percent 20.
- Mistake: Fetched October lessons with list_lessons(start=2026-10-01, end=2026-10-31), which is irrelevant because October invoices bill September lessons; this wasted a call.
- Mistake: Re-fetched INV-00172 near the end although it had already been retrieved.
- Mistake: None of the reasoning appears in the transcript, so its line-by-line checks of the hourly-split rounding cases cannot be confirmed; the result still came out correct.

### large-correction-2

**Tool calling: passed.** The agent found the client (Freya Baker, CL-0234) for student Yara Baker. It marked ST-0332 as missed on LS-045235, voided INV-06372 dated today and reissued the other three lessons as INV-06548 (17100), which was auto-paid from the released credit. The final state matched the expected changes exactly and the run passed. ($0.0048, 13 requests, 23 s)
- Right: Worked out that 'Yara Baker' is a student (ST-0332) under client Freya Baker CL-0234 rather than a client.
- Right: Checked the invoice lines, settings (auto_pay_from_credit, 20% tax) and the existing allocation before making changes.
- Right: Made the changes in the right order: update_attendance to missed, then void_invoice dated 2026-11-13, then create_invoice with only the three remaining lessons.
- Right: Afterwards checked through list_allocations that the 22800 allocation had been released and the credit applied to the new invoice.
- Mistake: Made redundant lookups: get_client was called on six Baker clients and then again on CL-0234, and there was an unneeded search_tutors call. This wasted requests but did no harm.
- Mistake: Called list_attendance on the other three lessons before reissuing, which was not needed but was harmless.

### large-record_payment-1

**Tool calling: passed.** The agent recorded Jane Kelly's 50126p payment dated 2026-11-13. It allocated 37626p to INV-02840, which cleared it, and 12500p to INV-03247, oldest due date first. The result matches the expected changes and the run passed. ($0.0037, 7 requests, 18 s)
- Right: Found the client CL-0294 and listed her unpaid invoices, sorted by due date.
- Right: Worked out from the allocations that 37626p was still owed on INV-02840 (58778 total less 21152 already allocated).
- Right: Applied the remaining 12500p to the next oldest invoice, INV-03247, and left no unallocated credit.
- Right: Recorded the payment dated today in a single record_payment call.
- Mistake: Called list_payment_orders, which has nothing to do with a client payment and returned a large tutor payment-order list.
- Mistake: Called list_allocations a second time with the same arguments it had already run.
