---
title: "GPT-6.1 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.1-sol/transit_planner/
---

# GPT-6.1 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.1-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.1-sol.md

| Mode         | Score | Tasks passed | Cost  | Requests | Tool calls | Time     |
| ------------ | ----- | ------------ | ----- | -------- | ---------- | -------- |
| Tool calling | 90%   | 9 of 10      | $0.84 | 180      | 180        | 17.1 min |
| Code mode    | 90%   | 9 of 10      | $0.76 | 157      | 157        | 16.8 min |

Each task was run once per mode.

## Review

Written by an LLM from the runs' transcripts.

#### Overall

`gpt-6.1-sol` passed 18 of 20 runs: 9 of 10 in each mode. The only failing case is `tour` (five stations, 15-minute stays), which failed in both modes. No provider errors. Total cost was $0.84 for tools (180 requests) and $0.76 for code mode (157 requests).

#### Where it does well

- **Timetable construction.** Every run got untimed-call interpolation, `+k` repeat naming, the service-day bitmask and the 400 m walk table right, usually in one large DuckDB statement.
- **Rule handling.** The 120 s plus walk transfer margin, the no-margin first vehicle and Y-only access were applied correctly throughout. Runs that needed the previous service day (`after_midnight`) included it with a -86400 shift.
- **Proving the answer.** On the point-to-point cases it kept relaxing until a round gave 0 improvements, or bounded further rounds by the incumbent arrival, before answering.
- **Harder shapes.** The Pareto profile (`departure_profile`, 12 journeys), the backward search (`arrive_by`), `meeting_point` and the time-windowed `timed_tour` all passed in both modes.

#### Mistakes it makes

- **`tour` fails twice.** Code mode returned 50012 while tools mode reached 48660 for the same question, so the Python connection scan is not optimal; it checked feasibility only. The tools answer shows no visible defect. Its failure is unexplained: either a non-optimal return, or the SVG, which was rounded to 2 decimals where every passing run kept 3 or more.
- **Unquoted `at`.** All 20 runs hit `syntax error at or near "IS"` (or similar) at least once before quoting the column. Four code-mode retries then failed again with a missing-table error.
- **Wasted requests.** Multi-statement `run_sql` returns only the last result; the model kept batching `SELECT`s and re-running them singly, about 2 to 6 requests per tools run.
- **Unchecked horizons.** Time windows such as `arr<=36000` were chosen before any result existed. None caused a failure.
- **`departure` field.** It sometimes reports the start time, not the set-off time (27600 vs 27669 on `one_change`); the grader accepted both.

#### Tool calling compared with code mode

Pass rates are identical. Code mode was about 10% cheaper and used fewer requests where it put the loop in Python (`arrive_by` 11 vs 18, `saturday_direct` 10 vs 14). It often did not: `meeting_point`, `timed_tour` and `walking_change` used the same request count in both modes. Code mode added its own errors: three `"""` strings closed with `""`, one 100-nested-call limit hit and one truncated `list()` fetch. On `tour` the Python search gave a worse answer than the SQL relaxation. The SQL approach in tools mode was the more reliable; code mode's gain is modest.

## Runs

### one_vehicle

**Tool calling: passed.** Limited the work to runs touching platforms within 400 m of both stations, interpolated only those, and returned bus `R27f8d4b1+2` boarded at Strehlener Platz after a 399 s walk, arriving 30480. Passed in 11 requests. ($0.054, 11 requests, 58 s)
- Right: Narrowed to `candidate_runs` before interpolating, the cheapest approach in the set
- Right: Noticed the best single vehicle needs a 399 m start walk to `P0091960a`, just inside the 400 m limit
- Right: Included the previous service day and service changes
- Mistake: Timetable query failed on unquoted `at`, followed by a `SHOW TABLES` request to see what had been created
- Mistake: Two lookup queries repeated because of multi-statement batches

**Code mode: passed.** Restricted to 72 candidate runs, built a `service_days` table for every date in the period and returned `R27f8d4b1+2` boarded at Strehlener Platz, arriving 30480. Passed in 10 requests. ($0.064, 10 requests, 69 s)
- Right: Found the 399 m start walk to `P0091960a`
- Right: Candidate-run filter kept the interpolation small
- Mistake: Timetable query failed on unquoted `at`, then the retry failed with `Table with name distcalls does not exist` because the failed batch had rolled it back; two requests lost
- Mistake: `service_days` spans all 22 dates with `datediff` offsets where two days would do
- Mistake: Reports `departure` 29400 although its own query computed `latest_departure` 29541; accepted by the grader

### saturday_direct

**Tool calling: passed.** Found direct tram `Rb28d92d7` arriving 34560, then ran two transfer rounds bounded by `e.dep<34560` to confirm nothing beats it. Passed. ($0.064, 14 requests, 77 s)
- Right: Checked that journeys with changes could not arrive before the direct one (0 improvements, no earlier destination arrival)
- Right: Used the correct Saturday bit (32) and loaded the previous day too
- Mistake: Timetable query failed on unquoted `at`
- Mistake: About three requests re-ran statements hidden by multi-statement batches
- Mistake: One query dumped 73 irrelevant candidate rows into the context

**Code mode: passed.** Found direct tram `Rb28d92d7` arriving 34560, then a Python loop built `ride2` to `ride8` bounded by 34560 and showed no earlier arrival. Passed in 10 requests. ($0.057, 10 requests, 71 s)
- Right: One loop checked up to 8 vehicles in a single request (`reached` fell 112, 33, 5, 0)
- Right: Loaded both service days and service changes
- Mistake: Timetable query failed on unquoted `at`; the retry also had to rename a column called `offset`
- Mistake: Each round expands only from the previous round's table, not a cumulative best; fine for a bounded proof but not a general search

### one_change

**Tool calling: passed.** Enumerated first legs, then second legs through a `transfers` table, and returned `Rafeef850` then `R620ec7d9` arriving 28440. Passed in 12 requests. ($0.063, 12 requests, 71 s)
- Right: Compared direct journeys (best 29160) with two-vehicle ones (28440) and took the better
- Right: Included a 72 s walk between Straßburger Platz platforms plus the 120 s margin
- Mistake: First timetable query failed on unquoted `at`
- Mistake: The first second-leg query returned previous-day runs with arrivals of -72780 because `ec` was not time-filtered; fixed with `DELETE FROM ec WHERE arr<27600`
- Mistake: Second legs capped at `b.dep<30000`, an arbitrary bound that happened to be wide enough
- Mistake: Reports `departure` 27600 (the start time) where code mode reports 27669; both were accepted

**Code mode: passed.** Two SQL joins (first legs, then second legs filtered to `u.arr+e.secs<=29160`) gave `Rafeef850` then `R620ec7d9` arriving 28440. Passed in 9 requests, the cheapest run at $0.0423. ($0.042, 9 requests, 49 s)
- Right: Used the best direct arrival (29160) as the bound for the two-vehicle search
- Right: Quoted `at` correctly in the main timetable query after the probe failed
- Mistake: Probe `SELECT min(at),max(at)` failed on unquoted `at`
- Mistake: Loaded only service day 2026-337, not the previous day; harmless at 07:40
- Mistake: Legs were typed into the Python snippet by hand, not taken from the query result

### walking_change

**Tool calling: passed.** Built reach tables `l1`, `l2`, `l3` then a cumulative `best`/`cand` loop, and returned bus `R76d2117b+4` to Pirnaischer Platz, a 78 s walk, then tram `R3a0dccd4+54` arriving 63480. Passed. ($0.074, 18 requests, 86 s)
- Right: Found that no single vehicle reaches the destination and that the change needs a walk between platforms
- Right: Bounded later rounds by the incumbent (`b.dep<63480`, `a.arr<=63480`) and stopped at 0 improvements
- Mistake: Timetable query failed on unquoted `at` (reported as a syntax error near `,`)
- Mistake: `active` ignores `service_changes` and the previous day; harmless at 17:05
- Mistake: About five requests repeated lookups because of multi-statement batches

**Code mode: passed.** Round-based reach tables in SQL driven from Python; returned bus `R76d2117b+4` to Prager Straße, a 341 s walk to Altmarkt, then tram `R3a0dccd4+54` arriving 63480. Passed with a different change point from tools mode. ($0.067, 18 requests, 1.5 min)
- Right: Same arrival (63480) as tools mode by another route, which supports the result
- Right: Pruned with `DELETE FROM ec WHERE arr>63480 OR dep>63480` and ran rounds until 0 improvements
- Mistake: Probe failed on unquoted `at`; another snippet had a `"""` string closed with `""`
- Mistake: `reach` is replaced by each round's `nex` instead of merged, so round 3 gave a worse arrival (63780) and convergence needed a side query against `hist`
- Mistake: Loaded three service days including the following day (`'2026-339',32,86400`), which cannot matter
- Mistake: 18 requests, no saving over tools mode

### after_midnight

**Tool calling: passed.** Built the timetable in DuckDB with both service days (`('2026-338',16,-86400),('2026-339',32,0)`), expanded reach round by round (`reach` to `reach5`) and returned the two-bus journey arriving 6420. Passed. ($0.071, 16 requests, 81 s)
- Right: Included the previous service day shifted by -86400, which is where both runs (`R93fefd15`, `R900bf42f+2`) come from
- Right: Applied the transfer rule as `b.dep>=reach.time+120+w.dur` and found the 76 s walk between the two Südhöhe platforms
- Right: Kept expanding until a round gave 0 improvements before answering
- Mistake: First timetable query failed on the unquoted reserved column `at` (`CASE WHEN at IS NOT NULL`); one request lost
- Mistake: Multi-statement `run_sql` calls return only the last result, so three lookups were re-run singly (requests 8-10)
- Mistake: Round 4 reported `improvements` = 1 and the destination arrival was not re-queried for that round; the `a.arr<=6420` bound meant it could only tie, so the answer held

**Code mode: passed.** Built the two-day timetable in SQL, pulled 7870 calls into Python with 40 parallel `run_sql` pages and ran a Dijkstra-style search, returning the same journey arriving 6420. Passed in 13 requests. ($0.067, 13 requests, 86 s)
- Right: Included the previous service day (`'2026-338',16,-86400`) and confirmed with a query that both runs belong to day 2026-338
- Right: Search stops when the next label time is at or past `best`, so the result is a true earliest arrival within the loaded window
- Mistake: One snippet had a Python syntax error: a `"""` string closed with `""`
- Mistake: Timetable query failed on unquoted `at`; the patched retry then failed with `Table with name cdist does not exist` because it had cut that statement out. Three requests lost in a row
- Mistake: Paged data out in 200-row chunks to work around result limits, where SQL alone would have done

### arrive_by

**Tool calling: passed.** Searched backwards from the 18:00 deadline with a `best` table of latest boarding times per platform, iterated until `improvements` = 0, and returned departure 63360, arrival 64500. Passed. ($0.072, 18 requests, 87 s)
- Right: Backward latest-departure search with the transfer test `r.alight_time+120+w.d<=b.t`
- Right: Included `+`/`-` service changes in `active`
- Right: Ran the relaxation to a fixed point (147, 11, then 0 improvements)
- Mistake: `SELECT count(*) FROM calls WHERE at IS NULL` failed on unquoted `at`
- Mistake: Four follow-up queries (requests 13-16) repeated the same leg query because only the last statement of each batch is returned
- Mistake: Did not load the previous service day; harmless at 16:30-18:00

**Code mode: passed.** Backward label search in SQL driven by a Python `for i in range(10)` loop that stopped at 0 improvements after 5 rounds; returned departure 63360, arrival 64500. Passed in 11 requests against 18 in tools mode. ($0.051, 11 requests, 68 s)
- Right: Put the fixed-point loop in one `run_code` call instead of one request per round
- Right: Included the previous service day and service changes
- Right: Initial labels `max(64800-w.secs)` handle the final walk to the destination station
- Mistake: Probe `SELECT max(at) FROM calls` failed on unquoted `at`
- Mistake: Departure is derived as `latest+120`, undoing a margin the first vehicle does not need; correct here but fragile

### departure_profile

**Tool calling: passed.** Computed a Pareto profile of (start, arrival) labels per platform over 7 relaxation rounds in SQL and returned 12 non-dominated journeys from 25327 to 28620. Passed. ($0.12, 21 requests, 2.5 min)
- Right: Departure defined as `t.dep-w.dur` and filtered to `>=25200`, matching the question's set-off rule
- Right: Pareto pruning with `start>coalesce(max(start) OVER (PARTITION BY place ORDER BY arr ...))`, then a final dominance pass at the destination
- Right: Stopped when the label count stayed at 39288
- Mistake: Re-read `/data/DATA.md` from line 120 right after reading it in full
- Mistake: First timetable query failed on unquoted `at`
- Mistake: `active` ignores `service_changes` and the previous service day; harmless for a 07:00 Tuesday query
- Mistake: Calls limited to `arr<=43200`, an assumed horizon that was not checked

**Code mode: passed.** Same Pareto profile as tools mode, with the relaxation step held in a Python string and re-sent until `changes` = 0; returned the same 12 departure and arrival pairs. Passed. ($0.099, 19 requests, 2.7 min)
- Right: Loaded both service days (`'2026-341'` and `'2026-342'`) and service changes
- Right: Convergence tested explicitly with an `EXCEPT` of new against old labels
- Right: Extracted legs with `unnest(legs).run` to avoid the 200-character cell truncation
- Mistake: Timetable query failed on unquoted `at`
- Mistake: Each relaxation round was still a separate request (7 of them) although a loop was available, as used in `arrive_by`
- Mistake: Calls limited to `BETWEEN 25200 AND 43200` on arrival time, an assumed horizon

### meeting_point

**Tool calling: passed.** Ran an earliest-arrival search from both origins at once (column `f`), joined the two per-station results on `greatest(a.t,b.t)` and returned Albertplatz at 33701. Passed. ($0.082, 20 requests, 1.6 min)
- Right: One label table for both friends, with starting platforms kept so a friend can stay put
- Right: Re-ran `stepq()` until `improvements` = 0 before trusting the ranking
- Right: Found the 353 s start walk from `P6239000d` to Angelikastraße for the first friend
- Mistake: First timetable query failed on unquoted `at`
- Mistake: Timetable cut to `arr<=36000`; enough here because the answer is 33701, but chosen before any result was known
- Mistake: About six requests were spent re-running statements whose results were swallowed by multi-statement batches
- Mistake: Reports `departure` 32400 for the first friend although the bus leaves at 33180 after a 353 s walk; the grader accepted it

**Code mode: passed.** Per-friend label relaxation in SQL (`ready`, `boards`, `labels`, `stationbest`) re-run until `sum(tm)` stopped changing; returned Albertplatz at 33701 with the same two legs as tools mode. Passed. ($0.077, 20 requests, 1.6 min)
- Right: Loaded both service days and service changes
- Right: Watched `count(*)` and `sum(tm)` of `labels` to detect the fixed point
- Right: Looked up the 353 s start walk and drew it
- Mistake: Timetable query failed on unquoted `at`, and the patched retry failed with `Table with name cum does not exist`; two requests lost
- Mistake: Seven separate requests re-ran the same `step` string where one loop would do, so code mode saved nothing (20 requests in both modes)
- Mistake: Reports `departure` 32400 for both friends, the start time, not the set-off time

### timed_tour

**Tool calling: passed.** Ran a bitmask label search in SQL (`mask`, `place`, `t`) with opening hours as `greatest(rb.arr+w.w,tg.op)+900<=tg.cl`, iterated until the frontier was empty and returned the 5-leg tour back at 44160. Passed. ($0.11, 23 requests, 2.4 min)
- Right: Encoded the three time windows directly in the visit transition
- Right: Ran to convergence (`frontier` count 0) and re-checked that the best return was still 44160
- Right: Recomputed each visit departure as next boarding time minus the direct walk (for example 35640 - 147 = 35493) instead of using the internal `ready` values
- Mistake: Timetable query failed on unquoted `at`
- Mistake: Built a 1,055,354-row `ride` table of every board/alight pair; it worked but is heavy
- Mistake: Several requests repeated queries because only the last statement's result comes back

**Code mode: passed.** Pulled 64,406 connections into Python in 200-row pages and ran a connection scan with 16 visit masks and opening-hour checks, returning the same tour as tools mode back at 44160. Passed after several avoidable errors. ($0.12, 23 requests, 2.4 min)
- Right: `relax()` handles both alighting at a target and walking into one, with `end=max(a,op)+900` checked against the closing time
- Right: Recomputed visit departures from the next boarding time minus the walk, giving the same four values as tools mode
- Right: Stops scanning once `d>best[0]`
- Mistake: Python syntax error from a `"""` string closed with `""`, then the unquoted `at` error
- Mistake: Tried to fetch everything with `list(struct_pack(...))` and got back a 226-character truncated string
- Mistake: A paging snippet asked for more than 100 nested tool calls and was stopped (`Code mode allows 100 nested tool calls`), after 93 had already run
- Mistake: Sent a meaningless probe, `from xml import nothing`, costing a request
- Mistake: Connections are sorted only by `dep,arr`, so same-time hops of one run can be scanned out of order; it did not bite here

### tour

**Tool calling: failed.** Ran a bitmask label search over 12 hand-repeated SQL rounds until `updates` = 0 and returned a 10-leg tour back at 48660; the grader failed it with no error text. ($0.14, 27 requests, 2.9 min)
- Right: Search ran to a fixed point (best return went 51283, 50460, 49380, 48660, then stayed)
- Right: The visit departures were recomputed from direct walks (for example Wasaplatz 48240 - 327 = 47913) and every stay is at least 900 s
- Right: Transfers in the returned legs satisfy the 120 s plus walk rule on the numbers shown
- Mistake: No defect is visible in the conversation: the itinerary is consistent with the rules, so the failure is most likely a non-optimal return time or the drawing, and neither can be confirmed
- Mistake: The SVG coordinates came from `round(p.east/35.0,2)`, two decimals, where every passing tools run used three or more; if the drawing check is tight this alone could fail it. It should have kept full precision
- Mistake: It trusted one search with no independent check of the 48660 result, and calls were pre-filtered to `arr BETWEEN 36000 AND 57600` before the search
- Mistake: 27 requests, the most in the set: the same `ride`/`improve` batch was pasted 10 times, and an early probe failed on unquoted `at`

**Code mode: failed.** Ran a Python connection scan over 72,272 connections with 5-bit visit masks and returned a 10-leg tour back at 50012; failed. Tools mode found a return at 48660 for the same question, 1352 s earlier. ($0.12, 24 requests, 2.8 min)
- Right: Wrote a feasibility check of each transfer (walk against gap) and each stay (900 to 1157 s) before answering
- Right: Checked that previous-day services end by 18480 and so cannot matter
- Right: Packed runs into strings split across `substr` columns to get past the 200-character cell limit
- Mistake: The search is not optimal: 50012 against the 48660 tools mode reached. Likely culprits in `scan_batch` are `con.sort()` ordering same-time hops of a run by platform index, and one label per `(platform, mask)` that also carries the pending visit; neither was tested
- Mistake: Its check covered feasibility only. A second method, such as the SQL relaxation used elsewhere, would have exposed the gap
- Mistake: Accepted a visit reached on foot (Marienberger Straße arrival 39343 = 39000 + 343 s walk from Rennplatzstraße), a looser reading than tools mode needed
- Mistake: Lost requests to the unquoted `at` error and to `next()` called on a list (`'list' object is not an iterator`)
