---
title: "GPT-6 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 90%, code mode 90%; rank 10 of 32."
canonical: https://models.pydantic.dev/models/gpt-6-sol/transit_planner/
---

# GPT-6 Sol on Pydantic AI Transit Planner

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

| Mode         | Score | Tasks passed | Cost  | Requests | Tool calls | Time     |
| ------------ | ----- | ------------ | ----- | -------- | ---------- | -------- |
| Tool calling | 90%   | 9 of 10      | $1.51 | 280      | 288        | 14.2 min |
| Code mode    | 90%   | 9 of 10      | $1.55 | 246      | 246        | 13.7 min |

Each task was run once per mode.

## Review

Written by an LLM from the runs' transcripts.

#### Overall

`gateway/openai:gpt-6-sol` passed 18/20 runs: 9/10 in each mode. Both failures were `tour`; all eight other task types plus `timed_tour` passed in both modes. There were no reported provider failures. The supplied results contain no expected answers or grading explanations, limiting diagnosis of the code-mode tour failure.

#### Where it does well

It handles timetable mechanics well after repair: distance-based interpolation, repeated-run identifiers, access restrictions, walking distances, and transfer margins. Both midnight runs correctly incorporated previous-day services and arrived at `6420`. Both departure-profile runs returned the same 12-point departure/arrival frontier, including checks against departures outside the requested interval.

It also solves more complex objectives: latest departure `63360`, meeting time `33701`, and window-constrained tour return `44160`. It consistently produced structured vehicle legs and SVG artifacts. Code mode sometimes improved itinerary simplicity: five vehicles versus seven for `timed_tour`.

#### Mistakes it makes

Every run encountered at least one SQL or Python error. There were 27 error responses in tools mode and 28 in code mode. Unquoted `at` and problematic aliases recur; retries sometimes changed unrelated syntax. Multi-statement SQL repeatedly hid intermediate results, prompting redundant queries. Four code-mode runs attempted unavailable `html` or `xml` imports.

Search completeness is uneven: several runs impose vehicle, time, or wait bounds without proving them sufficient. Visit transitions are a particular weakness. The tools-mode tour allows a walk into a visit and another walk out between vehicles, violating the single-walk rule. Code-mode `timed_tour` repaired a related issue in its selected answer. Code-mode `tour` explicitly tracked walking state, so its failure should not be assigned the same explanation without grader evidence.

#### Tool calling compared with code mode

Code mode used 246 requests versus 280, a 12.1% reduction, but cost slightly more: $1.5528 versus $1.5135. Accuracy was identical. Much of code mode merely wrapped individual `run_sql` calls; its clearer advantages appeared in loops, event scanning, and SVG assembly. It also introduced import/runtime errors and duplicated SQL preparation with direct CSV loading in both tour cases.

## Runs

### one_vehicle

**Tool calling: passed.** Passed with a `399`-second initial walk and `R27f8d4b1+2`, boarding at `29940` and arriving at `30480`. ($0.12, 26 requests, 65 s)
- Right: Found the nearby boarding platform `P0091960a` instead of restricting boarding to Lennéplatz.
- Right: Eventually interpolated all relevant calls and reran the search, confirming the same winning vehicle.
- Right: Kept the walk outside the vehicle-leg list and illustrated it separately.
- Mistake: Inspection failed on unquoted `at`; a later query referenced unloaded `lines`; repeat expansion used ambiguous `run` instead of `routes.run`.
- Mistake: Initially searched only explicitly timed boarding/alighting calls. This happened to find the winner, but the later interpolation was necessary to check omitted competitors.
- Mistake: Repeated several queries because earlier results in multi-statement calls were not returned.

**Code mode: passed.** Passed with the `399`-second walk to Strehlener Platz and `R27f8d4b1+2`, arriving at `30480`. ($0.11, 22 requests, 58 s)
- Right: Reduced interpolation to 72 candidate base runs and 1829 calls instead of processing the whole timetable.
- Right: Explicitly checked untimed candidate endpoints: 46 boarding and 57 alighting entries among 144 pairs.
- Right: Verified the repeat interval `1200`, selected endpoint times, and SVG existence.
- Mistake: Four SQL errors involved unquoted `at`, casting before `OVER`, querying `relevant` after its failed creation batch, and alias `seconds`.
- Mistake: The ranking used `ORDER BY alight_time,board_time` despite allowing final walks; it should rank by `alight_time + ew`. The selected winner had `ew = 0` and passed.

### saturday_direct

**Tool calling: passed.** Passed with `Rb28d92d7`, boarding `P7fa04a55` at `33484` and alighting `P1093f876` at `34560`. ($0.13, 25 requests, 65 s)
- Right: Filtered Saturday services and interpolated the non-minute boarding time `33484`.
- Right: Checked alternatives through five vehicle layers; the fifth layer was empty.
- Right: Verified both endpoint calls had `YY` access and wrote the geographically positioned SVG.
- Mistake: The interpolation batch failed on `at IS NOT NULL`; checking `base` afterward produced another error because it had not been created.
- Mistake: Repeated counts and coordinate queries after placing them before other statements in `run_sql`, which returned only the last result.

**Code mode: passed.** Passed with `Rb28d92d7` from `33484` to `34560`, matching tools mode. ($0.12, 25 requests, 66 s)
- Right: Interpolated the timetable, applied the Saturday mask, and expanded repeated runs.
- Right: Checked two-, three-, and four-vehicle alternatives before returning the direct ride.
- Right: Verified `YY` endpoint access and generated the required platform markers and run line.
- Mistake: The initial load batch failed on `min(at)`; the next query assumed its tables existed and produced a catalog error.
- Mistake: Interpolation again used unquoted `at IS NOT NULL`, requiring another repair.
- Mistake: Stopped with six fourth-layer reachability rows rather than checking until no further states remained; the selected answer passed.

### one_change

**Tool calling: passed.** Passed with two vehicles, `Rafeef850` and `R620ec7d9`, arriving at `28440` from the `27600` start. ($0.11, 21 requests, 60 s)
- Right: Compared direct journeys with two-vehicle journeys and respected the vehicle limit.
- Right: Used the interpolated first boarding time `27669` and a `72`-second platform walk; `27960 + 120 + 72 <= 28200`.
- Right: Included final walking in the final ranking, choosing arrival `28440` rather than an earlier alighting followed by a longer walk.
- Mistake: The interpolation query failed on `at IS NOT NULL`; service-day expansion then failed on the alias `day`. Both were repaired.
- Mistake: An intermediate ranking ordered by alighting time rather than `alighting + endwalk`; the subsequent query corrected this before submission.

**Code mode: passed.** Passed with `Rafeef850` and `R620ec7d9`, reporting departure `27669` and arrival `28440`. ($0.093, 16 requests, 49 s)
- Right: Compared one-vehicle candidates against two-vehicle candidates and included final walking in the objective.
- Right: Verified the `72`-second transfer and the interpolated boarding time `27669`.
- Right: Completed the case in 16 requests, the fewest of the supplied runs.
- Mistake: Loading required three repairs: quoting source `at`, renaming its still-unquoted alias `at`, and replacing alias `days` with `mask`.

### walking_change

**Tool calling: passed.** Passed with `R76d2117b+4` followed by `R3a0dccd4+54`, arriving at `63480`. ($0.14, 32 requests, 85 s)
- Right: Found the transfer from `P86f9a261` to `P9cd5b9a9`, approximately `341` walking seconds, within the `538` seconds between vehicles.
- Right: Applied the additional `120`-second transfer margin.
- Right: Examined additional vehicle layers and reconstructed the two-leg winner.
- Mistake: Table creation required repairs for unquoted `at` and aliases `days` and `seconds`.
- Mistake: Repeated several queries because multi-statement calls hid intermediate results.
- Mistake: Stopped after four layers even though the fourth layer still improved two platform labels; it did not establish convergence, although the answer passed.

**Code mode: passed.** Passed with the same two vehicles and arrival `63480` as tools mode. ($0.13, 25 requests, 79 s)
- Right: Built SQL walking edges and vehicle reachability tables with `arrival + walk + 120` transfer constraints.
- Right: Used a Python loop to continue checking alternatives until `path7` was empty, providing a stronger stopping check than tools mode.
- Right: Verified the chosen endpoint times and generated the SVG from the reconstructed legs.
- Mistake: An inspection query failed on unquoted `at`.
- Mistake: SVG preparation attempted unavailable `xml.sax.saxutils`; the following call recovered without that import.
- Mistake: Several multi-statement inspections had to be repeated to retrieve results hidden by the final statement.

### after_midnight

**Tool calling: passed.** Passed with two vehicles, arriving at `6420`: `R93fefd15` from `5280` to `5492`, then `R900bf42f+2` from `5700` to `6420`. ($0.13, 25 requests, 70 s)
- Right: Read `/data/DATA.md` first and used `run_sql` to interpolate calls and expand repeats.
- Right: Corrected service-day expansion to `UNION ALL` current-day services with previous-day services shifted by `-86400`.
- Right: Verified the transfer: `5492 + 76 + 120 = 5688`, before departure `5700`; wrote the required SVG.
- Mistake: During table creation, unquoted or unsuitable identifiers `days`, `at`, and `offset` caused three parser errors.
- Mistake: The first `active_runs` expression assigned only one day to services operating on both days; the replacement `UNION ALL` fixed this before routing.
- Mistake: Near the end, queried `lines` without loading it, causing a catalog error.

**Code mode: passed.** Passed with three vehicles and arrival `6420`, matching the tools-mode arrival but using an extra vehicle. ($0.19, 33 requests, 1.7 min)
- Right: Used `run_code` and `run_sql` to expand both service days with the correct `-86400` shift.
- Right: Paged timetable rows into Python and scanned reachable vehicles while applying walking and transfer margins.
- Right: After a geographically restricted search, checked all fetched events through `6420` and retained the same arrival.
- Mistake: Repeated the failing `typeof(at)` query before quoting the identifier; service-day SQL also failed on alias `day`.
- Mistake: SVG generation attempted unavailable `html.escape`, then recovered with a local escaping function.
- Mistake: The first-boarding policy retained `Rca4e4824` before joining `R93fefd15`, producing three legs where tools mode achieved the same arrival with two. Fewest vehicles was not the objective.

### arrive_by

**Tool calling: passed.** Passed with latest departure `63360` and arrival `64440`, using `R1aabe4da+29` and `Rfd6f9e2d+67` before the `64800` deadline. ($0.13, 29 requests, 79 s)
- Right: Computed origin departure as boarding time minus initial walking and destination arrival including final walking.
- Right: Searched additional transfer layers for departures later than `63360`, rather than accepting the first two-vehicle result.
- Right: Returned the four platform identifiers and corresponding SVG legs.
- Mistake: In the interpolation query, `at IS NOT NULL` caused a parser error twice; changing window functions did not fix the identifier problem. Quoting `c."at"` and aliasing it `tm` did.
- Mistake: Repeated several inspections because batched `run_sql` statements returned only the final result set.

**Code mode: passed.** Passed with the same two-leg journey as tools mode: departure `63360`, arrival `64440`. ($0.15, 30 requests, 81 s)
- Right: Used `run_code` to call `run_sql` for interpolation, repeats, origin walks, and destination walks.
- Right: Verified the `64`-second transfer and searched backward through additional ride layers for later feasible departures.
- Right: Generated and checked the SVG file.
- Mistake: Interpolation failed on unquoted `at`.
- Mistake: Creating `starts` referenced nonexistent `o.ref`; `ow` exposed `origin`, so the replacement used `o.origin`.
- Mistake: Many Python calls simply wrapped one SQL call, retaining much of the normal tool-mode interaction overhead.

### departure_profile

**Tool calling: passed.** Passed with 12 nondominated journeys, from departure/arrival `25327/27420` through `28620/30780`. ($0.16, 30 requests, 1.6 min)
- Right: Used `departure = b.dep - ow.sec` and checked dominance against departures beyond the requested interval.
- Right: Detected `23964` missing interpolated times among `79285` calls and repaired the interpolation before routing.
- Right: Compared two- and three-vehicle candidates and drew the returned journeys.
- Mistake: During inspection, retried `min(at)` after quoting `count`, leaving the actual parser error unresolved until the next correction.
- Mistake: The first interpolation used `last_value(n ignore nulls)` and `first_value(n ignore nulls)` instead of the nullable timed-stop marker `tn`; this selected untimed calls as anchors.
- Mistake: The search stopped at three vehicles without establishing a general bound; the supplied result nevertheless passed.

**Code mode: passed.** Passed with 12 journeys and the same departure/arrival frontier as tools mode, with some different transfer platforms. ($0.24, 27 requests, 1.6 min)
- Right: Built SQL reachability tables and used Python to assemble structured journeys and the SVG.
- Right: Extended the initial search to three vehicles, improving 34 departure candidates.
- Right: Checked later departures using `late0`, `lateboards`, and `latedest`; the final dominance filter reduced the frontier to 12 journeys.
- Mistake: Base-table creation failed on the alias `at`, then succeeded using `arr0`.
- Mistake: SVG generation attempted unavailable `html.escape` and required a replacement.
- Mistake: The search used fixed time and vehicle bounds rather than demonstrating unrestricted convergence; the returned frontier nevertheless passed.

### meeting_point

**Tool calling: passed.** Passed with meeting station `Sbb9212fa` at `33701`; the friends arrived at `33701` and `33692` on one vehicle each. ($0.12, 23 requests, 71 s)
- Right: Minimized `greatest(a.arr,b.arr)` across stations.
- Right: Found the initial walk to `P3035f403` and journeys on `Rc0124950` and `Rfa439a34`.
- Right: Checked a third vehicle layer and verified the selected boarding/alighting calls.
- Mistake: Interpolation failed on unquoted `at`; a subsequent `SELECT count(*) FROM geo` also failed because the unsuccessful batch had not created `geo`.
- Mistake: Walk-table creation failed on the alias `seconds`; renaming it `duration` fixed the query.
- Mistake: The initial state already included a walk, but first boarding joined `walk` again, allowing two starting walks in the search. The selected journey used only one.

**Code mode: passed.** Passed with Albertplatz (`Sbb9212fa`) at `33701` and the same two individual journeys as tools mode. ($0.12, 22 requests, 74 s)
- Right: Used `greatest(first_time, second_time)` after correcting the meeting-time expression.
- Right: Verified the first friend's `353`-second initial walk and both selected vehicle calls.
- Right: Automated additional reachability layers in Python.
- Mistake: An inspection query failed on unquoted `at`.
- Mistake: The first meeting query used `max(a.early,b.early)`, which DuckDB interpreted as an aggregate and rejected; it should use `greatest`.
- Mistake: The loop continued creating depths `6` and `7` after depth `5` was already empty.

### timed_tour

**Tool calling: passed.** Passed with seven vehicle legs, four visits, and return at `44160`; adding transfers improved the initial direct-only result of `49080`. ($0.25, 36 requests, 2.3 min)
- Right: Represented visits with bit masks and enforced `greatest(arrival, open) + 900 + walk` before the next vehicle.
- Right: Expanded the search beyond direct rides and found the required visit order and opening-window-compatible stays.
- Right: Checked the final return from Mickten, including possible final walks.
- Mistake: Initial loading failed twice on `at` and the alias `days`.
- Mistake: The `onechange` query constrained coordinate differences individually to `400` but omitted the Euclidean `distance <= 400` test, potentially admitting diagonal walks longer than allowed; the selected itinerary passed.
- Mistake: Restricted inter-visit searches to direct or one-change journeys and imposed a `2400`-second transfer-wait cap without proving these bounds preserved every optimum.

**Code mode: passed.** Passed with five vehicles, four visits, and return `44160`, using two fewer vehicles than tools mode. ($0.24, 29 requests, 2.1 min)
- Right: Implemented a Python event scan with visit masks, opening windows, and `max(arrival, opens) + 900`.
- Right: Inspected the reconstructed walks and corrected visit arrivals/departures to use the actual alighting platforms.
- Right: For Technische Universität, replaced the indirect `30 + 51` walk construction with the direct `68`-second walk, producing visit times `37080–38244`.
- Mistake: Loading failed three times on `at`, its alias, and `days`; SVG generation also failed on unavailable `html`, and a validation expression had mismatched parentheses.
- Mistake: After building SQL tables, reloaded timetable files directly with `csv.DictReader`, duplicating preparation and departing from the handbook's instruction to load through `run_sql`.
- Mistake: The search allowed a walk into a visit followed by another walk out. It repaired the selected itinerary afterward rather than enforcing the one-walk rule throughout search.

### tour

**Tool calling: failed.** Failed after submitting ten legs, five visits, and return time `50012`. The search contains a concrete walking-rule violation, although no grader explanation or expected answer was supplied. ($0.22, 33 requests, 2.1 min)
- Right: Built a bit-mask dynamic program over visited stations and platform arrival times.
- Right: Expanded repeats, interpolated calls, reconstructed all ten legs, and produced the SVG.
- Mistake: In `CREATE MACRO advance(level)`, `endings` allowed a walk into a visit, then the next `first` allowed another walk out without tracking whether the single permitted inter-vehicle walk was already used.
- Mistake: The submitted Marienberger visit illustrates this: alight `P61c124e5` at `39000`, walk to the visit for arrival `39343`, then set off at `40249` and walk again to board `Pff6d4e56` at `40560`. It should preserve walking state across visits and reject two-walk transfers.
- Mistake: The search allowed only three vehicles between visits without proving that limit sufficient.
- Mistake: Four SQL errors occurred during inspection and construction, including repeated `min(at)`, invalid `FILTER` placement, and aliasing a column `at`.

**Code mode: failed.** Failed after submitting ten legs, five visits, and return `50012`. The conversation does not expose the grader's rejection reason, so the exact final-answer defect cannot be established. ($0.15, 17 requests, 85 s)
- Right: Implemented a Python event scan with visited-station masks and reconstructed a complete itinerary and SVG.
- Right: Added `(mask, lock)` states and `(lock and dist != 0)` to prevent a second walk after walking into a visit.
- Right: Recovered from a strict-bound search returning `(50012, None, 0)` by raising the incumbent bound to `50013`, allowing reconstruction of the equal-time route.
- Mistake: In `active()`, `S[s]` raised `KeyError: V3db19490` because exception-only services were absent from `services.txt`. Filtering out missing services avoided the crash but should instead preserve service-change semantics.
- Mistake: After initial SQL loading, reloaded all files directly with `csv.DictReader`, contrary to the requested loading method.
- Mistake: Submitted the reconstructed `50012` tour without an independent end-to-end route/visit validation. Unlike tools mode, its walk lock rules out attributing this failure to the same two-walk bug; the supplied `error: null` and absent expected answer leave the precise cause unresolved.
