---
title: "GPT-6.2 Sol on Pydantic AI Transit Planner"
description: "Journey planning over a real Dresden public transport timetable, with an SVG map of each answer. Tool calling 100%, code mode 100%; rank 1 of 32."
canonical: https://models.pydantic.dev/models/gpt-6.2-sol/transit_planner/
---

# GPT-6.2 Sol on Pydantic AI Transit Planner

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

| Mode         | Score | Tasks passed | Cost  | Requests | Tool calls | Time     |
| ------------ | ----- | ------------ | ----- | -------- | ---------- | -------- |
| Tool calling | 100%  | 10 of 10     | $0.77 | 161      | 162        | 12.3 min |
| Code mode    | 100%  | 10 of 10     | $0.71 | 125      | 125        | 11.4 min |

Each task was run once per mode.

## Review

Written by an LLM from the runs' transcripts.

#### Overall

gpt-6.2-sol passed all 20 runs: 10 cases in tool calling and the same 10 in code mode. Answers agreed between modes on every arrival time. Tool calling used 161 requests for $0.77; code mode used 125 requests for $0.71. No run failed, so the findings below are about waste and risk, not wrong answers.

#### Where it does well

- **Reads the rules correctly.** Every run handled untimed-call interpolation, repeats named `<run>+<k>`, the 400 m walk limit and the 120 s change margin.
- **Previous service day.** `after_midnight` in both modes included day `2026-338` at -86400, which is where both runs of the answer come from.
- **Proves optimality.** `saturday_direct` and `meeting_point` kept searching after a first answer until nothing improved.
- **Right algorithm for the question.** Backward search for `arrive_by`, bitmask search for `tour`, and a profile filter for `departure_profile`.

#### Mistakes it makes

- **Unquoted `at` in 20 of 20 runs.** Every conversation hit a DuckDB parser error on the `at` column, usually on the first query, and resent it with `"at"`. It never learned this across cases; `day` caused one more in `timed_tour`.
- **Multi-statement SQL loses results.** `run_sql` returns only the last statement. All 10 tool-calling runs sent bundles expecting several results and re-queried, about 20 extra requests in total (`one_change` and `timed_tour` three each).
- **Unverified shortcuts.** `timed_tour` (tools) pruned visit orders by hand; `tour` (tools) ignored an empty `ans_strict` check; `timed_tour` (code) noted a possible bug in its limit and carried on; `after_midnight` (code) assumed a two-hour cap.
- **Inconsistent `departure`.** Three runs reported the first boarding time where the others reported the stated start time. All passed.
- **Other waste.** A stray `from xml import __doc__` error, repeated `select version()`, and extra service days loaded.

#### Tool calling compared with code mode

Code mode was cheaper in 8 of 10 cases and used fewer requests in all 10 (7 to 17 against 11 to 23). The gain comes from looping SQL steps in Python until convergence and building the SVG and answer from variables instead of retyping numbers. For the hard cases it moved the search into Python: `timed_tour` and `tour` packed tens of thousands of rows into strings to get past a 200-row result limit, and `departure_profile` read the raw files directly, bypassing `run_sql`. Code mode's SVGs were plainer, mostly straight lines between boarding and alighting platforms. Tool calling kept everything in SQL, which produced long recursive CTEs that were resent whole after each syntax error.

## Runs

### one_vehicle

**Tool calling: passed.** Limited the work to runs passing within 400 m of both stations, interpolated their times and ranked single-ride options by finish time. Passed with `R27f8d4b1+2`, boarding 29940 after a 399 m walk, arrival 30480, in 11 requests. ($0.053, 11 requests, 43 s)
- Right: Found that the best option needs a 399 s walk from `P0a9e487a` to Strehlener Platz rather than boarding at Lennéplatz itself.
- Right: Restricted interpolation to candidate runs (`cand`), keeping queries small.
- Right: Checked the walk from every Lennéplatz platform and confirmed only one is within 400 m.
- Mistake: Read `DATA.md` in two calls because the first read was cut at `calls.txt`.
- Mistake: The interpolation query failed on `case when at is not null`; it fixed it with a `rename ("at" as c_at)`.
- Mistake: One two-statement call returned only the second result, so the origin coordinates came from a further call.

**Code mode: passed.** After one failed load, a single SQL query produced ranked one-ride options with start and end walks, and the next two calls drew the SVG and built the answer. Passed in 7 requests, the fewest of any run. ($0.039, 7 requests, 30 s)
- Right: One query covered interpolation, active services for two days, repeats and walks at both ends.
- Right: Marked the origin platform `P0a9e487a` as well as the two boarding platforms.
- Mistake: First call failed on unquoted `max(at+dwell)`.
- Mistake: Drew the leg as a straight line from board to alight, not through the stops.

### saturday_direct

**Tool calling: passed.** Found a direct tram 9 ride (`Rb28d92d7`, 33484 to 34560), then ran a bounded recursive search to check no journey with changes arrives earlier. Passed in 15 requests. ($0.055, 15 requests, 49 s)
- Right: Verified the direct ride is optimal: rounds 2 to 4 reached 125, 42 and 6 platforms with no finish at or before 34560.
- Right: Drew the leg through all 14 calls of the run.
- Mistake: Unquoted `max(at)` failed, and the retry returned only `select * from services`, so the maxima needed a third call.
- Mistake: `ORDER BY in a recursive query is not allowed` forced a rewrite with `min(v.arr) ... group by`.
- Mistake: A two-statement call returned only `direct_walk`, so the stop list was queried again.

**Code mode: passed.** Kept `best` and `frontier` tables in DuckDB and ran a SQL `step` in a Python loop until nothing changed, then read the minimum finish. Passed with the direct tram 9 ride arriving 34560, in 13 requests. ($0.052, 13 requests, 50 s)
- Right: Confirmed the direct ride against all multi-leg options: finish stayed 34560 through five rounds.
- Right: Fetched five small queries concurrently with `asyncio.gather`.
- Mistake: Query failed on unquoted `min(at)`.
- Mistake: A stray call `from xml import __doc__` raised `NotImplementedError` and wasted a request.
- Mistake: Listing `/data` took a call of its own.

### one_change

**Tool calling: passed.** Enumerated one-vehicle journeys (best 29160), then joined a second ride with the walk and 120 s margin and filtered to arrivals no later than 29160. Passed with arrival 28440 via `Rafeef850` and `R620ec7d9`, in 17 requests, the most of the simple cases. ($0.059, 17 requests, 52 s)
- Right: Used a plain two-ride join instead of a general search, which matches the 'at most 2 vehicles' limit.
- Right: Used the one-vehicle result as an upper bound for the two-vehicle query.
- Mistake: `select min(at),max(at)` failed on the unquoted column.
- Mistake: Three separate multi-statement calls returned only their last result (`select * from services` was lost twice, and the line labels once), costing about four extra requests.

**Code mode: passed.** Loaded the data and solved zero, one and two-vehicle options in a single SQL statement chain (`b1`, `a1`, `x1`, `b2`, `a2`) with a union ranked by arrival. Passed with arrival 28440, in 9 requests. ($0.051, 9 requests, 47 s)
- Right: One query produced all candidates including the pure-walk case.
- Right: Built the SVG and the answer dict from the query result in code, so no numbers were retyped.
- Mistake: First load failed on unquoted `max(at)`.
- Mistake: `a1` keeps only the earliest arrival per alighting platform and `b1` only the first boarding per run, a greedy cut that is fine for earliest arrival but was not checked.
- Mistake: Only the question's own service day was considered; adequate at 07:40.

### walking_change

**Tool calling: passed.** Ran a recursive CTE of up to 28 rounds over rides and walks and took the earliest finish. Passed with bus 62 to Pirnaischer Platz, a 78 m walk and tram 2, arriving 63480, in 16 requests. ($0.058, 16 requests, 54 s)
- Right: Checked first that no direct ride or pure walk exists (`walks` 0, `round1` joined to `dest` empty).
- Right: Chose the change with the short 78 s walk between `P6e794064` and `P72ccec8b`.
- Mistake: `select min(at),max(at+dwell)` failed on the unquoted column.
- Mistake: A four-statement call returned only the last result, so coordinates, walk length and line labels were fetched in three more single-statement calls.
- Mistake: Gave `departure` as the boarding time 61560 rather than the 17:05 start (61500), unlike its `one_change` answer; it passed.

**Code mode: passed.** Wrote an async `rounds()` function that creates one table per round (`v1`, `v2`, ...) and tightens the limit once a finish is found. Passed with arrival 63480, changing by a 341 m walk from Prager Straße to Altmarkt, in 12 requests. ($0.058, 12 requests, 59 s)
- Right: Fixed the reserved-word error in one line with `re.sub(r'\bat\b','"at"',q)` instead of retyping the query.
- Right: Stopped after round 5 with no new platforms and best 63480 found in round 2.
- Right: Confirmed no pure walk exists between the two stations.
- Mistake: Query failed on unquoted `at+dwell`.
- Mistake: Picked a 341 m change where the tools run used a 78 m one on the same two runs; same arrival.
- Mistake: Gave `departure` as boarding time 61560, not the 17:05 start.

### after_midnight

**Tool calling: passed.** Loaded the files, built interpolated call times for the previous service day (`shift` -86400) and the question's day, then ran a recursive CTE over rides and walks. Passed with arrival 6420 on `R93fefd15` and `R900bf42f+2`, in 15 requests. ($0.066, 15 requests, 57 s)
- Right: Included service day `2026-338` with a -86400 shift, which is where both runs of the answer come from.
- Right: When the direct-ride query returned no rows it moved straight to a recursive search with the 120 s plus walk change margin.
- Right: Re-read the four chosen calls from `ev` before writing the SVG.
- Mistake: First `run_sql` failed on unquoted `min(at)`; the whole load was resent with `"at"`.
- Mistake: Two multi-statement calls returned only the last statement's result (`max(step*copies)` and a `max(...)` check), so the coordinate and leg queries had to be sent again.

**Code mode: passed.** Built the timetable in SQL, pulled 2057 events and 982 places into Python in pages of 200 with `asyncio.gather`, and ran a round-based search in Python. Passed with the same journey as tools (arrival 6420), in 11 requests. ($0.058, 11 requests, 56 s)
- Right: Included service day `2026-338` at -86400.
- Right: Worked around the 200-row result limit with `limit 200 offset {i}` pages fetched concurrently.
- Right: Checked interpolated times are monotonic (`arr<prev` count 0).
- Mistake: First call failed on unquoted `min(at)`; the load was resent.
- Mistake: Only events with `arr<=7200` were loaded, an assumed two-hour cap that happened to contain the answer.
- Mistake: Gave `departure` as the boarding time 5280 rather than the 01:10 start (4200); it passed.

### arrive_by

**Tool calling: passed.** Built a backward latest-departure search as a recursive CTE with `using key(board)` from the destination, then picked the latest departure from Pohlandplatz. Passed with departure 63360 and arrival 64500, in 15 requests. ($0.065, 15 requests, 63 s)
- Right: Searched backwards from the 18:00 deadline (`e.arr+w.secs+120<=f.dep`), which fits a leave-as-late-as-possible question.
- Right: Drew each leg through its intermediate stops using a `string_agg` of scaled coordinates.
- Mistake: First load failed on unquoted `max(at+dwell)`.
- Mistake: A call with four `describe` statements and `select version()` returned only the last result; `select version()` was then sent again on its own.
- Mistake: `select l.leg.*` failed with 'Did not expect more than one column in front of a star expression', and the retry bundled a second statement so the leg rows were lost and queried a third time.

**Code mode: passed.** Seeded a `best` table with last rides into Lennéplatz and expanded backwards in a Python loop of SQL steps until `improved` hit 0 after five rounds. Passed with departure 63360 and arrival 64500, in 12 requests. ($0.057, 12 requests, 55 s)
- Right: Backward expansion from the deadline with `board_time-w.walk-120` as the limit.
- Right: Loop stopped on convergence (1087, 729, 147, 11, 0 improvements) with the latest departure stable at 63360.
- Right: Checked the 64 s transfer walk and both end stations before answering.
- Mistake: First call ran `sorted(p.iterdir())` with an undefined `p` yet returned file previews, so some earlier state was reused; it was not needed.
- Mistake: Load failed on unquoted `min(at)`.
- Mistake: Drew each leg as a straight line between board and alight only.

### departure_profile

**Tool calling: passed.** Computed earliest arrival per start time with a recursive CTE keyed on `(st, ap)`, then filtered dominated departures with a window `min(fin)` over later start times. Passed with 12 journeys, in 16 requests. ($0.10, 16 requests, 1.6 min)
- Right: Compared against later departures outside the 07:00-08:00 window by bounding the search with the best journey leaving after 08:00 (`fin` 31063).
- Right: Kept one journey per departure and dropped dominated ones with `fin<later`.
- Mistake: The big interpolation query failed on unquoted `at` and was resent in full.
- Mistake: `legs[i].*` was a syntax error; replaced with `unnest(legs[i])`.
- Mistake: `select version()` was run twice and a three-statement call returned only its last result, so the coordinates were queried again.

**Code mode: passed.** Read the raw files with `Path(...).read_text()` in Python, interpolated times itself, and ran a reverse scan over 78120 events to get the arrival profile. Passed with 12 journeys, in 14 requests. ($0.087, 14 requests, 81 s)
- Right: Did the whole search in Python after using SQL only for active services and nearby platforms.
- Right: Checked the best journey leaving after 08:00 (`31063` from `28927`) before filtering dominated ones.
- Right: Verified no run has a departure after its next arrival (`bad` empty).
- Mistake: Load failed on unquoted `min(at)`.
- Mistake: Bypassed `run_sql` for the 5 MB `calls.txt`, against the handbook's instruction to load with `run_sql`; it passed.
- Mistake: Chose different change platforms from the tools run for the `R45005fd8` journeys (`Pd6ad09b1` instead of `P9d96d2d3`), same times.

### meeting_point

**Tool calling: passed.** Built per-friend earliest arrivals with table macros `nextj()` and `meet()`, iterated rounds until `improved` was 0, and picked the station with the lowest `greatest(a.t,b.t)`. Passed with station `Sbb9212fa` at 33701, in 16 requests. ($0.070, 16 requests, 62 s)
- Right: Pruned `edges` and `j` to `alight_time<=33701` after the first candidate, then kept iterating to confirm no multi-leg journey beat it.
- Right: Counted final walks to any platform of a station when computing arrival at that station.
- Mistake: First load failed on unquoted `max(at)`.
- Mistake: Two multi-statement calls lost their earlier results, so the `improved` count and the coordinates each needed a separate follow-up call.

**Code mode: passed.** Built run instances over a 15-day range with `isodow`, then iterated a SQL `step` in a Python loop for both friends until no changes, and joined the two arrival tables per station. Passed with `Sbb9212fa` at 33701, in 15 requests. ($0.080, 15 requests, 73 s)
- Right: Loop converged in five rounds (1461, 866, 82, 2, 0 changes).
- Right: Ranked stations by `greatest(a.tm,b.tm)` and listed the top 15 before choosing.
- Mistake: Query failed on unquoted `min(at)`.
- Mistake: Checked 15 earlier service days where one previous day would do; only shift 0 produced instances.
- Mistake: Drew the second friend's start walk from `P04395d67` (14 m) although the journey boards at `Pb4e674b9`, a platform of the start station; harmless.

### timed_tour

**Tool calling: passed.** Wrote a table macro `route(origin, tim)` for earliest arrivals and expanded visit orders by hand in stages (`routes2`, `routes3`, `routes4`, `returns`), checking each station's time window. Passed with order Prohlis, TU, Pohlandplatz, Mickten and return at 44160, in 23 requests, the most of any case. ($0.12, 23 requests, 2.1 min)
- Right: Encoded the visit windows in a `stations` table with `opens` and `closes` and tested `greatest(arrival,opens)+900<=closes` at each stage.
- Right: Compared both complete orders that reached the end (`GTPM` 44160, `GPTM` 45960) and took the earlier.
- Right: Marked both stations and platforms in the SVG.
- Mistake: Unquoted `at` failed, then `('2026-'||d) day` failed because `day` needed quoting; the large build query was sent twice.
- Mistake: Visit orders were pruned by hand across four staged queries rather than by one exhaustive search, so correctness rests on the manual pruning being right.
- Mistake: Three multi-statement calls lost their first result and were repeated.

**Code mode: passed.** Packed 65012 timetable events into fixed-width strings to get them out of SQL, then ran a Python scan per state and a bitmask DP over the four stations with their time windows. Passed with return at 44160, in 17 requests. ($0.11, 17 requests, 2.0 min)
- Right: Exhaustive DP over `(mask, station)` states with `opens` windows, rather than hand-picked orders.
- Right: Got the full timetable into Python in two queries with `printf('%04d%05d%05d%04d%s', ...)` and `string_agg`.
- Right: Compared both final states (`49080` and `44160`) for the return leg.
- Mistake: Load failed on unquoted `max(at)`.
- Mistake: Its own notes flag a possible bug in how `limit` is tightened across several targets; it went on without fixing or testing it and the result matched the tools run.
- Mistake: Two exploratory calls (`list(ref ...)` preview and `describe calls`) added nothing.

### tour

**Tool calling: passed.** Solved the five-station round trip in one recursive CTE with a visited bitmask (`using key(mask,place)`) and a 900 s stay folded into transfer edges. Passed with return at 48660 over 11 legs, in 17 requests. ($0.12, 17 requests, 2.2 min)
- Right: Put the whole search in SQL as a macro `search(lim)`, then re-ran it with the bound 48660 to get the path.
- Right: Issued two `run_sql` calls in parallel once (station platforms and `describe c`).
- Mistake: Interpolation query failed on unquoted `at`.
- Mistake: A stricter variant (`ans_strict`, `search(50000)`) returned no rows and was dropped without explanation; the first answer was submitted unverified by a second method.
- Mistake: The first leg listing came back unordered and truncated, needing a `journey_legs` table and another query.

**Code mode: passed.** Exported 47027 events and 2468 platforms through packed `string_agg` columns, then ran a Python event scan inside a bitmask DP over five stations. Passed with return at 48660 over 12 legs, in 15 requests. ($0.11, 15 requests, 1.9 min)
- Right: Tested the result format first (`list(i)` over `range(100)`), learned long values are cut, and designed `pack`/`unpack` around the 200-row limit.
- Right: Asserted every stay is at least 900 s and counted `data-run` (12) and `data-place` (24) in the written SVG.
- Right: Compared the return time from all five last stations (50177, 49920, 49877, 50012, 48660).
- Mistake: Load failed on unquoted `max(at)`.
- Mistake: Loaded three service days including the next day (`2026-340`), which cannot matter for a 10:00 start.
- Mistake: Returned 12 legs where the tools run found the same arrival with 11; the extra `R6a6680a8+4` ride replaces a walk.
