---
title: "GPT-5.6 Sol on Pydantic AI - SQL data analysis"
description: "Planning journeys by querying a real Dresden public transport timetable with SQL, with an SVG map of each answer. Tool calling 80%, code mode 100%; rank 16 of 44."
canonical: https://pydantic.dev/models/list/gpt-5.6-sol/sql_data_analysis/
---

# GPT-5.6 Sol on Pydantic AI - SQL data analysis

> Planning journeys by querying a real Dresden public transport timetable with SQL, with an SVG map of each answer. Tool calling 80%, code mode 100%; rank 16 of 44.
>
> Markdown copy of https://pydantic.dev/models/list/gpt-5.6-sol/sql_data_analysis/. Index for agents: https://pydantic.dev/models/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://pydantic.dev/models/api/select` with a JSON body such as `{"description": "what the agent does"}`. It returns up to five ranked models with reasons. Format: https://pydantic.dev/models/select.md
- Search models by name: `GET https://pydantic.dev/models/api/search?query=<text>`
- List, filter and sort models: `GET https://pydantic.dev/models/api/models`, for example `?weights=open&max_price=2&sort=efficiency`
- One model in full: `GET https://pydantic.dev/models/api/models/<slug>`
- Any other question about the models: `GET https://pydantic.dev/models/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://pydantic.dev/models/mcp`. More: https://pydantic.dev/models/usage.md

About the benchmark: https://pydantic.dev/models/benchmarks/sql_data_analysis.md. The model on every Pydantic AI benchmark: https://pydantic.dev/models/list/gpt-5.6-sol/pydantic_ai.md

| Mode         | Score | Tasks passed | Cost  | Requests | Tool calls | Time     |
| ------------ | ----- | ------------ | ----- | -------- | ---------- | -------- |
| Tool calling | 80%   | 8 of 10      | $3.45 | 176      | 195        | 15.6 min |
| Code mode    | 100%  | 10 of 10     | $2.92 | 161      | 162        | 16.8 min |

Each task was run once per mode.

## Review

Written by an LLM from the runs' transcripts.

#### Overall

gpt-5.6-sol passed 18 of 20 cases. Code mode passed all 10. Tool calling passed 8 of 10 and failed `departure_profile` and `tour`. The simple query types got the same answer in both modes: direct trips, one change, a walking change, arrive-by, after midnight and meeting point. Both failures were on the harder search problems.

#### Where it does well

- **Reading the data correctly:** it reads `DATA.md`, then builds the timetable in DuckDB in a handful of large statements. Every run expanded repeats into `<run>+<k>` names, interpolated untimed calls by cumulative rounded distance, and applied the service-day rules correctly.
- **Recovering from time-outs:** when a recursive CTE hit the 30-second limit (both failed tools cases, among others), it switched to precomputed leg tables or a layer-by-layer dynamic programme instead of giving up.
- **SVG output:** every SVG had valid `data-place` and `data-run` elements at the correct coordinates. Walks were drawn as separate unlabelled lines, as required.

#### Mistakes it makes

- **Pruning against a truncated window** (`departure_profile`, tools): it built journeys only for departures from 25200 to 28800, then pruned dominated journeys within that set. The question says a journey leaving 'at any time' can dominate, so three journeys that a post-08:00 departure beats stayed in the answer (15 instead of 12).
- **Narrowing the search to save time** (`tour`, tools): each hop between targets was limited to at most 2 vehicles, boarding and alighting only at the target station's own platforms. Its reasoning noticed that 3 legs might do better, but it never checked. It returned at 50012; code mode found 48660.
- **Small inconsistencies that weren't penalised:** in `one_change` (tools) it gave departure 27600 instead of the first vehicle's 27669, and the grader accepted it.

#### Tool calling compared with code mode

Code mode was more accurate (10/10 vs 8/10), slightly cheaper ($2.92 vs $3.45 in total) and used fewer requests (161 vs 176). On the two hard cases code mode got the right answer. Tool calling took shortcuts in SQL, which went wrong on `departure_profile` (journeys pruned within a truncated window) and `tour` (each hop between targets narrowed to two vehicles and own platforms). The largest saving was `timed_tour`: $0.33 in code mode vs $0.58 with tools, for the same return time. Code mode's most expensive run was `tour` (28 requests, $0.51), but it got the better answer.

## Runs

### one_vehicle

**Tool calling: passed.** Walks from Lennéplatz to `P0091960a` and takes bus run `R27f8d4b1+2`, leaving 29400 and arriving 30480. Passed. ($0.24, 13 requests, 14 s)
- Right: Counted the start walk in the departure time (29940 − walk)
- Right: Cheapest tools run in requests (13)

**Code mode: passed.** Same bus `R27f8d4b1+2` journey, 29400→30480. Passed. ($0.17, 11 requests, 18 s)
- Right: Cheapest run overall ($0.17, 11 requests)

### saturday_direct

**Tool calling: passed.** Direct tram `Rb28d92d7`, departure 33300 and arrival 34560. Passed. ($0.28, 17 requests, 84 s)
- Right: Correct direct journey
- Mistake: Used 17 requests and an over-elaborate SVG (filters, gradients, grid) for a one-leg trip

**Code mode: passed.** Direct tram `Rb28d92d7`, 33300→34560. Passed. ($0.22, 16 requests, 73 s)
- Right: Simpler SVG, and cheaper than tools

### one_change

**Tool calling: passed.** Took `Rafeef850`, then `R620ec7d9` at Straßburger Platz, arriving 28440. Passed. ($0.22, 14 requests, 65 s)
- Right: Correct legs and transfer
- Mistake: Gave departure 27600 although the first vehicle leaves at 27669 from an origin platform. Code mode gave 27669, and only arrival seems to have been graded.

**Code mode: passed.** Same legs as tools, arriving 28440, with departure 27669. Passed. ($0.21, 14 requests, 60 s)
- Right: Departure given correctly as the first vehicle's departure

### walking_change

**Tool calling: passed.** Bus `R76d2117b+4` to Prager Straße, a walk to Altmarkt, then tram `R3a0dccd4+54`, arriving 63480. Passed. ($0.25, 16 requests, 73 s)
- Right: Found the walking transfer between two stations

**Code mode: passed.** Same bus–walk–tram journey as tools, arriving 63480. Passed. ($0.24, 13 requests, 1.5 min)
- Right: Correct, with 13 requests

### after_midnight

**Tool calling: passed.** Found a two-leg trip (`R93fefd15` then `R900bf42f+2`) leaving at 4200 and arriving at 6420, with a correct SVG. Passed. ($0.27, 14 requests, 69 s)
- Right: Same answer as code mode (4200→6420), with a walk transfer at the change
- Right: SVG has `data-place` markers and `data-run` paths at the correct east/35, 600-north/35 coordinates

**Code mode: passed.** Same answer as tools (4200→6420, `R93fefd15` + `R900bf42f+2`). Passed. ($0.26, 13 requests, 2.4 min)
- Right: Correct, with 13 requests

### arrive_by

**Tool calling: passed.** Returned `R1aabe4da+29` to Straßburger Platz, then `Rfd6f9e2d+67`, leaving 63360 and arriving 64440. Passed. ($0.34, 16 requests, 78 s)
- Right: Same journey as code mode
- Right: Drew the transfer walk as an unlabelled dashed line, separate from the legs

**Code mode: passed.** Same journey as tools (63360→64440). Passed. ($0.26, 15 requests, 72 s)
- Right: Cheaper than tools ($0.26 vs $0.34)

### departure_profile

**Tool calling: failed.** Built 2-leg and 3-leg journey tables in SQL and pruned dominated journeys. Returned 15 journeys when the correct answer was 12 (the code-mode run returned 12). Failed. ($0.43, 23 requests, 2.6 min)
- Right: Expanded repeats and interpolated untimed calls correctly in SQL (`interp`, `trips`, `tcalls`)
- Right: After a recursive CTE hit the 30 s time-out, switched to joining precomputed `firstlegs`/`lastlegs` tables
- Right: The first 12 journeys (25327→27420 … 28620→30780) match the passing code-mode answer
- Mistake: When building `firstlegs` it filtered `b.dep-sw.sec BETWEEN 25200 AND 28800`, so it never made journeys leaving after 08:00. The dominance check (`MIN(arrival) OVER(ORDER BY departure DESC …)`) therefore could not see later departures, which the question says count ('leaving at any time'). Journeys leaving after 28800 would have pruned 28669→31063, 28683→31620 and 28767→31980.
- Mistake: It should have built candidate journeys for departures past 08:00 too, pruned, and only then cut the list to the 07:00–08:00 window

**Code mode: passed.** Returned the correct 12 journeys from 25327→27420 to 28620→30780. Passed. ($0.42, 18 requests, 1.7 min)
- Right: Included later departures when pruning dominated journeys, so the three journeys the tools run kept were dropped
- Right: Built the SVG in Python from the query results instead of writing coordinates by hand

### meeting_point

**Tool calling: passed.** Chose Albertplatz (`Sbb9212fa`) at 33701, with one tram leg for each friend (`Rc0124950`, `Rfa439a34`). Passed. ($0.39, 19 requests, 86 s)
- Right: Same meeting station and time as code mode
- Mistake: The first friend boards `Rc0124950` at `Pda4a5390` at 33300. Code mode boards the same run at 32400 via `P3035f403`. The graders accepted both.

**Code mode: passed.** Albertplatz at 33701, the same answer as tools. Passed. ($0.30, 16 requests, 1.6 min)
- Right: Departure times include the walk to the first platform

### timed_tour

**Tool calling: passed.** A 6-leg round trip with four timed visits, returning at 44160. Passed. ($0.58, 24 requests, 2.0 min)
- Right: Same return time (44160) as code mode
- Right: Visit departures account for the walks
- Mistake: The most expensive case in either mode ($0.58, 24 requests)

**Code mode: passed.** A 5-leg round trip back at 44160, the same time as tools with one fewer leg. Passed. ($0.33, 17 requests, 1.9 min)
- Right: About half the cost of the tools run ($0.33 vs $0.58)

### tour

**Tool calling: failed.** Built stop-to-stop 'journeys' with at most 2 vehicles that board and alight only at the target stations' own platforms, then ran a layered DP over visit sets. Returned at 50012. Code mode found 48660. Failed. ($0.45, 20 requests, 3.2 min)
- Right: Correctly expanded the calls for Saturday `2026-339`
- Right: When the recursive CTE timed out, replaced it with layer-by-layer tables (`d1`…`d6`, later `p1`…`p6`) keyed by visited set
- Right: On a second pass, added the walk between the arrival platform and the next boarding platform
- Mistake: `from_t`/`to_t` join `target_platforms` on `bp`/`ap`, so each hop has to board and alight at the station's own platforms. Walks at the start or end of a hop to nearby platforms are excluded.
- Mistake: `j2raw` limits each hop to at most two vehicles
- Mistake: Its own reasoning said a 3-leg route 'could lead to an earlier tour', but it never checked and submitted 50012
- Mistake: It should have computed earliest arrivals between each pair of targets with full routing (any number of legs, start and end walks), as code mode did

**Code mode: passed.** An 11-leg tour back at 48660, earlier than the tools run's 50012. Passed. ($0.51, 28 requests, 4.0 min)
- Right: Found an order and legs better than the tools run
- Mistake: Most requests of any run (28)
