---
title: "Muse Spark Open on Pydantic AI Accounting"
description: "Questions about and changes to a tutoring agency's books, checked to the penny. Tool calling 70%, code mode 80%; rank 19 of 32."
canonical: https://models.pydantic.dev/models/muse-spark-open/accounting_platform/
---

# Muse Spark Open on Pydantic AI Accounting

> Questions about and changes to a tutoring agency's books, checked to the penny. Tool calling 70%, code mode 80%; rank 19 of 32.
>
> Markdown copy of https://models.pydantic.dev/models/muse-spark-open/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>`
- Any other question about the models: `GET https://models.pydantic.dev/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://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/muse-spark-open.md

| Mode         | Score | Tasks passed | Cost  | Requests | Tool calls | Time     |
| ------------ | ----- | ------------ | ----- | -------- | ---------- | -------- |
| Tool calling | 70%   | 7 of 10      | $2.98 | 134      | 701        | 12.6 min |
| Code mode    | 80%   | 8 of 10      | $0.87 | 154      | 156        | 10.2 min |

Each task was run once per mode.

## Review

Written by an LLM from the runs' transcripts.

#### Overall

The model passed **15/20 runs**: **7/10 tools** and **8/10 code_mode**. It handled focused accounting questions and changes well, but neither mode passed either general overcharge audit. All five failures arose from coverage, checking logic, or request-budget management; none was a provider error.

#### Where it does well

Both modes passed all six cases covering invoice totals, outstanding debt, payment recording, corrections, and tutor margins: **12/12 runs**. Payments correctly allocated `50126` as `37626 + 12500`, accounting for prior allocations. Corrections followed `update_attendance → void_invoice → create_invoice`, released old allocations, and paid the replacement from credit.

All four margin runs returned exact results, including tax treatment, missed attendance, and tutor payment on billable lessons. Both duplicate-only audits found all three offending invoices.

#### Mistakes it makes

Tools mode’s large missed-attendance audit fetched only `90` invoice details before returning no matches; its final claim of more than `150` sampled invoices was unsupported. Its large overcharge audit inspected only three invoice details and returned **3/12** expected findings.

The small overcharge audits each found **3/4**, but missed different errors: tools mode overlooked a `600` rate discrepancy despite possessing the records; code mode recomputed duplicate lines twice, hiding a `4050` overcharge.

Code frequently guessed response keys, refetched stored data, and exceeded sandbox limits. The large overcharge run restarted twice and exhausted `60` requests without an answer. **10/20 runs** also needed a retry after submitting prose that failed JSON validation.

#### Tool calling compared with code mode

Code mode cost **$0.8675**, versus **$2.9758** for tools, about **71% less**, but used **154 versus 134 requests**, including the exhausted run. Its strongest advantage was systematic traversal: the duplicate audit fell from **43 requests/$1.4446** to **10/$0.0866**, and the missed-attendance audit improved from zero findings to all three.

Code mode offered little efficiency benefit for focused work: corrections took **11 versus 8 requests**, payments **11 versus 7**, and margins **13 versus 6** and **10 versus 5**. Its better bulk coverage still needs complete audit logic and explicit sandbox-budget management.

## Runs

### small-invoice_total-1

**Tool calling: passed.** Correctly returned `89700` pence for `INV-00084`, including tax. ($0.014, 4 requests, 6 s)
- Right: `get_invoice` supplied `net=74752`, `tax=14948`, and `total=89700`.
- Mistake: Before fetching the explicitly named invoice, unnecessarily called `get_settings` and `list_invoices(page=1)`, retrieving `100` summaries.
- Mistake: Returned prose first and needed a JSON-validation retry through `final_result`.

**Code mode: passed.** Correctly returned `89700` pence, verifying the invoice total by summing its lines. ($0.0043, 3 requests, 5 s)
- Right: Called `get_invoice(invoice_id="INV-00084")` and confirmed `sum(l['total'] for l in inv['lines']) == 89700`.
- Right: Used `final_result` directly without a validation retry.
- Mistake: The verification script fetched the same invoice again instead of summing the already stored `result['lines']`.

### small-owed_on_invoices-1

**Tool calling: passed.** Correctly calculated Emeka Brown’s outstanding invoice debt as `85204` pence. ($0.015, 6 requests, 9 s)
- Right: Found unpaid invoices `INV-00155` and `INV-00192` through `list_invoices`.
- Right: Subtracted the active `3563` allocation: `39452 - 3563 + 49315 = 85204`, without treating released allocations as payment.
- Mistake: After receiving client-wide allocations, repeated allocation lookups separately for both invoices and fetched settings, client details, and all invoices; these were unnecessary for the final calculation.

**Code mode: passed.** Correctly returned `85204` pence owed on Emeka Brown’s unpaid invoices. ($0.014, 6 requests, 11 s)
- Right: Retrieved unpaid totals `39452` and `49315`, identified the active `3563` allocation, and returned their net outstanding amount.
- Right: Kept the calculation scoped to unpaid invoices rather than using the overall ledger balance.
- Mistake: After obtaining client-wide allocations, fetched the same information by invoice and then retrieved all invoices, adding unnecessary reads.

### large-tutor_margin-3

**Tool calling: passed.** Correctly returned `120741` pence for Chen Mensah’s October margin. ($0.059, 6 requests, 33 s)
- Right: Resolved `TU-002` with `search_tutors`, retrieved October lessons with `list_lessons`, and requested attendance for `67` billable lessons.
- Right: Fetched `18` client records to establish taxability and returned the exact result through `final_result`.

**Code mode: passed.** Correctly computed `360316 - 239575 = 120741` pence across Chen Mensah’s `67` billable October lessons. ($0.085, 13 requests, 31 s)
- Right: Handled all four charge types, split denominators based on charged attendance, and per-client taxability.
- Right: Rounded using `math.floor(x + 0.5 + 1e-9)` and paid the tutor once per billable lesson, including lessons with no charged students.
- Mistake: The first script defined `main()` but never called it, doing no retrieval.
- Mistake: Repeatedly refetched the same `75` lessons and attendance, including after calculating the correct result.
- Mistake: The initial final prose failed JSON validation; recovered through `final_result`.

### small-tutor_margin-3

**Tool calling: passed.** Correctly returned `65045` pence for Kai Iyer’s October margin. ($0.030, 5 requests, 20 s)
- Right: Used `search_tutors`, `get_settings`, `list_lessons`, `list_attendance`, and seven `get_client` calls to gather the relevant records.
- Right: Covered all `39` lessons and returned the exact result directly through `final_result` in five requests.

**Code mode: passed.** Correctly computed Kai Iyer’s margin as `187435 - 122390 = 65045` pence. ($0.13, 10 requests, 75 s)
- Right: Used `Decimal` and `ROUND_HALF_UP` for lesson costs, tutor pay, and tax.
- Right: Excluded the two cancelled lessons, charged `missed_chargeable` attendance, and retained tutor pay for billable lessons whose students were `missed`.
- Mistake: The client-display script accessed nonexistent `c['name']`, raising `KeyError`, then refetched all seven clients.
- Mistake: Repeatedly reconstructed the `39` lesson records as Python literals and refetched attendance instead of using stored tool results.
- Mistake: The first final prose failed JSON validation and required `final_result`.

### large-duplicate_lines-1

**Tool calling: passed.** Inspected all `384` non-void October invoices and correctly returned `INV-06060`, `INV-06073`, and `INV-06097`. ($1.44, 43 requests, 4.8 min)
- Right: Fetched all four `list_invoices` pages and made `384` `get_invoice` calls.
- Right: Identified repeated pairs `LS-044150`/`ST-0461`, `LS-042250`/`ST-0483`, and `LS-044126`/`ST-0515`.
- Mistake: At the start, fetched `get_settings`, which was unnecessary for detecting repeated identifiers.
- Mistake: Processed invoice details in batches of roughly ten across model turns: correct but expensive at `43` requests and `$1.4446`.
- Mistake: The initial final prose failed JSON validation; a subsequent `final_result` succeeded.

**Code mode: passed.** Correctly found all three duplicate invoices using Python counts of `(lesson_id, student_id)` pairs. ($0.087, 10 requests, 67 s)
- Right: Collected `394` summaries, excluded `10` void invoices, and checked all `384` remaining invoices.
- Right: Used `seen[key] = seen.get(key, 0) + 1` and selected counts greater than one.
- Right: Completed in `10` requests at `$0.0866`, substantially below tools mode.
- Mistake: The first fetch function looked for `invoices` or `data` instead of `items`, collecting no invoices until corrected.
- Mistake: A loop over multiple `90`-invoice chunks still exceeded the `100` nested-tool-call limit within one `run_code` call.
- Mistake: After recovery, unnecessarily rechecked the first `90` invoices, whose successful zero-duplicate result had already been printed.

### large-missed_billed-1

**Tool calling: failed.** Returned an empty list after an incomplete audit, missing all three offending invoices: `INV-05821`, `INV-05846`, and `INV-06080`. ($0.85, 25 requests, 2.7 min)
- Right: Retrieved all `394` October invoice summaries across four pages.
- Right: Used `get_invoice` and `list_attendance`, the records needed to match billed lesson/student pairs against attendance.
- Mistake: The first `list_attendance` batch contained `103` lesson IDs and was rejected by the `100`-ID limit.
- Mistake: Retrieved only `90` invoice details and never retrieved attendance for the offending lessons `LS-044224`, `LS-041761`, or `LS-043071`.
- Mistake: The final response claimed a sample of more than `150` invoices despite only `90` `get_invoice` calls, and generalized that sample to an empty answer. It should have checked every non-void invoice line against attendance keyed by `(lesson_id, student_id)`.

**Code mode: passed.** Completed the audit and correctly returned `INV-05821`, `INV-05846`, and `INV-06080`. ($0.12, 18 requests, 1.6 min)
- Right: Fetched all `384` non-void invoice details, `2655` distinct lessons’ attendance, and built a lookup from `3148` attendance records.
- Right: Matched each invoice line by `(lesson_id, student_id)` and selected `status == 'missed'`, identifying all three offending pairs.
- Mistake: Initially assumed `invoices`/`data` response keys instead of `items`.
- Mistake: Attempted all invoice-detail batches inside one `run_code`, exceeding the `100` nested-call limit.
- Mistake: Recovery used unsupported `globals()`, causing `NameError`, and repeatedly refetched invoice summaries and details before settling on `80`-invoice chunks.

### large-wrong_invoices-1

**Tool calling: failed.** Returned three correct tax overcharges but missed nine of the twelve expected invoices. ($0.10, 10 requests, 31 s)
- Right: Fetched all four October invoice-summary pages.
- Right: Correctly reported `INV-05851: 1050`, `INV-06016: 1150`, and `INV-06105: 1875`, checking their invoice details, lesson records, and non-taxable clients.
- Mistake: After listing invoices, fetched details only for those three invoices and never called `list_attendance`.
- Mistake: Made `32` `get_client` calls, including repeated lookups, without completing invoice coverage. It should have recomputed every non-void invoice using unique lesson/student pairs, attendance, rates, duration, and tax.

**Code mode: error.** Produced no final answer: repeated fetching and sandbox-limit failures exhausted the `60`-request budget. ($0.27, 60 requests, 3.6 min)
- Right: Retrieved all `384` non-void invoice details and built maps for `2655` lessons and `3148` attendance records.
- Right: An intermediate calculation identified correct rate discrepancies including `INV-05791: 600`, `INV-05877: 750`, and `INV-06017: 500`.
- Mistake: The initial pagination code used nonexistent `res['invoices']` and `res['total_pages']` keys.
- Mistake: Repeatedly exceeded the `100` nested-call limit, including a later `ids[270:384]` batch of `114` invoices, and hit `suspension limit 1000 exceeded` twice.
- Mistake: Restarted the sandbox twice and refetched large datasets. It should have processed bounded invoice groups, retained compact results, and budgeted host interactions before restarting.
- Mistake: The intermediate pricing loop iterated every existing line without deduplication or checking that specific student’s chargeability, and inferred missing client taxability from `inv['tax'] != 0`. A complete audit required unique pairs, attendance eligibility, and actual client records.
- Mistake: After the second restart, spent the remaining requests retrieving invoice details again; `UsageLimitExceeded` prevented a final result.

### small-wrong_invoices-1

**Tool calling: failed.** Found the duplicate, tax, and missed-attendance overcharges, but omitted the `600`-pence rate overcharge on `INV-00172`. ($0.42, 20 requests, 3.0 min)
- Right: Retrieved all `37` invoice details and client records.
- Right: Correctly returned `INV-00158: 4050`, `INV-00162: 863`, and `INV-00176: 6000`.
- Mistake: The first `get_lessons` batch contained `101` IDs and was rejected; smaller batches recovered.
- Mistake: Had the invoice, lesson, and attendance records for `LS-001295`, but failed to flag its `7800` billed total against `6000 × 1 hour + 1200 tax = 7200`. It should have included `INV-00172: 600`.
- Mistake: The final prose claimed all other invoices matched, then failed JSON validation before being reformatted.

**Code mode: failed.** Correctly identified tax, rate, and missed-attendance errors but missed the `4050`-pence duplicate on `INV-00158`. ($0.11, 12 requests, 20 s)
- Right: Retrieved all `37` invoice details, `280` distinct lessons, `331` attendance records, and client taxability.
- Right: Correctly returned `INV-00162: 863`, `INV-00172: 600`, and `INV-00176: 6000`, including the rate error tools mode missed.
- Mistake: In `compute_expected`, `for line in inv['lines']` recomputed and added both copies of a duplicated pair. It should have counted `LS-001226`/`ST-0016` once, exposing `INV-00158: 4050`.
- Mistake: Fetched all `37` invoice details twice.
- Mistake: Two scripts used `next(...)` with generator expressions and received the sandbox’s `TypeError: 'list' object is not an iterator`; explicit loops recovered.
- Mistake: The initial final prose failed JSON validation, then the same incomplete result was submitted through `final_result`.

### large-correction-2

**Tool calling: passed.** Correctly marked Yara Baker missed, voided `INV-06372`, and created paid replacement `INV-06548` for `17100` pence dated `2026-11-13`. ($0.020, 8 requests, 16 s)
- Right: Used `update_attendance` on `LS-045235`/`ST-0332`, then `void_invoice`, then `create_invoice` with the three remaining lessons.
- Right: The changes released the `22800` allocation, applied `17100` credit to the replacement, and left `5700` credit.
- Mistake: After completing the changes, returned prose containing pound amounts; application validation rejected it. Recovered with `final_result` using a summary in pence.

**Code mode: passed.** Correctly performed the attendance correction, void, and replacement invoice, producing the expected accounting changes. ($0.028, 11 requests, 65 s)
- Right: Called `update_attendance`, `void_invoice`, and `create_invoice` in the required order, dated `2026-11-13`.
- Right: Verified the old allocation’s `released_on`, the replacement’s `17100` allocation, and the corrected attendance’s `invoiced=false`.
- Mistake: After finding the exact client, performed an unnecessary broader `search_clients(name="Yara")` search.
- Mistake: Used `16` `run_code` calls, many wrapping a single tool, with repeated verification reads.
- Mistake: The initial final prose used pound amounts and failed JSON validation; recovered through `final_result`.

### large-record_payment-1

**Tool calling: passed.** Correctly recorded Jane Kelly’s `50126`-pence payment and allocated it oldest due first. ($0.021, 7 requests, 17 s)
- Right: Used `list_allocations` to establish that `INV-02840` had `21152` already applied, leaving `58778 - 21152 = 37626`.
- Right: Called `record_payment` for `CL-0294` on `2026-11-13`, allocating `37626` to `INV-02840` and `12500` to `INV-03247`; the former became paid.
- Mistake: Read settings and the full invoice history beyond the unpaid invoices and allocations needed for the payment.
- Mistake: The first final response failed JSON validation. The recovered summary still expressed money in pounds rather than following the handbook’s integer-pence convention.

**Code mode: passed.** Correctly recorded `50126` pence for Jane Kelly, clearing `INV-02840` and partially paying `INV-03247`. ($0.028, 11 requests, 25 s)
- Right: Summed allocations only when `released_on is None` and calculated the oldest invoice’s remaining `37626`.
- Right: `record_payment` allocated `37626` and `12500` on `2026-11-13`; subsequent reads confirmed the changes.
- Mistake: In one script, fetched allocations and ledger entries, then immediately fetched both again with `asyncio.gather`; later scripts repeated allocation reads.
- Mistake: The initial prose response failed JSON validation, requiring another request. Both summaries included pound amounts despite the pence convention.
