---
title: "Muse Wonder on Pydantic AI Transit Planner"
description: "Journey planning over a real Dresden public transport timetable, with an SVG map of each answer. Tool calling 40%, code mode 90%; rank 24 of 32."
canonical: https://models.pydantic.dev/models/muse-wonder/transit_planner/
---

# Muse Wonder on Pydantic AI Transit Planner

> Journey planning over a real Dresden public transport timetable, with an SVG map of each answer. Tool calling 40%, code mode 90%; rank 24 of 32.
>
> Markdown copy of https://models.pydantic.dev/models/muse-wonder/transit_planner/. 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/transit_planner.md. The model on every Pydantic AI benchmark: https://models.pydantic.dev/models/muse-wonder.md

| Mode         | Score | Tasks passed | Cost   | Requests | Tool calls | Time      |
| ------------ | ----- | ------------ | ------ | -------- | ---------- | --------- |
| Tool calling | 40%   | 4 of 10      | $11.67 | 718      | 766        | 109.4 min |
| Code mode    | 90%   | 9 of 10      | $14.88 | 359      | 352        | 105.1 min |

Each task was run once per mode.

## Review

Written by an LLM from the runs' transcripts.

#### Overall

`gateway/meta-muse:muse-wonder-1.0` passed 13/20 runs: 4/10 in `tools` and 9/10 in `code_mode`. Six failures exhausted the 80-request limit; the remaining failure was a completed but incorrect departure profile. No terminal failure was attributed to the provider.

#### Where it does well

Both modes solved `meeting_point`, `one_change`, `one_vehicle` and `walking_change`. Successful answers handled repeated-run identifiers, interpolated boarding times, platform walks and the 120-second transfer margin. Code mode additionally completed overnight routing, latest-departure routing, Saturday direct routing and both tours. It evaluated 24 orders for `timed_tour` and 120 for `tour`.

Completed runs produced the required SVG artifacts. The tools-mode `saturday_direct` run also wrote its SVG, but failed to submit the answer before its budget expired.

#### Mistakes it makes

Tools mode repeatedly mishandled SQL identifiers, CTE scope and intermediate tables. It spent requests inspecting counts, rebuilding data and rechecking candidates instead of completing delivery. `departure_profile` additionally seeded journeys outside the origin and reversed its dominance comparison, producing tables as large as 180,083,918 rows.

Code mode's failed profile interpolated from previously interpolated stops instead of original timed anchors. Its validation reused that logic, illustrating how extensive checking can preserve a shared preprocessing error.

Six code-mode runs hit the 256 MiB memory limit before recovering. Unsupported Python operations caused further repairs. Nine code-mode runs loaded substantial timetable data directly in Python despite the handbook's `run_sql` requirement. A smaller presentation error survived grading: tools-mode `walking_change` labeled `63480` as `17:53` instead of `17:38`.

#### Tool calling compared with code mode

Code mode used 359 requests versus 718—exactly half—and eliminated request-limit failures. Its loops and compact graph searches were markedly more effective for routing and tour enumeration. It was not cheaper: total reported cost was $14.8772 versus $11.6667, about 28% higher. It also used slightly more requests for `one_vehicle` (31 versus 29).

For this benchmark, code mode is the stronger choice, with particular attention needed to memory-efficient loading and independent validation of interpolation.

## Runs

### one_vehicle

**Tool calling: passed.** Passed in 29 requests with a 399-second initial walk and one bus, arriving at `30480`. ($0.85, 29 requests, 4.9 min)
- Right: Searched platforms within 400 metres after finding no vehicle directly linking the stations.
- Right: Selected `R27f8d4b1+2`, boarding `P0091960a` at `29940` and alighting `P6e8c05a2` at `30480`; `29400 + 399 <= 29940`.
- Right: Kept the walk outside the vehicle-leg list and drew it separately.
- Mistake: The statistics query and a later interpolation query failed on unquoted `at`.
- Mistake: A multi-statement query referenced `near_o` outside its CTE scope, requiring separate replacement queries.

**Code mode: passed.** Passed in 31 requests, selecting the same 399-second walk and `R27f8d4b1+2` bus journey as tools mode. ($1.14, 31 requests, 5.1 min)
- Right: Enumerated start/end walking candidates and checked repeated services after `29400`.
- Right: Returned `P0091960a` at `29940` to `P6e8c05a2` at `30480`, keeping the walk outside the vehicle-leg list.
- Right: Checked the written SVG persisted.
- Mistake: A SQL query failed on unquoted `at BETWEEN ...`.
- Mistake: Python calendar code called unsupported `datetime.date.timetuple()`, requiring a revised implementation.
- Mistake: After substantial SQL exploration, reparsed the timetable in Python, duplicating loading work and departing from the `run_sql` requirement.

### saturday_direct

**Tool calling: error.** Found the correct direct tram and wrote `/out/journey.svg`, but exhausted 80 requests before submitting the structured answer. ($2.17, 80 requests, 13.5 min)
- Right: Identified `Rb28d92d7`, from `P7fa04a55` at interpolated time `33484` to `P1093f876` at `34560`.
- Right: Checked walking and transfer alternatives; its reported best one-change alternative arrived later, at `34971`.
- Right: Created the required SVG before the limit.
- Mistake: Repeated unquoted-`at` errors and additional alias/syntax errors consumed requests during calendar and expansion setup.
- Mistake: Repeated large interpolation CTEs while checking alternatives instead of reusing a materialized timetable.
- Mistake: After `write_file`, spent the last request on `SELECT 33300 AS start_s, 33484 AS board_s, 34560 AS arr_s...`. It should have called `final_result`.

**Code mode: passed.** Passed in 32 requests with `Rb28d92d7`, boarding at `33484` and arriving at `34560`. ($1.18, 32 requests, 7.2 min)
- Right: Included untimed calls, finding a faster service than the initially visible timed arrival at `35460`.
- Right: Recovered with compact, time-filtered run structures and used a time-dependent search to check alternatives.
- Right: Verified the interpolation and service eligibility, wrote the SVG, and called `final_result`.
- Mistake: Expansion failed on an incorrect `k.k` binding, then exceeded 256 MiB when materializing full run data.
- Mistake: The first compact rebuild was rejected by the code type checker for subscripting possibly `None` values.
- Mistake: Direct Python timetable parsing bypassed the handbook's `run_sql` loading requirement.

### one_change

**Tool calling: passed.** Passed in 68 requests with two vehicles arriving at `28440`, after several timetable-building repairs. ($0.84, 68 requests, 10.5 min)
- Right: Found `Rafeef850`, boarding `P0708873e` at interpolated time `27669` and alighting `P66c27b1c` at `27960`.
- Right: Checked `27960 + 72 + 120 = 28152 <= 28200`, then used `R620ec7d9` from `P3b6efaff` to `P4c09fc0c` at `28440`.
- Right: Compared against the one-vehicle best arrival of `29160` and wrote the correctly attributed SVG.
- Mistake: Three early queries repeated the unquoted-`at` parser problem.
- Mistake: Intermediate interpolation tables unexpectedly collapsed to five rows and then one run; the agent rebuilt them before obtaining all `163359` calls.
- Mistake: Rebuilt run instances with `(day_offset, run)` identity only after earlier searches, adding avoidable work.

**Code mode: passed.** Passed in 30 requests with the same two vehicle legs and `28440` arrival as tools mode. ($0.87, 30 requests, 6.1 min)
- Right: Built the expanded timetable with `run_sql`, including service-day offsets and interpolated calls.
- Right: Explicitly verified `27540 + floor(240 * 527 / 980) = 27669` for boarding `Rafeef850`.
- Right: Checked the 72-second walk plus 120-second margin before `R620ec7d9` at `28200`, and generated the SVG.
- Mistake: The untimed-call statistics query initially used unquoted `at` and failed before correction.
- Mistake: Created a dummy `timed_calls` table before replacing it with the actual interpolation calculation.
- Mistake: Used three successive SVG-generation calls after verifying the journey, adding avoidable request overhead.

### walking_change

**Tool calling: passed.** Passed in 68 requests with a bus–tram journey arriving at `63480`; the SVG's human-readable clock labels were wrong. ($0.69, 68 requests, 7.6 min)
- Right: Returned `R76d2117b+4`, `Pff25da30` `61560` to `P6e794064` `62040`, then `R3a0dccd4+54`, `P72ccec8b` `62520` to `P9e29d07a` `63480`.
- Right: Verified the transfer as `62040 + 78 + 120 = 62238 <= 62520`.
- Right: Checked one-, two- and three-vehicle alternatives and verified repeat offsets against raw calls.
- Mistake: Setup produced repeated unquoted-`at` errors, a nested-window error, an incorrect `range` binding and a query against nonexistent `nxt_label_check`.
- Mistake: During search it detected previous-day/current-day mixing that produced negative arrival times and rebuilt a bounded event table.
- Mistake: In commentary and the final SVG, labeled `63480` as `17:53`; it is `17:38`. The seconds-valued answer remained correct.

**Code mode: passed.** Passed in 29 requests with the same two-leg journey arriving at `63480` as tools mode, and correctly labeled that time `17:38`. ($0.88, 29 requests, 10.7 min)
- Right: Used a time-dependent platform search with bounded timetable expansion and reconstructed both vehicle legs.
- Right: Verified `R76d2117b+4` and `R3a0dccd4+54` against repeat offsets and checked `62040 + 78 + 120 <= 62520`.
- Right: Checked earlier destination candidates and verified the SVG's dimensions and identifying attributes.
- Mistake: Repeated dictionary-based CSV loading exceeded 256 MiB and reset the sandbox before a compact rebuild succeeded.
- Mistake: Loaded the timetable through Python CSV parsing despite the `run_sql` requirement.
- Mistake: Continued with two further verification calls after writing and checking the SVG, adding overhead without changing the answer.

### after_midnight

**Tool calling: error.** Built Friday/Saturday timetable tables but exhausted 80 requests before completing a transfer search. No final journey or SVG was returned. ($1.13, 80 requests, 11.6 min)
- Right: Read `DATA.md`, recognized previous-service-day journeys, and eventually combined Friday times shifted by `-86400` with Saturday times.
- Right: Computed platform-based walking access, including the 394-second walk to `P241f33b3`.
- Mistake: During interpolation setup, `run_sql` twice used unquoted `at`, then queried the nonexistent `v_calls_s`; several diagnostic calls followed before aliases fixed the parser problem.
- Mistake: Spent repeated calls inspecting services, station membership and direct connections, including rebuilding `expanded_calls`. The last query still searched only one-vehicle journeys, whose best result arrived at `18575`.
- Mistake: Should have built a service-day-keyed timetable once and moved promptly to a transfer search, preserving requests for `write_file` and `final_result`.

**Code mode: passed.** Passed in 30 requests, recovering from a memory reset and finding the overnight two-bus journey arriving at `6420`. ($1.26, 30 requests, 7.5 min)
- Right: Used compact timetable structures after full expansion exceeded memory.
- Right: Correctly converted Friday-service times: `R93fefd15` boarded at `91680 - 86400 = 5280` and alighted at `5492`.
- Right: Checked the 76-second walk and margin: `5492 + 76 + 120 = 5688 <= 5700`, then took `R900bf42f+2` to `P453df67b` at `6420`.
- Mistake: The initial expanded dictionary graph exceeded the 256 MiB sandbox limit and reset the session.
- Mistake: A later verification loop unpacked three values from two-item `zip(...)` results, causing `ValueError` before correction.
- Mistake: After initial SQL loading, parsed timetable files directly with Python rather than following the handbook's `run_sql` loading requirement.

### arrive_by

**Tool calling: error.** Found a latest-departure candidate at `63360`, but continued checking alternatives until the 80-request limit prevented delivery. ($1.30, 80 requests, 10.1 min)
- Right: Applied the Thursday calendar, repeat expansion and distance interpolation.
- Right: Searched departures after `63360` and checked the 64-second transfer walk at Straßburger Platz.
- Mistake: Early `run_sql` calls failed on unquoted `at`, reused a statement-local `valid` CTE in another statement, and attached `ON 1=1` to a `CROSS JOIN`.
- Mistake: After identifying `63360`, repeatedly expanded and checked longer journeys. The final query returned no qualifying three-leg alternative, but no SVG or `final_result` followed.
- Mistake: Should have consolidated the bounded optimality checks and reserved requests to submit the verified journey.

**Code mode: passed.** Passed in 43 requests, returning departure `63360` and arrival `64440`, before the `64800` deadline. ($1.24, 43 requests, 10.8 min)
- Right: Enumerated candidate first departures in descending order and searched onward journeys until finding a feasible candidate.
- Right: Returned `R1aabe4da+29` from `P10db34c8` at `63360` to `P3b6efaff` at `63900`, then `Rfd6f9e2d+67` from `P6ea0167f` at `64260` to `P0a9e487a` at `64440`.
- Right: Verified `63900 + 64 + 120 <= 64260` and checked the repeat offsets with SQL.
- Mistake: Early code tried sorting `PosixPath` objects without `key=str`; SQL normalization then failed on `days` and unquoted `at`.
- Mistake: Repeated a candidate scan under an alternative departure interpretation even though the winning journey had no initial walk.
- Mistake: Switched to direct Python file parsing instead of continuing the required `run_sql` loading workflow.

### departure_profile

**Tool calling: error.** Created very large journey tables with incorrect seeding and dominance logic, then exhausted 80 requests without an answer. ($1.10, 80 requests, 17.0 min)
- Right: Recognized that service-day identity must accompany repeated run identifiers and rebuilt `stop_times` with `dnum`.
- Right: Noticed that its results contained only early-morning departures instead of the requested `25200`–`28800` window.
- Mistake: In the rebuilt `seeds` query, `LEFT JOIN walk_edges w ON w.dst=s.place` never restricted the walk's source to the origin station. It seeded boardings throughout the network.
- Mistake: The dominance expression `ORDER BY jdep DESC ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING` compared against earlier departures. It should compare against departures no earlier than the candidate, handling equal-departure ties explicitly.
- Mistake: Expanded `lvl2` to `141687781` rows, then later `180083918`, with repeated 30-second query stops. Rebuilding retained the faulty dominance expression; final destination results still had departures only around `20000`–`20861`.
- Mistake: Should have corrected origin seeding and dominance before further expansion, and pruned states before materializing transfer combinations.

**Code mode: failed.** Returned 12 two-vehicle journeys and an SVG in 47 requests, but failed. Its timetable interpolation violated the original-anchor rule, and subsequent checks reused that error. ($2.49, 47 requests, 15.7 min)
- Right: Included initial, transfer and final walks and iterated routing values until no changes remained at the eighth layer.
- Right: Compared candidate departures against later departures beyond `28800`, correctly addressing global dominance rather than filtering only within the requested hour.
- Right: Reconstructed 12 journeys, with reported departures from `25326` through `28620`, and drew all 24 vehicle legs.
- Mistake: In `interpolate_one`, and again in the compact rebuild, searched backward using `if arr[j] is not None` while filling `arr` in place. Previously interpolated stops therefore became anchors. It should have selected anchors only where the original `at` was present.
- Mistake: The later `raw_trace` validation repeated the same interpolation algorithm, and the Dijkstra cross-check used the same expanded timetable. Neither independently checked the incorrect times.
- Mistake: Initially stored run references in service sets, producing no expanded runs; after fixing that, hit a 256 MiB memory reset and later a 30-second execution reset.
- Mistake: Loaded most data through direct Python parsing despite the `run_sql` requirement. The supplied result gives no grader diagnostic, so the exact rejected values cannot be established.

### meeting_point

**Tool calling: passed.** Passed in 73 requests, choosing Albertplatz (`Sbb9212fa`) at `33701` and drawing both journeys. ($1.14, 73 requests, 11.2 min)
- Right: Iterated earliest-arrival labels to convergence and compared the friends' arrival times by station.
- Right: Returned `Rc0124950`: `Pda4a5390` at `33300` to `P291e54d3` at `33701`, and `Rfa439a34`: `Pb4e674b9` at `32460` to `Pcb3f34ed` at `33692`.
- Right: Used `write_file` for the required SVG and `final_result` for the answer.
- Mistake: Interpolation setup failed once because `at` was unquoted.
- Mistake: The final sanity-check `run_sql` combined a leg-verification query with a clock-arithmetic query; only the latter result was returned, so that call did not expose the intended leg verification.
- Mistake: The successful search consumed 73 of 80 requests, leaving little operational margin.

**Code mode: passed.** Passed in 27 requests, finding the same Albertplatz meeting at `33701` as tools mode. ($1.35, 27 requests, 10.5 min)
- Right: Used compact timetable representations and compared two routing implementations.
- Right: Reconstructed `Rc0124950` arriving at `33701` and `Rfa439a34` arriving at `33692`, then selected the later arrival as the meeting time.
- Right: Verified the interpolated alighting times and checked the SVG's required attributes.
- Mistake: Initial file inspection failed on sorting `PosixPath` objects, and dictionary-heavy loading exceeded 256 MiB.
- Mistake: A `del grid` statement was unsupported by the sandbox; the next call assumed `walk_adj` existed and raised `NameError`.
- Mistake: Most timetable loading used Python file reads rather than the prescribed `run_sql`.

### timed_tour

**Tool calling: error.** Prepared the timetable and explored initial rides, but never completed the visit-order search before reaching 80 requests. ($1.02, 80 requests, 9.9 min)
- Right: Converted the opening windows correctly: Pohlandplatz `38700`–`42300`, TU `36900`–`42300`, Mickten `42300`–`47700`, with a `900`-second stay.
- Right: Built interpolated events, boarding/alighting tables and platform walks.
- Mistake: Spent many requests on exploratory counts and probes, including `SELECT 'test'`, a dummy recursive CTE and `SELECT version()`.
- Mistake: Queries referenced nonexistent `run`, `name`, `timezone` and `pp.w` bindings at different stages.
- Mistake: Only near the end did it enumerate first rides from Pirnaischer Platz; its final call merely looked up line labels. It should have implemented the reusable routing calculation and evaluated the 24 visit orders much earlier.

**Code mode: passed.** Passed in 28 requests with five vehicle legs and return time `44160`, visiting Prohlis, TU, Pohlandplatz and Mickten in that order. ($1.45, 28 requests, 11.9 min)
- Right: Evaluated all 24 visit orders with timetable routing and opening-window constraints.
- Right: Accounted for the initial walk after Prohlis: next vehicle departed at `35640`, while the visit departure was `35523`.
- Right: Returned visits `34440`–`35523`, `37080`–`38312`, `39480`–`40560` and `42300`–`43260`, satisfying the required stays and windows.
- Right: Verified the interpolated `38312` boarding time and produced the SVG.
- Mistake: Initial service lookup assumed every run's service appeared in `services.txt`, causing `KeyError: V3db19490`; it needed to handle change-only services.
- Mistake: Near completion, attempted `Path('/').iterdir()` outside the permitted mount and received `PermissionError`.
- Mistake: Loaded the routing data directly through Python rather than `run_sql`.

### tour

**Tool calling: error.** Implemented iterative SQL routing but spent the 80-request budget on infrastructure and initial-station searches, without producing a tour. ($1.43, 80 requests, 13.0 min)
- Right: Expanded Saturday services and Friday spillover and constructed walking and vehicle edges.
- Right: Eventually recognized that a visited-set/current-station dynamic program could avoid separately evaluating hundreds of segment searches.
- Mistake: Repeated parser errors involving `at`, then incorrectly diagnosed `n` as the reserved identifier.
- Mistake: Tried forbidden `COPY`, a table macro referring to nonexistent `btbl`, and views referencing `cur` or `cur2` before creating those tables.
- Mistake: Advanced routing rounds one request at a time. The last result still listed earliest arrivals from the starting station, such as Wasaplatz `36900` and Julius-Vahlteich-Str. `37200`.
- Mistake: Should have batched relaxation rounds and introduced visited-set states before spending the budget on isolated segment experiments.

**Code mode: passed.** Passed in 62 requests with 12 vehicle legs and return time `48660`, after evaluating all 120 station orders and spending substantial effort on an alternative visit interpretation. ($3.01, 62 requests, 19.5 min)
- Right: Recovered from memory exhaustion using compact integer encoding and bounded timetable data.
- Right: Evaluated all 120 permutations and selected Julius-Vahlteich-Str. → Altpieschen → Waldschlößchen → Marienberger Straße → Wasaplatz.
- Right: Checked individual segment times and interpolations, calculated visit departures, and drew all 12 legs.
- Mistake: Early rebuilds encountered `KeyError: V3db19490`, parsed a station identifier as an integer coordinate, and called unsupported `bytearray`.
- Mistake: After finding `48660`, explored a stricter platform-continuity interpretation, found a `50012` candidate, then returned to the station model. This consumed many calls and included speculation about the checker rather than resolving the rule directly.
- Mistake: Used direct Python file loading instead of the required `run_sql`; at $3.0051, this was the most expensive run.
