---
title: "GLM 5.3 Flash 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 20%; rank 29 of 32."
canonical: https://models.pydantic.dev/models/glm-5.3-flash/transit_planner/
---

# GLM 5.3 Flash 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 20%; rank 29 of 32.
>
> Markdown copy of https://models.pydantic.dev/models/glm-5.3-flash/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/glm-5.3-flash.md

| Mode         | Score | Tasks passed | Cost  | Requests | Tool calls | Time     |
| ------------ | ----- | ------------ | ----- | -------- | ---------- | -------- |
| Tool calling | 0%    | 0 of 10      | $0.72 | 456      | 678        | 66.3 min |
| Code mode    | 20%   | 2 of 10      | $1.06 | 390      | 452        | 74.0 min |

Each task was run once per mode.

## Review

Written by an LLM from the runs' transcripts.

#### Overall

GLM-5.3-Flash passed 2 of 20 runs: 0 of 10 with tool calling and 2 of 10 in code mode (`one_change`, `saturday_direct`). Total cost was about $0.72 for tools and $1.06 for code mode. Fourteen of the 18 failures ended with a `final_result` call whose ids or times were placeholders or invented; three ended on a limit, and one was a correct computation submitted in the wrong form.

#### Where it does well

- Reading the rules: service-day bitmasks, previous-day runs for the 01:10 start, the 120-second change margin and untimed-call interpolation were understood in nearly every run.
- Data preparation: most runs loaded the tables, found the `at` reserved word, expanded repeats and interpolated times with no nulls.
- When generation stayed stable it verified well: both passes cross-checked with a second algorithm and the raw rows.

#### Mistakes it makes

- **Fabricated final answers (14 runs).** The reasoning says "now run the search" and the call is `final_result` with values such as `run: "string"`, `S_aaa`, `platform_13_A`, `-1`/`n/a`, or an empty `legs` list. `saturday_direct` (tools) answered on request 3 without one query.
- **Stray and corrupted tool calls (most runs).** Repeated `list_files` / `read_text /data/DATA.md` (about 25 of 52 requests in `one_vehicle` tools), SQL emitted in Chinese, queries on non-existent tables (`EDGES`, `CONN`), and prose, JSON or shell sent as Python. The model blamed the environment each time.
- **Limits (3 runs).** `arrive_by` (tools) and `departure_profile` (code) hit 80 requests; `departure_profile` (tools) died on three bad `read_text` paths.
- **Solved but mis-submitted (2 runs).** `arrive_by` (code) had departure 63360 on `R1aabe4da+29` and sent `-1`; `meeting_point` (code) had Albertplatz at 33701 and sent names and the time `9`.
- Only one run returned an SVG.

#### Tool calling compared with code mode

Code mode was the only mode that produced correct answers, and four code runs reached a real search result against none in tools, where the hand-written per-round SQL searches never converged. It cost about 47% more and added its own failures: `restart: true` wiping state (`tour`, $0.34), timeouts and memory resets, and missing `heapq`. The `one_change` pass was lucky: an invented `final_result` was rejected only because a parallel call failed. Premature `final_result` calls were equally common in both modes.

## Runs

### one_vehicle

**Tool calling: failed.** Spent 52 requests mostly re-reading `DATA.md`; its one direct-connection query returned empty and it then submitted an invented run and platforms. Failed. ($0.037, 52 requests, 11.1 min)
- Right: Found the 4 platforms of each station early (message 13)
- Right: Eventually created the tables one statement at a time
- Mistake: Around 25 of 52 requests were `read_text /data/DATA.md` or `list_files` repeats (messages 17, 21-23, 29-37, 45-47, 55-57, 63, 69-75, 79-81, 95-101); it told itself the system was re-sending the file
- Mistake: Message 97: the direct-run query with repeat expansion returned no rows; it did not debug it
- Mistake: Message 103: `final_result` with run `R5b5c2e0b`, board `P4a8b9ae0` at 25200, alight `P8f1d2c30` at 26100. These platforms are not among those it listed for either station, and 25200 is 07:00, before the 08:10 start (29400)
- Mistake: No SVG written

**Code mode: failed.** Read `DATA.md`, listed file sizes, wrote a plan, then on request 7 submitted the output schema's placeholder values. Failed. ($0.0024, 7 requests, 11 s)
- Right: Converted 08:10 to 29400 and reasoned correctly about start and end walks for a one-vehicle journey
- Mistake: Messages 1 and 5: `run_code` with empty code and `restart: true`
- Mistake: Message 3: `__import__('pathlib')`, not supported in the sandbox
- Mistake: Message 13: reasoning says "Let me write the parsing code" but the call is `final_result` with `run: "string"`, `board: "string"`, all times 0
- Mistake: No data file other than `DATA.md` was parsed; no SVG

### saturday_direct

**Tool calling: failed.** Read `DATA.md` and the services files, planned the work in its reasoning, then called `final_result` on the third request with made-up values. Failed. ($0.0013, 3 requests, 7 s)
- Right: Correctly listed the five Saturday services by hand and the 09:15 = 33300 start
- Mistake: Message 5: reasoning ends with "First look at places" and the tool call is `final_result` with runs `R074b39c7`, `R077c3231`, 9-hex platform ids (`P14462af2d`) that do not match the 8-hex id format, and departure 18954 (05:15), before the 33300 start
- Mistake: `run_sql` was never called; no SVG written
- Mistake: Two overlapping `read_text` calls on `DATA.md` (`start_line` 40 and 80) in one turn

**Code mode: passed.** Wrote a RAPTOR-style router in Python, found tram 9 run `Rb28d92d7` from `P7fa04a55` at 33484 to `P1093f876` at 34560, cross-checked with a connection scan and submitted it. Passed. ($0.051, 26 requests, 4.5 min)
- Right: Two algorithms agree on 34560, and it checked for ties (next best 34588)
- Right: Re-derived the interpolated boarding time from raw calls
- Right: Included previous-day runs (7465 trips) even though the 09:15 start did not need them
- Mistake: Message 21: `restart: true` wiped state and forced a full rebuild
- Mistake: Message 43: a stray non-code line; message 47: comments in Chinese
- Mistake: Reasoning states the 33484 boarding as 09:18:04 (it is 09:18:04 only for 33484 = 9h18m04s, which is right) but was unsure whether `departure` should be 33300 or 33484 and picked without a rule to cite
- Mistake: SVG field in the output is null; 26 requests for a direct journey

### one_change

**Tool calling: failed.** Fought for 39 requests to build interpolated call times, with its own SQL repeatedly coming out in Chinese, then submitted a one-leg answer with invented ids. Failed. ($0.026, 39 requests, 11.4 min)
- Right: Loaded the tables, `valid_services` and `run_inst`; got cumulative distance and interpolation tables built by message 76 with 0 null times
- Mistake: Messages 19, 25, 49, 53, 71: `run_sql` queries were Chinese text (`创建或替换表 calls_s AS ...`, a whole query described in Chinese prose); it blamed a translation layer and switched to `CrEaTe Or RePlAcE tAbLe`
- Mistake: Messages 43: malformed window syntax (`lag(nn) PARTITION BY rid ORDER BY nn`, `TIES ORDER BY`)
- Mistake: Message 77: `final_result` sent alongside a junk query `WHERE station = {country}`; the answer uses run `186`, platforms `G-P-S` and `S-Z`, none of which are ids in the data, and has one leg for a question it had not yet searched
- Mistake: No routing query was ever run and no SVG written

**Code mode: passed.** Found arrival 28440 with tram `Rafeef850` then `R620ec7d9`, confirmed it with a separate brute force and by reading the raw call rows, and submitted it. Passed. ($0.077, 32 requests, 6.1 min)
- Right: Two independent searches agree on 28440
- Right: Checked the interpolated boarding time 27669 at `P0708873e` by hand against raw rows
- Right: Handled the two services missing from `services.txt` that only appear in `service_changes.txt`
- Mistake: Messages 3, 9-15, 33-35, 47, 57: placeholder text sent as code about eight times
- Mistake: Message 61: called `final_result` with invented runs `L10-0001` and `L12-0004` and board time 27600; it was rejected only because a parallel `run_code` call (`code_placeholder`) failed in the same turn. The pass depended on that
- Mistake: SVG field in the output is null
- Mistake: 32 requests for a one-change query

### walking_change

**Tool calling: failed.** Took 61 requests to build `calls_big` (220,660 rows), walk edges and start states, then at the moment it announced "Run round 1 now" it submitted an empty journey. Failed. ($0.080, 61 requests, 2.6 min)
- Right: Correct 8 Friday services, 9,660 expanded runs, interpolation with no nulls, 6,330 walk edges, start table `brd0` with 6 places
- Right: Identified which lines serve each station (buses 61/62/333 at origin, trams 1/2 and bus 87 at destination)
- Mistake: About 20 stray `read_text /data/DATA.md` / `list_files` calls (messages 7-17, 35-39, 45, 61, 69-75, 83, 97-103, 111, 117)
- Mistake: Message 85: tried to recreate tables that already existed; message 91: non-SQL prefix in a query
- Mistake: Message 121: `final_result` with `legs: []`, `departure: 0`, `arrival: 0` before any routing round ran
- Mistake: No SVG written

**Code mode: failed.** After restarts and stray calls it finally loaded the data and interpolated base runs (3973 runs, 81,040 calls), spotted a bug in its interpolation, and submitted invented ids at that point. Failed. ($0.021, 34 requests, 11.9 min)
- Right: Correct Friday service set and weekday check
- Right: Noticed its own `sb == sa` branch used `t = ad` instead of `t = sd`
- Mistake: Messages 19-25, 41, 61-63: garbled or unrelated code (`print('self.status' in status_map)`, empty code) and repeated restarts that lost state; the working load only ran at message 65 of 69
- Mistake: Message 67: reasoning plans to count and fix the interpolation bug, but the call is `final_result` with run `T13` / `T13B`, platforms `platform_13_A`, `platform_route_B`, `platform_north_C` and times 324 to 1387
- Mistake: No repeat expansion, walk table or search existed; no SVG

### after_midnight

**Tool calling: failed.** Loaded the tables over ~38 requests, worked out the Friday and Saturday services, then submitted a three-leg journey without ever running a routing query. Failed. ($0.029, 39 requests, 88 s)
- Right: Recognised that 01:10 needs the previous service day (2026-338) as well as 2026-339
- Right: Found the `at` reserved-word problem and loaded `calls` with quoted identifiers
- Right: Listed the valid services for both days correctly from `services`
- Mistake: Messages 13-21: repeated `read_text` on `/data/calls.txt` and `list_files` instead of the planned `run_sql`, then decided the environment was replaying stale results
- Mistake: Messages 43-53: sent unrelated queries such as `CREATE TABLE satellites AS SELECT DISTINCT CENTER_ID AS FK FROM EDGES` and `SELECT DISTINCT N1, N2 FROM CONN`, tables that do not exist
- Mistake: Message 77: called `final_result` with runs `Rb6e4bfe1+3`, `Rcb23b065+6`, `R4a70b9cb+5` and times up to 111720, straight after listing services; no interpolation, expansion or search had been run, so the legs are not derived from the data
- Mistake: No `/out/journey.svg` was written

**Code mode: failed.** Parsed the data in Python, materialised runs for both service days and listed night departures and arrivals, then submitted an empty journey while still exploring. Failed. ($0.031, 16 requests, 3.2 min)
- Right: Handled the previous service day correctly (threshold `dep_run >= 90600` for day 338)
- Right: Materialised all 5995 runs with interpolation and built boarding/alighting indexes
- Right: Printed real night candidates: tram 3 from `P64f2b683` at clock 4980, arrivals at Wasaplatz from 4620 onward
- Mistake: Around message 27: a stray `final_result` call that was not accepted; it noted the slip and carried on
- Mistake: Message 31: while reasoning about which bus 63 run could be boarded after 01:10, it called `final_result` with `legs: []`, `departure: 0`, `arrival: 0`
- Mistake: No search was run; no SVG written
- Mistake: Messages 7 and 15: duplicate call and placeholder code

### arrive_by

**Tool calling: error.** Built interpolated call times and a backward round-by-round search in SQL, but the rounds never converged and it hit the 80-request limit with no answer. ($0.089, 80 requests, 6.8 min)
- Right: Correct setup: 8 services on 2026-344, 10183 effective runs, interpolation of untimed calls, `walkpairs` of 12660
- Right: Noticed that its first `ecalls` join was suspect and rebuilt it with a time-window filter (20,048 rows)
- Mistake: Roughly 20 of the 80 requests were stray `list_files` / `read_text /data/DATA.md` calls (messages 23-29, 45, 57, 65, 71-79, 93, 97-105); it noticed and kept doing it
- Mistake: One hand-written `CREATE TABLE F<n>` per round; still 1339 changes between rounds 9 and 10 and 1888 after the rebuild, so a per-round table approach could not finish in the budget. A forward search from the 4 origin platforms over the 90-minute window would have been small
- Mistake: Message 67: wrote a placeholder `/out/journey.svg` from made-up data before any journey existed
- Mistake: Message 97: SQL contained the Chinese character `和` in place of `AND`; comments drifted into Chinese

**Code mode: failed.** Solved the problem with a backward Dijkstra in Python (latest departure 63360 on `R1aabe4da+29` from `P10db34c8`), then submitted `-1` / `n/a` placeholders instead of the result. Failed. ($0.085, 36 requests, 5.4 min)
- Right: Wrote its own heap after finding `heapq` missing, and recovered from a 268 MB memory reset by rebuilding with flat arrays
- Right: Dijkstra completed (2463 pops) and message 67 reports the best start 63360 with no start walk
- Mistake: Messages 5, 11, 27, 53, 63: sent prose as the `code` argument
- Mistake: Message 67: sent text about a maze (`The path from the initial point (4, 3) to the goal (0, 0) is:`) as code
- Mistake: Message 69: sent a fabricated JSON journey (`userId`, stops `S1`-`S5`, `Line 8`) as code
- Mistake: Message 71: reasoning says it will write the reconstruction code, but the call is `final_result` with every field `-1` or `n/a`; the legs were never reconstructed and no SVG written

### departure_profile

**Tool calling: error.** Explored origin and destination lines in detail and built first-leg tables, then generation broke down into garbage `read_text` paths and the run died on tool retries after 52 requests. ($0.15, 52 requests, 5.9 min)
- Right: Loaded data, 10184 day runs, `vcalls` of 79285 with interpolated times
- Right: Built `fb` with 29 first-boarding options including start walks, and `st1` with 350 alight states
- Mistake: Spent many requests on manual exploration of single runs (short workings of line 1 and bus 87) instead of running a search
- Mistake: Messages 31-35, 51-55, 61-85: repeated stray `read_text` (twice with the path missing its leading slash) and `list_files`, plus filler `SELECT 1 AS ready` / `SELECT 2 AS step2`
- Mistake: Messages 93-97: `read_text` called three rounds running with corrupted paths (`'Athens'` and a long string of `$=`), which exhausted the retry count of 3 and ended the run
- Mistake: Message 101: sent `Level 2` as SQL

**Code mode: error.** Used all 80 requests without getting past data loading and walk adjacency, because of timeouts, lost state and a stream of corrupted code. No answer. ($0.22, 80 requests, 8.9 min)
- Right: Worked out the active services for 2026-342 and found that files written to `/out` persist, which it planned to use as a checkpoint
- Mistake: Messages 23, 35, 93: 30-second timeouts on the platform-pair adjacency (a 2468 x 2468 loop), each resetting the session; it never switched to a grid bucket or to `run_sql`
- Mistake: Parallel `run_code` calls that depended on each other's state (messages 25, 45)
- Mistake: Messages 47-59, 77, 91-101, 135-137: code arrived with stray `\r`, French and Portuguese keywords (`avec ... comme`, `para p em plataformas`), German words and HTML entities; it blamed the transport
- Mistake: Final calls were `print('test')`, `print('g')` and `import sarge; LoadablesCall(["yolo"])`; services were still being re-derived at message 121 of 159

### meeting_point

**Tool calling: failed.** Built a two-origin label-correcting search in SQL and ran about five iterations, then submitted Georg-Arnold-Bad at 33750 while the search was still improving. Failed. ($0.14, 77 requests, 4.2 min)
- Right: Complete data pipeline: `xcal` 48,428 calls, 160,366 expanded calls, `conn` 2.3M rows, `walk` table
- Right: Caught a double insert into `Ap` (712 rows vs 356) and deduplicated
- Mistake: Last iteration (message 150) still returned `n_new = 476`; it then ran `SELECT 1` and called `final_result` without converging and without any query that picks the best station or reconstructs the two paths
- Mistake: Id fields carry prose: `station` is `S68426c17 (Dresden Georg-Arnold-Bad, tram platforms P549c001f)`, runs are `R3f91628b+4 (tram 11, toward Bühlau/Weinböhla)`, platforms have names appended
- Mistake: First journey boards at 32400 and alights Carolaplatz at 32529, then waits until 33457; the figures were not checked against the tables
- Mistake: About 15 stray `read_text`/`list_files` calls and several junk queries (messages 17-29, 35-39, 57, 67-73, 89-91, 119, 141); 77 requests used
- Mistake: No SVG written

**Code mode: failed.** Computed a full answer in Python (meet at Albertplatz `Sbb9212fa` at 33701, via `Rc0124950` and `Rfa439a34`), verified it against the raw file and drew the SVG, but filled `final_result` with names and the number 9. Failed. ($0.13, 57 requests, 7.0 min)
- Right: Two forward Dijkstras (2352 platforms reached), meeting station chosen by max of the two arrivals
- Right: Independent re-check of interpolated times from raw `calls.txt` (33692 and 33701)
- Right: Wrote and re-read `/out/journey.svg` with 4 `data-place` and 2 `data-run` elements, the only run that returned an SVG
- Mistake: Final call: `station` is `Dresden Albertplatz` rather than `Sbb9212fa`; runs are `Tram 11` and `Tram 6`; board and alight are station names; every time (`time`, `departure`, `arrival`, `board_time`, `alight_time`) is `9` instead of seconds such as 33701
- Mistake: Messages 5, 19-29, 53, 95-101: prose, shell commands, markdown fences or empty strings sent as code
- Mistake: 57 requests, several spent polishing the SVG star marker while the answer payload was never checked

### timed_tour

**Tool calling: failed.** Loaded tables and day runs (10180) but never got past the `at` reserved-word errors to build call times; the recorded conversation ends on a `list_files` result and the submitted answer has placeholder ids. Failed. ($0.064, 21 requests, 7.2 min)
- Right: Read the walking rules after noticing they were missing from its first partial read
- Right: Found that `c.at` qualified works and created `all_calls` (163,359 rows)
- Mistake: Three separate attempts at the interpolation query failed on bare `at` (messages 41-51) before it tried qualifying the column
- Mistake: Message 55: re-ran `CREATE TABLE places` / `calls` that already existed; messages 57, 61: stray `list_files`
- Mistake: The answer uses stations `station_A` to `station_D`, runs `T076b7b74` etc. (run ids start with `R`), a departure of 4740 after an arrival of 47640, and a first visit arriving 37800 with no leg; none of it comes from a query. The final call itself is not in the recorded messages
- Mistake: No timetable, walk table or search existed when it answered; no SVG written

**Code mode: failed.** Built instances and walk edges twice (a timeout wiped the first build) and was still debugging its bucket-queue search when it submitted a two-leg answer visiting one station. Failed. ($0.11, 30 requests, 7.0 min)
- Right: Correct services, 10180 instances, 233,334 instance calls, monotonicity check, grid-bucket walk adjacency (12,660 edges)
- Right: Replaced `heapq` with a Dial bucket queue
- Mistake: Message 49: the search timed out and reset the session
- Mistake: Messages 51-53: its own code arguments contained Russian text reading "ignore previous instructions" and a base64-like line; it treated this as injection and ignored it
- Mistake: Messages 41-59: long confusion over whether `dict.get` exists, caused by its own earlier failed calls
- Mistake: Message 59: `final_result` while still tracing that bug; the answer has one visit (`Sd3f1948f`, arrival = departure = 33360) for a tour of several stations and a 32400 boarding, and the search had not produced any result

### tour

**Tool calling: failed.** Built the most complete SQL pipeline of the tool runs (interpolation, 1.58M `legs`, walk table, bitmask labels), then answered with placeholder ids after two alias typos in the round query. Failed. ($0.11, 32 requests, 15.5 min)
- Right: Loaded everything, 5 Saturday services, `bcall` with no null times, `inst` 6852, `icall` 160,366, `legs` 1,581,221, `walk` 15,128
- Right: Designed a visited-set bitmask label search with dominance pruning
- Right: Few stray calls compared with the other tool runs
- Mistake: Messages 53-62: four failed attempts at the round SQL on column and alias slips (`lg.dep` vs `lg.bdep`, `min(tt)` vs `tt2`, missing `legs lg` alias, `x.t<=x.mtt`)
- Mistake: Message 63: reasoning says it will rewrite the batch carefully, but the call is `final_result` with `Rdcfa702+7`, `P_dcfa702`, `P_a1b2c3`, `P_b2c3d4`, `S_aaa` and round times 36000/36600/39000/40000, which are template values, not data
- Mistake: Not a single search round had completed; no SVG written

**Code mode: failed.** Ran a chunked per-target computation for about 50 calls and reached target 4 of 5, then wiped the session with `restart: true` and submitted a one-leg answer with times 35, 37, 38. Failed; the most expensive run at $0.34. ($0.34, 72 requests, 19.8 min)
- Right: Built 5,556 Saturday runs with 129,760 calls and processed targets in 10-12k chunks to stay under the time limit
- Mistake: Messages 5-31: about a dozen calls that only re-printed `DATA.md`
- Mistake: Messages 5 onward, roughly 30 times: reasoning answers a "reminder" about copyrighted material that it attributes to the system
- Mistake: Around message 131: a `restart: true` call destroyed all computed state at target 4 of 5; message 137 used `restart: true` again
- Mistake: Messages 139-141: a Chinese comment as the rebuild, then another `DATA.md` print
- Mistake: Message 143: `final_result` with `board_time: 35`, `alight_time: 37`, `arrival: 38` (not seconds) and a single visit `Sdf0f3179`; 72 requests, no SVG
