---
title: "Qwen3.5 Plus 2026-04-20 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 10%, code mode 30%; rank 35 of 44."
canonical: https://pydantic.dev/models/list/qwen3.5-plus-20260420/sql_data_analysis/
---

# Qwen3.5 Plus 2026-04-20 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 10%, code mode 30%; rank 35 of 44.
>
> Markdown copy of https://pydantic.dev/models/list/qwen3.5-plus-20260420/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/qwen3.5-plus-20260420/pydantic_ai.md

| Mode         | Score | Tasks passed | Cost  | Requests | Tool calls | Time      |
| ------------ | ----- | ------------ | ----- | -------- | ---------- | --------- |
| Tool calling | 10%   | 1 of 10      | $7.27 | 774      | 777        | 97.3 min  |
| Code mode    | 30%   | 3 of 10      | $8.53 | 698      | 697        | 149.9 min |

Each task was run once per mode.

## Review

Written by an LLM from the runs' transcripts.

#### Overall

Qwen3.5-plus passed 4 of 20 runs: 1 of 10 in tools mode and 3 of 10 in code mode. 15 runs hit the 80-request limit, and one gave a wrong answer (departure_profile, code mode). Every pass was a one- or two-vehicle question: one_vehicle in both modes, plus saturday_direct and arrive_by in code mode. Even the passes took 47-55 requests.

#### Where it does well

- It always reads DATA.md first. It gets the service bitmask and date range right, and handles repeats and the 120 s change margin.
- When it builds a real search, the method is sound. meeting_point in code mode used Dijkstra over platforms. Code-mode saturday_direct used interpolated times and found `Rb28d92d7` at 33484, earlier than the tools attempt's `Ra7402f8f` at 34320.
- Its SVGs follow the spec: `east/35`, `data-place` and `data-run`.

#### Mistakes it makes

- **No general algorithm (most failures).** In tools mode it searches by hand-written SQL: first legs, then transfers, then second legs, then checking single runs (`SELECT * FROM calls WHERE run = ...`). It restarts often ("Let me take a completely different approach"). timed_tour and tour list visit orders one query at a time. departure_profile and tour spent the whole budget rebuilding interpolation tables.
- **Keeps verifying after it has the answer.** In code mode, one_change wrote the SVG and meeting_point had ranked meeting stations, but both spent their last requests re-checking and never answered.
- **Arithmetic slip.** In after_midnight (tools) it turned 01:10 into `3660` instead of 4200 and used that as the start filter.
- **Too narrow a search.** departure_profile (code) only listed two-vehicle journeys, and its dominance filter left suspicious pairs (two journeys leaving 07:57, arriving 08:33 and 08:37).
- **Wasted requests on the sandbox.** after_midnight (code) spent about 10 requests wrapping `run_sql` in `asyncio.run(main())`, which made every result `None`. walking_change paged DuckDB out 200 rows at a time. departure_profile hit a 30 s timeout and a 256 MB memory error.

#### Tool calling compared with code mode

Code mode did better (3 passes against 1). It could load the CSVs into Python and run real searches, which tools mode cannot. In arrive_by (tools) the model wrote `/out/solve.py` that it had no way to run. Code mode still failed 7 times, mostly on the request limit. It wasted requests on sandbox confusion and kept re-verifying instead of answering, and was usually dearer per run ($0.44-$1.43, against $0.38-$1.11 in tools mode). Tools-mode failures look alike: 9 runs of step-by-step SQL that never added up to a solver.

## Runs

### one_vehicle

**Tool calling: passed.** Found bus 66 run `R27f8d4b1+2`, boarding `P0091960a` at 29940 and arriving at `P6e8c05a2` at 30480, with a walk from Lennéplatz drawn. It passed after 54 requests. ($0.46, 54 requests, 7.9 min)
- Right: Correct direct run, including a walk to a nearby platform
- Right: SVG used the correct coordinate scaling
- Mistake: 54 requests ($0.46) for a single-vehicle question is a lot

**Code mode: passed.** Gave the same correct answer as tools mode (`R27f8d4b1+2`, 29940→30480) and drew the full route polyline plus the ridden leg. It passed after 47 requests. ($0.44, 47 requests, 8.1 min)
- Right: Correct run and times
- Right: Rich SVG with `data-run` on the leg
- Mistake: 47 requests for a direct-ride question

### saturday_direct

**Tool calling: error.** Settled on `Ra7402f8f` boarding `P7fa04a55` at 34320 and used its last requests on SVG details. It hit the limit without answering. Code mode found an earlier run, `Rb28d92d7` at 33484. ($0.80, 80 requests, 11.6 min)
- Right: Ruled out `R2aa4cdd7`, which runs in the wrong direction (destination before origin)
- Mistake: Its candidate leaves later than the run code mode found (33484, an interpolated time), so it probably skipped untimed or interpolated calls
- Mistake: Spent about 50 requests checking whether `Ra7402f8f` was a repeat child, and other side issues

**Code mode: passed.** Found `Rb28d92d7` boarding `P7fa04a55` at 33484 (an interpolated time) and arriving `P1093f876` at 34560. It passed after 49 requests. ($0.54, 49 requests, 12.6 min)
- Right: Handled untimed or interpolated calls, which gave an earlier run than the tools attempt found
- Right: Marked every station platform with `data-place`

### one_change

**Tool calling: error.** Checked candidate runs one by one in SQL (`Rafeef850` and its repeats, the access code of `R5fe35e2d` at `Pae8500f7`) and ran out of requests while still checking. ($1.11, 80 requests, 8.7 min)
- Right: Decoded the service bitmask correctly (`days=31` is Mon-Fri)
- Mistake: Spent single requests on trivia, for example the run-name typo check `LIKE 'Rafeef8%'` and one access field
- Mistake: Never ran one query joining the first leg, the transfer and the second leg

**Code mode: error.** Parsed the CSVs in Python, interpolated times, expanded repeats and found a two-leg journey (`P0708873e` → `P66c27b1c` …). It wrote the SVG at msg 153, used the 80th request re-reading it, and never gave the final answer. ($0.77, 80 requests, 12.5 min)
- Right: Built the full in-memory pipeline: interpolation, repeats, first and second legs
- Right: SVG was written
- Mistake: Wasted early requests on `run_sql` experiments (msg 31: multi-statement test)
- Mistake: Ran out right before the final answer because of a cosmetic SVG check

### walking_change

**Tool calling: error.** Checked specific bus 61 → tram 2 connections via Zwinglistraße with walk arithmetic (`68160 + 120 + 55`). It re-queried the same run `Re5215f58` at msgs 149-157 and ran out. ($0.76, 80 requests, 8.3 min)
- Right: Applied the walk time plus the 120 s change margin in its feasibility checks
- Mistake: Queried the same run's calls repeatedly instead of searching all transfers in one query

**Code mode: error.** Built an `expanded_calls` table in DuckDB, then tried to copy it into Python in batches of 200 rows (msg 157), and ran out. ($0.53, 80 requests, 8.4 min)
- Right: Expanded repeats in SQL
- Mistake: Paged the whole expanded call table out 200 rows at a time instead of reading /data with Python's csv module, as it did in other cases

### after_midnight

**Tool calling: error.** Wrote dozens of hand-made SQL joins (`first_legs`, `dest_boarding`, `fri_first_legs`) to look for one-change journeys from Reichenbachstraße. It never built a general search and hit the 80-request limit before answering. ($0.73, 80 requests, 10.1 min)
- Right: Read DATA.md and loaded the tables early
- Right: Noticed that Friday (2026-338) runs with `at > 86400` reach Saturday morning, for example `Rca4e4824` at 4380
- Right: Caught its own missing service filter on `R4663020b` (service `V0fbcf1ab` runs Sundays only)
- Mistake: Converted 01:10 to `3660` seconds instead of 4200 and used `boarding >= 3660` as the start-time filter throughout
- Mistake: Restarted the repeat expansion at least 5 times (msgs 111-157: "Let me take a completely different approach") and never finished it
- Mistake: Only checked one-transfer combinations and kept verifying them by hand instead of writing an earliest-arrival scan

**Code mode: error.** Spent about 10 requests (msgs 7-22) wrapping `run_sql` in `asyncio.run(main())`, which made every result come back as `None`. It then explored first/transfer/second-leg SQL and ran out. ($1.14, 80 requests, 15.4 min)
- Right: Eventually switched to top-level `await run_sql(...)`, which returned data
- Right: Found the Friday-night runs (`Rca4e4824`)
- Mistake: Kept rewriting the `asyncio.run` wrapper instead of trying top-level await
- Mistake: Never moved to an in-memory search in Python

### arrive_by

**Tool calling: error.** Explored latest boardings at Pohlandplatz with SQL (`R20f18e60+67` at 64740) and drafted `/out/solve.py`, but it could not run the file. It went back to manual per-run SQL and ran out of requests. ($1.01, 80 requests, 11.7 min)
- Right: Found the platforms and the active services
- Right: Saw that it needed a programmatic solver
- Mistake: Wrote a Python solver file with no way to run it in tools mode (msg 151), which wasted requests
- Mistake: Searched run by run (for example `R0e4beb23+1` with offset 600) instead of scanning backwards from the deadline

**Code mode: passed.** Answered with tram 9 `R1aabe4da+29` (board `P10db34c8` at 63360), a same-station walk, then tram 10 `R54c1ee76+5`, arriving `P53270352` at 64500. It passed after 55 requests ($0.82). ($0.82, 55 requests, 13.9 min)
- Right: Correct latest-departure journey with two vehicles
- Right: SVG had correct `data-run` paths and markers
- Mistake: Used many requests and cost more than the tools-mode passes

### departure_profile

**Tool calling: error.** Spent most of its requests building interpolated call times with window-function SQL (`calls_with_prev`) and listing the origin and destination lines. It restarted the interpolation at msg 157 and never produced any journeys. ($0.67, 80 requests, 10.6 min)
- Right: Found the lines at the origin and destination (`Lea3d10ce`, `L12e13b74` and others)
- Mistake: Rebuilt the interpolation table several times (msgs 79, 121, 157) without finishing it
- Mistake: Gave no answer

**Code mode: failed.** Wrote a Python enumerator of first leg + walk + second leg. It hit a 30 s timeout (msg 90), a `NameError` after the session reset (msg 92) and a 256 MB `MemoryError` (msg 100), then output 14 "non-dominated" two-vehicle journeys. The answer was wrong. ($1.43, 67 requests, 25.0 min)
- Right: Read the CSVs directly in Python and computed walks
- Right: Recovered after session resets
- Mistake: Only enumerated journeys with exactly two vehicles, so direct or three-vehicle options could not appear
- Mistake: Its list keeps entries that look dominated (two journeys leaving 07:57, arriving 08:33 and 08:37) and a final 07:59→08:53, which suggests the dominance filter or the window boundary was wrong
- Mistake: An earlier version of the filter returned only 1 non-dominated journey (msg 96), which shows the filter was unstable

### meeting_point

**Tool calling: error.** Built a `stops` table with interpolated times and per-friend tables of direct rides (`o2_all_boardings`). The best direct-ride meeting point it found was Albertplatz at 33701. It hit the limit while starting to add transfers. ($0.66, 80 requests, 9.8 min)
- Right: Built an interpolated `stops` table
- Right: Got a direct-ride candidate meeting point
- Mistake: Handled direct rides first and transfers only at the end, so it never finished a full reachability search
- Mistake: Retried the CSV load (msgs 11 and 13) after `auto_detect=false` failed

**Code mode: error.** Loaded the files in Python, wrote a Dijkstra earliest-arrival search for each friend and ranked meeting stations by msg 153. It then kept "verifying" and hit the limit before giving the answer. ($0.98, 80 requests, 25.1 min)
- Right: Built a general Dijkstra over platforms with walks, the right method for this question
- Mistake: Kept re-checking (msgs 153-157) instead of writing the SVG and answering

### timed_tour

**Tool calling: error.** Built a `legs` table of direct station-to-station rides and tried visit orders by hand (for example 4→2→3→5→1, then 4→5→3→2→1). It ran out of requests mid-enumeration. ($0.68, 80 requests, 11.6 min)
- Right: Spotted that `calls` uses base run names, so repeats must be joined on `base_run`
- Mistake: Only used direct legs between the tour stations, with no transfers
- Mistake: Enumerated the permutations by hand, one query per step, instead of in one search

**Code mode: error.** Built station-pair connection tables in SQL and Python, then tried to add transfer connections through the tour stations (msgs 121-157). It ran out before choosing an order. ($0.81, 80 requests, 12.2 min)
- Right: Computed direct connections between the tour stations, with interpolation
- Mistake: Restricted transfers to the 5 tour stations, then started rebuilding the planner in SQL at msg 153
- Mistake: Gave no answer

### tour

**Tool calling: error.** Spent its whole budget building interpolated times for untimed calls (`interpolated_null_calls`) and debugging joins. It never reached the tour ordering. ($0.38, 80 requests, 6.9 min)
- Right: Used the correct distance-proportional interpolation formula
- Mistake: Debugged join row counts (msgs 155-157) with the budget nearly gone
- Mistake: Gave no route

**Code mode: error.** Worked out which tour stations connect to which by hand, from SQL results and comments (msg 157: "Marienberger Straße -> Julius-Vahlteich-Str (ONLY)"). It ran out of requests. ($1.07, 80 requests, 16.9 min)
- Right: Noticed that a station can be visited via any platform within 400 m
- Mistake: Reasoned about connectivity in comments instead of computing it
- Mistake: Took 3 tries just to read DATA.md (the first used `Path` before importing it)
