---
title: "Muse Spark 1.3 on Pydantic AI - Billing ops"
description: "Questions about and changes to a tutoring agency's books, checked to the penny. Tool calling 90%, code mode 80%; rank 4 of 44."
canonical: https://pydantic.dev/models/list/muse-spark-1.3/billing_ops/
---

# Muse Spark 1.3 on Pydantic AI - Billing ops

> Questions about and changes to a tutoring agency's books, checked to the penny. Tool calling 90%, code mode 80%; rank 4 of 44.
>
> Markdown copy of https://pydantic.dev/models/list/muse-spark-1.3/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/muse-spark-1.3/pydantic_ai.md

| Mode         | Score | Tasks passed | Cost   | Requests | Tool calls | Time     |
| ------------ | ----- | ------------ | ------ | -------- | ---------- | -------- |
| Tool calling | 90%   | 9 of 10      | $12.32 | 199      | 805        | 52.7 min |
| Code mode    | 80%   | 8 of 10      | $1.71  | 210      | 210        | 52.0 min |

Each task was run once per mode.

## Review

Written by an LLM from the runs' transcripts.

#### Overall

Muse Spark 1.3 passed 17 of 20 cases: 9 of 10 in tools mode and 8 of 10 in code mode. All 3 failures came from the same audit question, "which October invoices are overcharged" (`wrong_invoices`). Both `large-wrong_invoices-1` runs hit the 60-request limit. Code-mode `small-wrong_invoices-1` gave an answer that left one invoice out.

#### Where it does well

- **Changes to the books:** 4 of 4 correct. In `large-correction-2` it voided an invoice with a credit note, released the allocation and re-invoiced the lessons paid from credit. In `large-record_payment-1` it allocated a payment oldest due date first (37626 to INV-02840, then 12500 to INV-03247). Each took 7–9 requests.
- **Single figures:** invoice total, amount owed and tutor margin were exact in both modes, including the half-up rounding.
- **Filters over large data:** `duplicate_lines` and `missed_billed` both passed in both modes.

#### Mistakes it makes

- **It doesn't check for duplicate lines.** It re-priced each existing line and summed them, so a repeated `(lesson, student)` line counted as valid. This cost INV-00158 in code-mode `small-wrong_invoices-1`, and INV-06060, INV-06073 and INV-06097 in code-mode `large-wrong_invoices-1` (it had found 9 of 12 by message 90). The tools run on the small case passed because it noticed the duplicate by reading the lines.
- **It doesn't budget requests on large audits.** In tools-mode `large-wrong_invoices-1` it paged through every September lesson's attendance in blocks of 100 ids instead of fetching only the lessons on the invoices. It ran out at $4.13.
- **It ignored sandbox limits.** It put 384 `get_client` calls in one `gather` (the cap is 100 per `run_code`), then used up the 1000-suspension budget. After that it restarted the sandbox, which wiped its state, and spent its last requests fetching the data again.
- **Some passes were very expensive:** tools-mode `missed_billed` used 51 requests and $5.32.

#### Tool calling compared with code mode

The accuracy was about the same: 9 against 8 passes. The cost was very different. Tools mode cost about $12.3 in total and code mode about $1.7. On the heavy cases code mode was 10–25× cheaper: $0.12 against $1.35 for `duplicate_lines`, and $0.20 against $5.32 for `missed_billed`. Code mode's own failure was running into sandbox limits and then restarting. On small, simple cases code mode sometimes took more requests (tutor margin: 19 against 8). Its one wrong answer came from computing over aggregates without looking at the raw lines, the kind of check that reading the records one by one in tools mode happened to catch.

## Runs

### small-invoice_total-1

**Tool calling: passed.** Gave the invoice total as 89700, which is correct, in 3 requests. ($0.027, 3 requests, 7 s)
- Right: Direct and cheap

**Code mode: passed.** Gave 89700, which is correct, in 2 requests. ($0.012, 2 requests, 5 s)
- Right: Cheapest run, at $0.012

### small-owed_on_invoices-1

**Tool calling: passed.** Gave the amount owed on invoices as 85204, which is correct, in 4 requests. ($0.016, 4 requests, 10 s)
- Right: Correct, and subtracted allocations from totals

**Code mode: passed.** Gave 85204, which is correct, in 4 requests. ($0.020, 4 requests, 73 s)
- Right: Correct

### large-tutor_margin-3

**Tool calling: passed.** Worked out the margin as 120741, which is correct. ($0.12, 8 requests, 3.2 min)
- Right: Correct figure in 8 requests

**Code mode: passed.** Gave the margin as 120741, which is correct. ($0.23, 19 requests, 6.6 min)
- Right: Correct figure
- Mistake: Took 19 requests where tools mode needed 8

### small-tutor_margin-3

**Tool calling: passed.** Gave the margin as 65045, which is correct. ($0.077, 6 requests, 2.8 min)
- Right: Correct in 6 requests

**Code mode: passed.** Gave 65045, which is correct. ($0.13, 10 requests, 3.3 min)
- Right: Correct
- Mistake: Took 10 requests where tools mode needed 6

### large-duplicate_lines-1

**Tool calling: passed.** Found the three invoices with duplicate lines, INV-06060, INV-06073 and INV-06097, and gave the correct answer. ($1.35, 27 requests, 9.1 min)
- Right: Correct id set
- Mistake: Took 27 requests and $1.35, more than 10× the code-mode run ($0.12), because it read invoices one call at a time

**Code mode: passed.** Returned INV-06060, INV-06073 and INV-06097, which is correct. ($0.12, 19 requests, 4.9 min)
- Right: Cost $0.12, against $1.35 in tools mode

### large-missed_billed-1

**Tool calling: passed.** Found INV-05821, INV-05846 and INV-06080, which billed missed students. Correct, but it took 51 of the 60 allowed requests. ($5.32, 51 requests, 15.1 min)
- Right: Correct id set
- Mistake: Cost $5.32 over 51 requests, its most expensive run, and came close to the request limit

**Code mode: passed.** Returned INV-05821, INV-05846 and INV-06080, which is correct. ($0.20, 33 requests, 6.9 min)
- Right: Cost $0.20, against $5.32 in tools mode
- Mistake: 33 requests is still a lot for one filter

### large-wrong_invoices-1

**Tool calling: error.** Never re-priced the 384 October invoices systematically. It sampled invoices, then paged through `list_lessons` for September and called `list_attendance` in sequential batches of about 100 ids, looking for missed students who were billed. It hit the 60-request limit with no answer. ($4.13, 60 requests, 9.4 min)
- Right: Spotted the tax-on-non-taxable-client errors early (INV-05851 and others) and some missed-but-billed lines
- Mistake: From messages 9 to 117 it scanned every September lesson's attendance (`LS-041722` onwards in blocks of 100) instead of fetching only the lessons on the October invoices' lines
- Mistake: Never checked for duplicate lines or wrong rates, so even with more requests it would probably have been incomplete
- Mistake: Never budgeted its requests and spent $4.13 with no output

**Code mode: error.** Fetched all 384 invoices, their lessons and attendance in batches and re-priced every line. By message 90 it had 9 of the 12 right. Then it used up the sandbox's 1000-suspension budget fetching clients, restarted the session, and ran out of requests while fetching everything again. ($0.50, 60 requests, 12.7 min)
- Right: Its recomputation found 9 correct overcharges with exact amounts (INV-05791 600, INV-05846 11700, INV-06105 1875 and others)
- Mistake: Message 37: put 384 `get_client` calls in one `asyncio.gather` and hit the 100-calls-per-`run_code` cap
- Mistake: Messages 51–71: fetched clients 40 at a time and exhausted `suspension limit 1000` with 24 clients still missing
- Mistake: Message 97: restarted the sandbox, which wiped all its state, and spent the remaining ~10 requests fetching the data again instead of answering
- Mistake: Its check compared invoice totals with summed expected lines, so it missed the duplicate-line invoices INV-06060, INV-06073 and INV-06097

### small-wrong_invoices-1

**Tool calling: passed.** Read all 37 October invoices, spotted early that INV-00158 has LS-001226/ST-0016 twice, re-priced the lines and returned all 4 overcharges correctly. ($1.19, 26 requests, 9.7 min)
- Right: Found the duplicate line by looking at the invoice lines directly (message 5)
- Right: All four amounts were exact, including 4050 for the duplicate
- Mistake: At message 47 it gave the answer as plain text instead of calling `final_result`, which cost an extra round
- Mistake: 26 requests and $1.19

**Code mode: failed.** Re-priced every line of the 37 October invoices and compared each invoice total with the sum of its expected line amounts. It returned INV-00162 (863), INV-00172 (600) and INV-00176 (6000) and missed INV-00158 (4050). ($0.39, 47 requests, 11.5 min)
- Right: Three amounts exact, with half-up rounding done in `Decimal`
- Right: Checked that clients and lines matched and that none of the invoices were void
- Mistake: Message 89: computed an expected amount for each existing line without checking for repeated `(lesson_id, student_id)` pairs, so INV-00158's duplicated LS-001226/ST-0016 line was priced as if valid
- Mistake: Spent requests 57–79 fetching lessons and attendance 50 ids at a time, data it had partly gathered already, and never looked at the lines themselves

### large-correction-2

**Tool calling: passed.** Changed ST-0332's attendance on LS-045235 to `missed`, voided INV-06372 with a 22800 credit note (which released allocation LE-013390) and re-invoiced the three remaining lessons for 17100, paid from credit. Every row matched the expected changes. ($0.041, 7 requests, 83 s)
- Right: Did the whole void, credit and re-invoice flow in 7 requests for $0.04
- Right: New invoice lines (4750 net + 950 tax each) and the released allocation dated 2026-11-13 were exact

**Code mode: passed.** Made the same correct correction as in tools mode: attendance set to `missed`, void with a credit note, then a new 17100 invoice paid from released credit. ($0.047, 7 requests, 79 s)
- Right: All changes matched, in 7 requests

### large-record_payment-1

**Tool calling: passed.** Recorded a 50126 payment for CL-0294 and allocated it oldest due date first: 37626 to INV-02840, which made it `paid`, and 12500 to INV-03247. ($0.056, 7 requests, 1.7 min)
- Right: Allocation order and amounts were exact
- Right: Took 7 requests

**Code mode: passed.** Recorded the 50126 payment and allocated 37626 to INV-02840 and 12500 to INV-03247, which is correct. ($0.059, 9 requests, 3.5 min)
- Right: Its summary explained the arithmetic (21152 + 37626 = 58778)
