---
title: "MiMo-V2.6-Pro 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 90%, code mode 80%; rank 11 of 44."
canonical: https://pydantic.dev/models/list/mimo-v2.6-pro/sql_data_analysis/
---

# MiMo-V2.6-Pro 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 90%, code mode 80%; rank 11 of 44.
>
> Markdown copy of https://pydantic.dev/models/list/mimo-v2.6-pro/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/mimo-v2.6-pro/pydantic_ai.md

| Mode         | Score | Tasks passed | Cost  | Requests | Tool calls | Time     |
| ------------ | ----- | ------------ | ----- | -------- | ---------- | -------- |
| Tool calling | 90%   | 9 of 10      | $1.07 | 365      | 487        | 75.7 min |
| Code mode    | 80%   | 8 of 10      | $1.13 | 314      | 320        | 73.9 min |

Each task was run once per mode.

## Review

Written by an LLM from the runs' transcripts.

#### Overall

The model passed 17 of 20 runs: 9 of 10 with tool calling and 8 of 10 in code mode. Both modes cost about the same: $1.07 and 365 requests for tool calling, $1.13 and 314 requests for code mode. On the cases both passed, they gave the same journeys, apart from `timed_tour`, where code mode found a different route that returns at the same 44160.

#### Where it does well

- **Basic journeys:** it solved every one in both modes: `one_vehicle`, `saturday_direct`, `one_change`, `walking_change`, `arrive_by` and `after_midnight`, plus `meeting_point`, where two friends must meet. This covers all of these:
  - working out which services run on a given day
  - expanding repeated runs into `<run>+<k>` names
  - walks of up to 400 m
  - the 120 s plus walk margin when changing vehicles
  - times just after midnight
- **Careful checking:** it read DATA.md fully and checked its own results. For example, in `tour` (tools) it re-checked every change margin and every 15-minute stay in SQL. It also tested whether allowing a 5th ride per leg improved anything.
- **SVGs:** they always followed the coordinate formula and carried the `data-place` and `data-run` attributes.

#### Mistakes it makes

- **`tour`, failed in both modes (2 runs).** Both built a DP over sets of visited stations and reached the same return time, 50012, by different routes. Both were marked wrong. The conversations do not show the cause, which suggests a modelling assumption the two modes share.
- **Estimating times of unlisted stops, 1 run** (`departure_profile`, code mode). The Python `run_schedule` estimated times from stops it had already estimated, instead of from the last stop with a published time as DATA.md requires. Rounding down at each step then made boarding times 1 second early (`25326` against the correct `25327`). The SQL version in tools mode did this correctly and passed.
- **Minor:** one SVG label said 17:58 for 63480 s, which is 17:38. Answers were unaffected.

#### Tool calling compared with code mode

- **Simple cases:** code mode was cheaper and shorter, for example `arrive_by` at 17 against 39 requests and `one_vehicle` at $0.038 against $0.051.
- **Hard cases:** code mode was more fragile.
  - In `tour` it ran out of the sandbox's 256 MB memory and had to rebuild everything.
  - Writing its own time estimation in Python introduced the 1-second bug that cost `departure_profile`.
  - Tools mode did all its searching in DuckDB with SQL, which was steadier but used more requests on the long cases (50–52).

## Runs

### one_vehicle

**Tool calling: passed.** Walked 398 m to Strehlener Platz and took bus `R27f8d4b1+2` to arrive 30480. Passed. ($0.051, 22 requests, 2.9 min)
- Right: Saw that a walk at the start, just under the 400 m limit, opens a direct bus
- Right: Gave the departure as 29400, the start time, not the boarding time

**Code mode: passed.** Same walk-then-bus answer as tools mode, arriving 30480. Passed. ($0.038, 17 requests, 1.6 min)
- Right: Cheapest run of all 20 ($0.038, 17 requests)

### saturday_direct

**Tool calling: passed.** Found the direct tram 9 run `Rb28d92d7` from 33484 to 34560. Passed. ($0.061, 28 requests, 4.9 min)
- Right: Worked out which services run on Saturday correctly

**Code mode: passed.** Same direct tram `Rb28d92d7`, 33484 to 34560. Passed. ($0.051, 28 requests, 3.8 min)
- Right: Simple, correct SVG with both platforms marked

### one_change

**Tool calling: passed.** Found the earliest arrival with at most 2 vehicles: `Rafeef850`, a 72 m walk, then `R620ec7d9`, arriving 28440. Passed. ($0.079, 35 requests, 4.3 min)
- Right: Kept to the limit of 2 vehicles and checked the 120 s plus walk change margin

**Code mode: passed.** Same 2-tram journey as tools mode, arriving 28440. Passed. ($0.050, 26 requests, 3.9 min)
- Right: Cheaper: 26 requests, $0.050

### walking_change

**Tool calling: passed.** Took bus 62 `R76d2117b+4`, walked between the two Pirnaischer Platz platforms, then took tram 2 `R3a0dccd4+54`, arriving 63480. Passed. ($0.053, 24 requests, 2.1 min)
- Right: Used a walk between platforms when changing vehicles
- Mistake: The SVG subtitle says it arrives at '17:58'. 63480 s is 17:38. This is only a label, so the answer is unaffected

**Code mode: passed.** Same 2-leg answer as tools mode, arriving 63480. Passed. ($0.047, 27 requests, 5.0 min)
- Right: Its SVG labels gave the correct arrival, 17:38

### after_midnight

**Tool calling: passed.** Found a 2-leg bus journey (`R93fefd15` then `R900bf42f+2`) that arrives at 6420 and drew the SVG. Passed. ($0.095, 41 requests, 10.2 min)
- Right: Handled a time just after midnight on a Saturday (5280 to 6420 s) correctly
- Right: Checked the 76 m walk between the two buses and the 120 s change margin
- Mistake: Used 41 requests, compared with 31 in code mode for the same answer

**Code mode: passed.** Same answer as tools mode (arrival 6420 via `R93fefd15` and `R900bf42f+2`). Passed. ($0.064, 31 requests, 8.2 min)
- Right: Used fewer requests (31) and cost less ($0.064) than tools mode

### arrive_by

**Tool calling: passed.** Found the latest departure that still arrives by 18:00: `R1aabe4da+29`, a 64 m walk, then `Rfd6f9e2d+67`, departing 63360 and arriving 64440. Passed. ($0.067, 39 requests, 3.4 min)
- Right: Read 'leave as late as possible' correctly as a backward search
- Right: Drew the walk as a dashed line without a `data-run`, so it is not counted as a leg
- Mistake: Used 39 requests, compared with 17 in code mode

**Code mode: passed.** Same journey as tools mode (63360 to 64440). Passed. ($0.072, 17 requests, 5.6 min)
- Right: Needed only 17 requests, against 39 in tools mode

### departure_profile

**Tool calling: passed.** Built every possible ride in SQL and listed 12 journeys, none beaten by another, that leave between 07:00 and 08:00. Passed. ($0.14, 52 requests, 10.0 min)
- Right: Times of unlisted stops were estimated from the last stop with a published time (`MAX(CASE WHEN at IS NOT NULL ...)` windows), as DATA.md requires, so boarding times such as `25327` are exact
- Mistake: The most expensive case in tools mode by requests (52)

**Code mode: failed.** Parsed the files in Python, ran a scan over all connections for 107 candidate departures and listed 12 journeys. Some times were 1 s early (`25326` and `25926` against the correct `25327` and `25927`, and alight `27316` against `27317`). Failed. ($0.17, 43 requests, 10.1 min)
- Right: The way it dropped journeys that another journey beats, and its reconstruction of each route, were correct
- Mistake: In `run_schedule` (message 15), it estimated each unlisted stop's time from the nearest earlier stop with any time, including stops it had just estimated (`while a >= 0 and times[a] is None`). DATA.md says to use the nearest stop with a published time. Rounding down at each step then made boarding times 1 second early. It should have used only published times as the starting points

### meeting_point

**Tool calling: passed.** Chose Albertplatz `Sbb9212fa`, where the two friends meet at 33701, each with one leg. Passed. ($0.10, 36 requests, 14.1 min)
- Right: Took the meeting time as the later of the two arrivals
- Mistake: Reported the first friend's `departure` as 33300 (the boarding time) where code mode gave 32400. Both versions passed, so the grader evidently accepts either

**Code mode: passed.** Same meeting place and time as tools mode (`Sbb9212fa` at 33701). Passed. ($0.15, 40 requests, 9.9 min)
- Right: Gave both friends' departure as the start time, 32400
- Mistake: Used 40 requests and $0.149, more than tools mode

### timed_tour

**Tool calling: passed.** Planned a round trip with 5 legs and 4 visits that returns at 44160. Passed. ($0.21, 38 requests, 9.9 min)
- Right: Took each visit's departure as the next vehicle's departure minus the walk
- Mistake: Cost $0.21, the second-highest cost in tools mode

**Code mode: passed.** Returned at 44160 like tools mode, but by a 6-leg route that starts with a short ride `R156a8ca5+3`. Passed. ($0.25, 46 requests, 9.2 min)
- Right: Found a route with a different first part that still returns at the best time
- Mistake: Most expensive run of all 20 ($0.25, 46 requests)

### tour

**Tool calling: failed.** Ran a DP over sets of visited stations in DuckDB (tables `S1`..`S5`, `L1`..`L5`, up to 4–6 rides per leg) and returned a route with 10 legs and 5 visits, back at 50012. Failed. ($0.21, 50 requests, 14.0 min)
- Right: Its own checks confirmed every change margin and every 15-minute stay (1578, 1084, 900, 927 and 900 s)
- Right: Checked that allowing a 5th ride per leg did not improve any arrival at the stations
- Right: Fixed the DuckDB error caused by naming a column with the reserved word `at`
- Mistake: Its answer, 50012, was graded wrong. Code mode reached the same 50012 by a different route. The conversation does not show which rule or better tour it missed, and the benchmark gives no expected answer

**Code mode: failed.** Its first search ran out of the sandbox's 256 MB memory and the session reset. It rebuilt the search as a DP over sets of visited stations, keeping the best arrival at each platform. It returned a different route with 10 legs, back at 50012, the same time as tools mode. Failed. ($0.25, 39 requests, 16.5 min)
- Right: Recovered from the memory reset by switching to a smaller, more efficient search
- Right: Rebuilt the final leg's route (`R07ed193a+11` from 49140)
- Mistake: Ran the DP under looser rules than the question ('revisit_free=True') and then checked the route it found. Its 50012 was graded wrong, the same as tools mode. The exact flaw is not visible in the conversation
- Mistake: Lost work and requests to the memory reset (message 27)
