---
title: "MiniMax M3 on Pydantic AI Transit Planner"
description: "Journey planning over a real Dresden public transport timetable, with an SVG map of each answer. Tool calling 0%, code mode 10%; rank 29 of 32."
canonical: https://models.pydantic.dev/models/minimax-m3/transit_planner/
---

# MiniMax M3 on Pydantic AI Transit Planner

> Journey planning over a real Dresden public transport timetable, with an SVG map of each answer. Tool calling 0%, code mode 10%; rank 29 of 32.
>
> Markdown copy of https://models.pydantic.dev/models/minimax-m3/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/minimax-m3.md

| Mode         | Score | Tasks passed | Cost  | Requests | Tool calls | Time     |
| ------------ | ----- | ------------ | ----- | -------- | ---------- | -------- |
| Tool calling | 0%    | 0 of 10      | $3.15 | 794      | 885        | 74.1 min |
| Code mode    | 10%   | 1 of 10      | $2.25 | 759      | 759        | 82.3 min |

Each task was run once per mode.

## Review

Written by an LLM from the runs' transcripts.

#### Overall

The model passed **1 of 20 runs (5%)**. Seventeen exhausted the 80-request limit; two submitted incorrect answers. Only three runs returned final answers. The supplied costs total **$5.4002**. These results show poor reliability for autonomous timetable planning under this request budget.

#### Where it does well

It reads the data dictionary first and can implement important timetable details: weekday masks, previous-service-day offsets, repeat instances, distance-based interpolation, access checks, and SVG attributes.

The passing `one_change` code run correctly interpolated boarding at `27669` and validated a transfer requiring `27960 + 72 + 120 = 28152`, catching departure `28200` and arriving at `28440`. Code mode also caught and repaired its own transfer-margin error in `walking_change`.

Several unsuccessful runs made substantial progress. Both `saturday_direct` modes found the same `33484`–`34560` candidate. Tools-mode `meeting_point` and `saturday_direct` even wrote SVGs before exhausting their budgets.

#### Mistakes it makes

The dominant problem is failure to finish: repeated route inspection, SQL repairs, and post-solution checks consume the budget. It repeatedly queries unloaded tables, uses `r.run` instead of `r.ref`, and mishandles unquoted `at`.

Routing completeness is also weak. Tools-mode `one_change` filtered out untimed calls and arrived **900 seconds later** than the passing solution. Code-mode `one_vehicle` omitted repeat expansion from its candidate search. Other searches incorrectly charge station-centre walks, restrict intermediate platforms, or allow consecutive walks.

The sole pass therefore has limitations: its search imposed unnecessary initial walking and same-station transfer restrictions that happened not to prevent success.

#### Tool calling compared with code mode

Tools mode passed **0/10**, used **794 requests**, and cost **$3.1504**. Code mode passed **1/10**, used **759 requests**, and cost **$2.2498**, about **29% less**.

Code mode enabled actual graph searches and fuller timetable processing, but introduced memory resets, unsupported modules and Python features, and oversized tool-call loops. In `timed_tour`, it largely retained the inefficient pattern of one SQL query per model request. Its modest improvement does not establish dependable performance.

## Runs

### one_vehicle

**Tool calling: error.** Repeatedly searched for a vehicle serving both stations and exhausted 80 requests without a journey. ($0.18, 80 requests, 5.4 min)
- Right: Checked Wednesday services with `(days & 4) > 0`.
- Right: Investigated destination-side platforms within 400 metres.
- Mistake: Many successive `run_sql` queries restated the same empty direct-run intersection using different joins and counts.
- Mistake: The late origin-neighbour query measured from station `S6f32bdc5`, rather than every origin platform. This missed the useful platform-based walking approach identified in code mode.
- Mistake: It also explored one-transfer journeys despite the explicit one-vehicle constraint. It should have searched initial walk, one ride, and optional final walk combinations.

**Code mode: failed.** Submitted a one-vehicle journey arriving at `65280` after 64 requests, but failed the earliest-arrival requirement. ($0.23, 64 requests, 9.0 min)
- Right: Found the permitted 399-second walk from Lennéplatz platform `P0a9e487a` to Strehlener Platz platform `P0091960a`.
- Right: Interpolated `R636fb735` boarding to `64685`, verified its service, and wrote an SVG.
- Mistake: The candidate search enumerated base line-66 runs, predominantly on `V479271d1`, without expanding their repeat instances.
- Mistake: The late repeat check examined only the selected `R636fb735`, which has no repeats; it did not establish that earlier repeated services were unavailable.
- Mistake: It accepted waiting from `29799` until `64685` as optimal. It should have searched all active base and repeated runs, including permitted endpoint walks, before claiming earliest arrival.

### saturday_direct

**Tool calling: error.** Found `Rb28d92d7`, boarding at `33484` and arriving at `34560`, and wrote an SVG, but did not submit before the 80-request limit. ($0.29, 80 requests, 7.0 min)
- Right: Computed the untimed Spenerstraße call through distance-based interpolation.
- Right: Checked direct and transfer candidates and generated the required SVG.
- Mistake: Late in the run, numerous `run_sql` calls reformatted the same times and debugged `CAST(9.6 AS INTEGER)` instead of using `FLOOR` immediately.
- Mistake: Attempted forbidden `COPY ... TO '/tmp/path.txt'` and then a forbidden SQL read of `/out/journey.svg`.
- Mistake: It should have drawn a simple endpoint line and submitted the candidate once validation was complete.

**Code mode: error.** Found `Rb28d92d7` departing at `33484` and arriving at `34560`, then exhausted 80 requests rechecking alternatives without submitting. ($0.26, 80 requests, 8.9 min)
- Right: Repaired interpolation and generated repeated run instances.
- Right: Investigated initial walks, transfer journeys, and destination-side walks.
- Mistake: Early attempts imported unavailable `duckdb` and `subprocess` and probed inaccessible filesystem locations instead of using the supplied SQL interface.
- Mistake: After finding the direct candidate, repeatedly revisited route direction and transfer searches.
- Mistake: A late boarding display labelled `R2aa4cdd7` as `DIRECT` based on destination membership despite the destination occurring before the origin. It should have consistently required increasing call order and finished the artifact and submission.

### one_change

**Tool calling: failed.** Submitted two legs arriving at `29340` after 74 requests, but the answer failed. The passing code-mode journey arrives at `28440`, 900 seconds earlier. ($0.37, 74 requests, 8.9 min)
- Right: Verified boarding and alighting access for `Rd1190f25` and `R1aabe4da`.
- Right: Applied the 72-second transfer walk plus the `120`-second margin.
- Right: Wrote an `800×600` SVG with platform and run attributes.
- Mistake: The origin-departure query filtered on `(c.at + c.dwell) >= 27600` before interpolating null calls, excluding the earlier `Rafeef850` boarding at `27669`.
- Mistake: Later searches continued using timed calls only. It should have interpolated all calls before selecting departures; `Rafeef850` followed by `R620ec7d9` reaches the destination at `28440`.
- Mistake: Repeated syntax debugging and route rechecks consumed much of the 74-request run.

**Code mode: passed.** Passed in 55 requests with `Rafeef850` followed by `R620ec7d9`, arriving at `28440`, and wrote the required SVG. ($0.082, 55 requests, 4.4 min)
- Right: Interpolated boarding at `P0708873e` to `27669`, then alighted at `P66c27b1c` at `27960`.
- Right: Verified the 72-second walk to `P3b6efaff`; departure `28200` satisfies `27960 + 72 + 120 = 28152`.
- Right: Submitted both legs and marked their endpoints and run identifiers in an `800×600` SVG.
- Mistake: The search added an unnecessary station-centre-to-platform walk and restricted transfers to platforms of the same station. These restrictions happened not to prevent the passing answer.
- Mistake: Tested the handbook's illustrative run `R0a1b2c3d` as though it were real, producing `KeyError`.
- Mistake: SVG generation twice used `next(...)` on generator expressions that the sandbox represented as lists, before switching to dictionary lookup.

### walking_change

**Tool calling: error.** Built interpolated, repeated events and found a two-leg candidate arriving at `69420`, but kept exploring and exhausted 80 requests. ($0.15, 80 requests, 2.0 min)
- Right: Used Friday services, start time `61500`, and repeat identifiers such as `Rd047d0d2+4`.
- Right: Constructed walking-transfer searches with the required additional `120` seconds.
- Mistake: Schedule construction failed on nested window functions, misplaced `IGNORE NULLS`/`RESPECT NULLS`, and missing aliases before being repaired.
- Mistake: After building event tables, it repeatedly inspected individual routes and unattainable destination arrivals such as `61811` rather than finishing a complete reachability search.
- Mistake: It should have searched all permitted transfer and final-walk options systematically and reserved requests for reconstruction, SVG output, and submission.

**Code mode: error.** Found an invalid `63180` arrival, corrected the transfer calculation to obtain `63480`, then exhausted 80 requests after further search failures. ($0.25, 80 requests, 9.6 min)
- Right: Detected that the proposed `62220` transfer departure violated `62040 + 78 + 120 = 62238`.
- Right: Recomputed a candidate using `R76d2117b+4` and `R3a0dccd4+54`, with second departure `62520` and arrival `63480`.
- Mistake: The original boarding condition `max(T, t_prev_alight + 120)` overlapped walking and transfer allowance instead of adding them.
- Mistake: Even the corrected search allowed successive walking transitions without tracking the one-walk-per-gap restriction; it needed an explicit walk-used state.
- Mistake: Pagination exceeded 100 tool calls, a search exceeded 30 seconds, and a later search exceeded memory. The final rebuild failed on unsupported `del calls_dict, run_data`; no SVG or final answer was submitted.

### after_midnight

**Tool calling: error.** Investigated Friday overnight services and Saturday departures, but exhausted 80 requests without submitting a journey. ($0.31, 80 requests, 6.7 min)
- Right: Read `/data/DATA.md` first and considered both `2026-338` and `2026-339`, including subtracting `86400` from Friday times.
- Right: Used weekday masks `16` and `32` in `run_sql`.
- Mistake: During setup, repeatedly submitted multiple `SELECT COUNT(*)` statements despite receiving only the last result; eventually replaced them with `UNION ALL`.
- Mistake: During route exploration, repeatedly fetched the same runs and their already-established endpoints, including `Rbc17435d`, `Rb1b7f205`, and `R6313bec4`.
- Mistake: Late walking checks used selected origin platforms and the station centre rather than all origin platforms. It should have built the complete platform walking graph and performed a bounded earliest-arrival search.

**Code mode: error.** Eventually found and reconstructed a candidate arriving at `6420`, but reached 80 requests before writing the SVG or submitting. ($0.22, 80 requests, 8.8 min)
- Right: Handled Friday and Saturday service days and interpolated calls after sorting by `n`.
- Right: The final search processed 7940 states and reconstructed two rides with an intermediate walk.
- Mistake: Early `run_sql` results were treated as complete: it reported 200 platforms before discovering there were 2468.
- Mistake: Precomputing ride combinations exceeded the 268435456-byte memory limit and reset the session.
- Mistake: Repeated attempts to make `len(SimpleHeap)` work consumed additional requests. It should have used compact on-demand connections, an explicit heap-size method, and submitted immediately after reconstruction.

### arrive_by

**Tool calling: error.** Explored routes from Pohlandplatz to Lennéplatz but never completed the latest-departure calculation before reaching 80 requests. ($0.46, 80 requests, 10.5 min)
- Right: Used the Thursday service mask `8` and the relevant time bounds `59400` and `64800`.
- Right: Investigated repeats and eventually attempted distance-based interpolation.
- Mistake: The first `run_sql` station lookup queried `places` before loading it.
- Mistake: Interpolation queries repeatedly failed on unquoted `at`, nested window functions, and nonexistent aliases such as `c2`.
- Mistake: The final queries still inspected individual tram routes. It should have normalized call times and repeat instances once, then searched backward from `64800`, accounting for initial walks.

**Code mode: error.** Found a two-leg candidate leaving at `63360` and arriving at `64440`, but exhausted 80 requests during further checks. ($0.13, 80 requests, 5.5 min)
- Right: Expanded repeat instances and interpolated calls.
- Right: Found `R1aabe4da+29` followed by `Rfd6f9e2d+67`, with a 64-second transfer walk.
- Mistake: Attempted unavailable `duckdb`, then spent many calls diagnosing SQL syntax by quoting `access` before correctly quoting `at`.
- Mistake: A pagination loop exceeded the code-mode allowance of 100 tool calls.
- Mistake: Tried unsupported `time.time()` twice and `datetime.datetime.now()` once.
- Mistake: The first-leg list included departures as late as `98810` despite the `64800` arrival deadline. It should have pruned impossible departures and completed a bounded latest-departure search.

### departure_profile

**Tool calling: error.** Constructed candidate departures and transfer tables but reached 80 requests before producing the nondominated journey list. ($0.50, 80 requests, 11.2 min)
- Right: Recognized the departure interval as `[25200, 28800]`.
- Right: Worked on untimed calls, repeat offsets, walking transfers, and the `120`-second margin.
- Mistake: Initial queries referenced unloaded `places` and `services`; subsequent queries used nonexistent `r.run` and repeatedly failed on unquoted `at`.
- Mistake: The initial second-leg arrival join did not enforce destination call order; a late query explicitly added the requirement that Altpieschen occur after boarding.
- Mistake: The run ended investigating `R45005fd8+4`, without completing dominance filtering. It should have enforced call order throughout and compared candidates against later departures outside the requested interval too.

**Code mode: error.** Generated 31 candidate first boardings but repeatedly rebuilt its search after errors and reached 80 requests without a profile. ($0.21, 80 requests, 8.8 min)
- Right: Eventually loaded all 163359 calls rather than relying on capped SQL results.
- Right: Generated 10184 active run instances and computed their call times.
- Mistake: During candidate construction, added station-centre walking times of 37, 29, 55, and 68 seconds to the origin platforms. The rules allow starting at any origin platform without that walk.
- Mistake: Large intermediate structures exceeded the memory limit; subsequent attempts used unavailable `heapq`, `inspect`, and unsupported introspection.
- Mistake: The final requests repeatedly debugged `MinHeap.__len__`. It should have used supported data structures, correct platform-based initial states, and dominance filtering over the complete departure search.

### meeting_point

**Tool calling: error.** Found an Albertplatz meeting candidate at `33701` and wrote an SVG, but exhausted 80 requests before submitting the answer. ($0.15, 80 requests, 4.2 min)
- Right: Compared meeting times using `GREATEST(a.arrive, b.arrive)`.
- Right: Checked `Rc0124950` and `Rfa439a34`, with candidate arrivals `33701` and `33692`, and verified their access codes.
- Right: Detected missing interpolated times and rebuilt dependent tables after correcting interpolation.
- Mistake: Early queries treated `services.txt` and `service_changes.txt` as SQL tables.
- Mistake: The initial interpolation used `LAG`/`LEAD` without correctly skipping untimed calls; consecutive untimed calls retained null times.
- Mistake: After writing `/out/journey.svg`, it spent remaining requests on verification, including a forbidden SQL file read. It should have used the file tool if needed and reserved a request for `final_result`.

**Code mode: error.** Built expanded connections but exhausted 80 requests while debugging reachability for one traveller, without selecting and submitting a meeting point. ($0.22, 80 requests, 8.5 min)
- Right: Handled services absent from `services.txt` after encountering `V3db19490`.
- Right: Eventually computed interpolation in SQL and expanded 6852 Saturday run instances.
- Mistake: Materializing all boarding-to-alighting pairs repeatedly exceeded the memory limit.
- Mistake: Writing connections individually exceeded the 1000-suspension limit; writing roughly 2.6 million connections to `/out/connections.csv` then failed because `run_sql` could not read that path.
- Mistake: The final SQL relaxation stalled at 117 reachable places. It should have used compact connections or on-demand ride expansion and completed both travellers' arrival maps before minimizing their maximum arrival.

### timed_tour

**Tool calling: error.** Spent 80 requests inspecting individual lines and station connections without constructing a complete timed tour. ($0.57, 80 requests, 11.3 min)
- Right: Loaded the timetable and filtered Wednesday services for `2026-343`.
- Right: Investigated connections involving the required stations and possible transfer stations.
- Mistake: Repeatedly referenced missing columns or aliases, including `c.station`, `a.line`, `r`, and `p`.
- Mistake: Used incorrect line identifiers in several searches, including `L8603993f` for bus 333, before looking up the correct identifier `Led952996`.
- Mistake: The final calls searched `calls` for `R2593df05+%` and other `+` run names. Repeats must be generated from `repeats.txt`; they are not stored as separate calls.
- Mistake: It should have built the expanded timetable and searched visit order with 900-second stays and opening windows.

**Code mode: error.** Mostly wrapped individual SQL queries in Python and reached 80 requests without a complete timed tour. ($0.32, 80 requests, 6.9 min)
- Right: Loaded all seven timetable tables and identified Wednesday services.
- Right: Inspected repeat metadata, including a 900-second repeat interval for `Re96c421d`.
- Mistake: Loaded everything with `all_varchar=True`, then used numeric comparisons inconsistently; `c.n > 100` produced a type error.
- Mistake: Repeatedly used nonexistent `r.run` instead of `r.ref`.
- Mistake: Late route searches still joined raw base calls and required non-null times rather than using expanded, interpolated events.
- Mistake: It should have used Python for a visit-mask search with opening-window constraints instead of continuing individual line inspections.

### tour

**Tool calling: error.** Built timetable and ride tables but repeatedly redesigned the search, reaching 80 requests without a round trip. ($0.17, 80 requests, 6.8 min)
- Right: Expanded run instances and worked on interpolation and walking connections.
- Right: Eventually identified useful nearby stations, including Hauptbahnhof Nord.
- Mistake: The initial `ride_segments` construction restricted endpoints to the six named stations, excluding necessary intermediate transfers; Marienberger Straße consequently had no usable segments.
- Mistake: Late attempts swung from that restrictive graph to roughly two million rides, then arbitrary shorter-ride restrictions.
- Mistake: It should have retained the full transfer network and used a search state containing platform, time, and visited-station mask instead of repeatedly rebuilding incomplete graphs.

**Code mode: error.** Ran a restricted tour search yielding a candidate return time of `54812`, then exhausted 80 requests while expanding and rebuilding the search. ($0.33, 80 requests, 11.9 min)
- Right: Expanded 6852 Saturday run instances and implemented a visited-station search.
- Right: Reconstructed a candidate and investigated whether omitted nearby platforms could improve it.
- Mistake: Initially restricted useful platforms and rides, so the result did not establish optimality over the full transfer network.
- Mistake: Repeated unavailable `heapq` imports and used unsupported `time.time()`.
- Mistake: Expanding to 749 platforms and materializing useful legs exceeded the memory limit, erasing state late in the run. It should have used on-demand expansion and preserved enough budget to reconstruct and submit a fully checked tour.
