---
title: "GPT-6.2 Astra on Pydantic AI Geo Analyst"
description: "Spatial questions and SVG maps from raw earthquake, fire and place data in DuckDB. Tool calling 100%, code mode 100%; rank 1 of 20."
canonical: https://models.pydantic.dev/models/gpt-6.2-astra/geo_analyst/
---

# GPT-6.2 Astra on Pydantic AI Geo Analyst

> Spatial questions and SVG maps from raw earthquake, fire and place data in DuckDB. Tool calling 100%, code mode 100%; rank 1 of 20.
>
> Markdown copy of https://models.pydantic.dev/models/gpt-6.2-astra/geo_analyst/. 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>`

Add `intent=<intent>&stack=<stack>&harness=<harness>` to the query string of the first three. An `OPTIONS` request to any endpoint returns its schema. The same four 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/geo_analyst.md. The model on every Pydantic AI benchmark: https://models.pydantic.dev/models/gpt-6.2-astra.md

| Mode         | Score | Tasks passed | Cost  | Requests | Tool calls | Time    |
| ------------ | ----- | ------------ | ----- | -------- | ---------- | ------- |
| Tool calling | 100%  | 10 of 10     | $1.13 | 52       | 50         | 4.2 min |

Each task was run once per mode.

## Review

Written by an LLM from the runs' transcripts.

#### Overall

The model passed all 20 runs: 10/10 cases in tool calling and 10/10 in code mode. Total cost was $1.13 over 52 requests with tools and $0.83 over 49 requests in code mode. Most cases finished in 3–5 requests, often with a single SQL query doing the main computation.

#### Where it does well

- **Reads DATA.md first and decodes the encodings.** It found magnitude stored ×100, depth `z` as negative metres, `k='T'` for earthquakes, `mk` magnitude codes, and catalogue B's year-dayofyear times with N/S/E/W suffixes. This drove deep_moment, exposed, local_night and b_only_hypo.
- **Geometry is correct.**
  - It used true 3D hypocentral distance (chord formula with radius 6371 − depth) in b_only_hypo, exposed and pair_map_hypo.
  - It handled the antimeridian correctly in cross_section and pair_map_hypo.
  - It took great-circle midpoints by summing unit vectors.
  - It ranked nearest neighbours by unit-vector dot product in local_night.
- **It gets subtle details right.**
  - It picked the Alaska Anchorage over the Kentucky one (b_gof).
  - It used half-open day windows (deep_moment, mato_grosso).
  - It handled DST per event and the 20:00–06:00 night window (local_night).
  - It relied on DuckDB's averaging median (brazil_nn).
  - It used inclusive ≤1 km / ≤12 h thresholds (world_clusters).
- **It handles harder algorithms.** It did greedy one-to-one matching with a recursive CTE (pair_map_hypo) and iterated connected components to convergence over 680,723 fires and about 1.87M edges (world_clusters).

#### Mistakes it makes

None of these caused a failure, but they recur:

- **Hardcoded, unverified bounds.** The overlap window (2026-10-26 16:00 to 2026-11-25 15:36) was never checked against the data's min/max times. This happened in b_only_hypo and pair_map_hypo, in both modes.
- **Unverified conventions.** DATA.md was truncated in many transcripts. Filters such as excluding place kinds S/H/Q, or the UTC day in mato_grosso, cannot be traced to the documentation. Reviewers called mato_grosso in code mode "possibly partly lucky".
- **Heuristic spatial cut-offs.**
  - brazil_nn relied on bounding-box and grid windows.
  - The world_clusters code-mode grid cells (0.01°/0.03°) were only just wider than 1 km.
- **Missing sanity checks and wasted work.**
  - It did not check that only one region row matched (mato_grosso).
  - It did not read back the written SVG (cross_section, code mode).
  - It brute-forced a cross join of about 290M rows (local_night).
  - It added decorative SVG elements in pair_map_hypo; in code mode this included recovering from an ST_PointN error.
  - A disallowed `SET timezone` cost an extra call (b_only_hypo, tools).

#### Tool calling compared with code mode

Accuracy was identical. Code mode was about 26% cheaper overall, but nearly all of that gap comes from pair_map_hypo ($0.45 tools vs $0.15 code mode). Without that case, the totals are about equal ($0.67 vs $0.68).

Tool calling was cheaper in 6 of the 10 cases, mostly the simple single-query tasks:

| Case        | Tools  | Code mode |
| ----------- | ------ | --------- |
| deep_moment | $0.040 | $0.054    |
| mato_grosso | $0.042 | $0.054    |

Code mode was cheaper in 4 cases, the heavier ones:

| Case           | Tools  | Code mode |
| -------------- | ------ | --------- |
| cross_section  | $0.136 | $0.075    |
| world_clusters | $0.124 | $0.119    |
| b_only_hypo    | $0.083 | $0.076    |
| pair_map_hypo  | $0.45  | $0.15     |

Code mode used the most requests in a single run (10, on pair_map_hypo), yet still cost a third of the tool-calling run on that case. Its brazil_nn run added an exact brute-force fallback for fires more than 300 km away, a robustness step the tool-calling run did not take.

## Runs

### deep_moment

**Tool calling: passed.** The agent read DATA.md, ran one DuckDB query on quakes_a.jsonl that filtered by time window, event type, magnitude type, magnitude and depth, and returned count 7. That matches the expected answer. ($0.040, 3 requests, 8 s)
- Right: Read DATA.md before querying, which is how it learned the encodings: k='T', mk=3 for moment magnitude, m stored as an integer ×100, and z in metres with negative values below sea level.
- Right: Set the date window correctly: 1 Nov 00:00 UTC inclusive up to 16 Nov 00:00 exclusive, so all of 15 November is included.
- Right: Used z < -70000 for 'more than 70 km below sea level' and m>=500 for 5.0 or more, both strict and inclusive bounds as the question requires.
- Right: Reached the answer efficiently with a single query and no wasted steps.
- Mistake: The transcript shows only the start of DATA.md, so it can't be confirmed that the agent checked for duplicate or retracted events. The answer matched, though.

### mato_grosso

**Tool calling: passed.** The agent read DATA.md and ran one spatial SQL query that counted fires with cls='H' inside the Mato Grosso polygon from regions.tsv during the UTC day of 21 November 2026. It got 5, which matches the expected answer. ($0.042, 4 requests, 13 s)
- Right: It read the data dictionary first and then jumped to the section on fires and event classes.
- Right: It used the correct confidence code cls='H' and the region polygon for country='BRA' and name='Mato Grosso'.
- Right: It used ST_Covers for point-in-polygon, so points on the boundary are counted.
- Right: It solved the task with one efficient query.
- Mistake: It did not show that it read the rest of DATA.md after the fires section (about 6,000 characters were truncated). That part may hold rules on day boundaries (UTC vs local time), duplicate detections, or region matching. The query used UTC days without checking, and the answer was right without that check.
- Mistake: It did not check whether the name/country filter matched exactly one region row. A duplicate row would have double-counted fires.

### b_only_hypo

**Tool calling: passed.** The agent read DATA.md, sampled both catalogue files, and loaded catalogue A and catalogue B (M≥4.5, restricted to the overlap window) into DuckDB. It counted B events with no A event within ±30 s and within a 50 km 3D hypocentral distance, got 36, and this matched the expected answer. ($0.083, 7 requests, 27 s)
- Right: Read DATA.md before working, then sampled both files to check their formats (A's local-offset ISO times with z in negative metres; B's year-dayofyear plus seconds-of-day, hemisphere-lettered coordinates, depth in km).
- Right: Converted A's offset timestamps to UTC with timezone('UTC', t::timestamptz) after the SET statement was rejected.
- Right: Built B timestamps from strptime('%Y-%j') plus milliseconds and applied the sign from the N/S/E/W suffixes.
- Right: Computed a true 3D hypocentral distance using a chord formula on spheres of radius 6371 − depth. It did not settle for epicentral distance alone.
- Right: Restricted B to the overlap period and to m≥4.5 before running the anti-join, which matches the question's 'period both catalogues cover' and 'any class in catalogue A'.
- Mistake: The overlap bounds were hardcoded ('2026-10-26 16:00:00' to '2026-11-25 15:36:00') with no query to derive them, so they look as if they came from DATA.md text the transcript truncated. They were never checked against min/max times in the data. A ±30 s margin at the window edges could also matter, although the result came out correct.
- Mistake: The first query used SET timezone, which is not allowed, and cost one extra call.

### local_night

**Tool calling: passed.** The agent read DATA.md, then loaded catalogue A filtered to k='T' and m>=250 (1804 events) and the places with some kinds excluded (162307 rows). It found each quake's nearest settlement with a 3D unit-vector dot-product arg_max, counted local hours >=20 or \<6, and got 787, which matches the expected answer. ($0.051, 4 requests, 13 s)
- Right: Read DATA.md before querying and applied conventions from it: magnitude stored as an integer scaled by 100 (m>=250), the k='T' event filter, and excluding certain place kinds.
- Right: Used unit-vector dot products to find the nearest place, which ranks by great-circle distance correctly without a haversine call.
- Right: Converted to local time with timezone(tz, t) on a timestamptz, which handles DST per event.
- Right: Applied the night window correctly as hour>=20 OR hour\<6, with 06:00 excluded.
- Right: Answered in only three SQL calls.
- Mistake: The full cross join of 1804 quakes x 162307 places (~290M rows) is brute force. It worked, but a bounding-box prefilter or spatial index would be cheaper.
- Mistake: The transcript truncates DATA.md, so the reasons for the k='T' filter and for excluding kinds S/H/Q cannot be checked; the matching result suggests they were correct.

### brazil_nn

**Tool calling: passed.** The agent read DATA.md, loaded Brazil's divisions and the VIIRS fires (VJ1/VJ2), joined fires to divisions, and found each fire's nearest place of 10,000 or more people using a ±5-degree grid and haversine distance. It then took counts and medians per division, and all 27 rows matched the expected answer. ($0.084, 5 requests, 27 s)
- Right: Filtered fires to the VIIRS satellites (VJ1, VJ2) only and assigned them to Brazilian divisions with st_intersects, giving 93,791 detections.
- Right: Did not limit settlements to Brazil, as the question requires: the places bounding box (lon -81 to -22, lat -41 to 12) takes in neighbouring countries.
- Right: Excluded non-settlement place kinds ('S','H','Q'), presumably following DATA.md conventions.
- Right: Used an efficient grid join (±5 degree cells) with haversine on a 6371 km radius (12742\*asin). It checked that every fire got a distance and that the largest distance (387 km) was well inside the search window.
- Right: DuckDB's median() averages the two middle values for even counts, which matches the rule; values were rounded to 1 decimal.
- Right: Finished in only 4 tool calls.
- Mistake: The places bounding box and the ±5-degree grid are heuristic cut-offs. They worked here, and the max-distance check partly validated them, but nothing proved that no closer settlement lay outside the window. The 387 km maximum is well under the roughly 550 km window radius, so the risk was small.

### exposed

**Tool calling: passed.** The agent read DATA.md, then ran one SQL query. It filtered places to pop>=500000 excluding some kinds, kept class-T events in catalogue A, converted m/100 and z in metres, and computed the 3D hypocentral distance. It returned 23 ids that match the expected set. ($0.052, 4 requests, 13 s)
- Right: Read DATA.md before querying and applied its conventions: earthquakes are class 'T', the magnitude is stored as m/100 (pow(10,m/200.0-0.7)), and depth z is in metres (z/1000.0).
- Right: Computed the true hypocentral distance (a chord-like 3D formula using depth and Earth radius 6371) rather than the epicentral surface distance.
- Right: Pruned candidate pairs cheaply with abs(h)\<r before the distance test, and solved the task in a single efficient SQL call.
- Right: Returned the ids as strings in the expected format.
- Mistake: The filter kind not in ('S','H','Q') is not explained in the transcript, which omits the part of DATA.md covering places. The result matched, so the filter was presumably correct, but it can't be verified from what is shown.
- Mistake: The second read_text started at line 60 and may have skipped some lines of DATA.md. This was harmless here.

### b_gof

**Tool calling: passed.** The agent read DATA.md, looked up Anchorage, Alaska (pid 5879400) and ran a single SQL query to bin local-magnitude tectonic events within 300 km and compute the goodness-of-fit Mc. It found Mc=2.0 with b=1.152 (R=89.5), which matches the expected answer. ($0.062, 5 requests, 19 s)
- Right: Picked the Alaska Anchorage row (61.21806, -149.90028), not the Kentucky place with the same name.
- Right: Filtered on k='T' (earthquakes only) and mk=1 (local magnitude), as DATA.md defines.
- Right: Did the halves-up rounding exactly with integer bins: floor((m+5)/10) on what appear to be tenth-unit magnitudes.
- Right: Filled empty bins with zero using range plus a left join, so the observed-minus-predicted sum covers every m from Mc to the maximum.
- Right: Simplified the predicted count correctly: 10^(a-b(m-0.05)) equals N*10^(-b(m-Mc)), so the bin prediction is N*(10^(-b(m-Mc)) - 10^(-b(m-Mc+0.1))).
- Right: Solved the whole computation in one query, which was efficient.
- Mistake: Did not check the units of m in quakes_a. The /10 scaling assumes magnitudes are stored in tenths; the transcript shows no explicit check, though the outcome suggests the assumption was right.
- Mistake: Used 12742 km as Earth's diameter (radius 6371) without confirming the convention DATA.md gives; it did not affect the result.

### world_clusters

**Tool calling: passed.** The agent filtered the fire file to VIIRS detections (sat VJ1/VJ2, 680,723 rows) and built 3D unit-cube cells to find pairs within 1 km great-circle distance (chord threshold) and 12 h of each other (1,874,135 edges). It merged connected components with iterative parent/root contraction until no edges remained, then aggregated the clusters of 300 or more. All 45 clusters match the expected answer. ($0.12, 8 requests, 38 s)
- Right: Read DATA.md first and used the sat codes to select VIIRS only (VJ1, VJ2), excluding MODIS.
- Right: Converted frp_kw to MW by dividing by 1000 and rounded to one decimal as asked.
- Right: Used an exact great-circle threshold through the chord length 12742\*sin(1/12742) and the inclusive comparisons \<= 1 km and \<= 43200 s.
- Right: Used 3D grid cells plus neighbour cells, which keeps the pair search to candidate points instead of a full cross join.
- Right: Iterated the component contraction (e2 to e5) until the edge count reached 0, which confirms the components had fully converged.
- Right: Took min(fid) per component as the cluster id.
- Mistake: No substantive errors. The agent did not sanity-check the result, for example by comparing it against a simpler union-find on a sample, but the convergence check (e5 = 0 edges) gave reasonable assurance.

### cross_section

**Tool calling: passed.** The agent read DATA.md and computed great-circle along-track and cross-track positions in a single DuckDB query using custom spherical macros. It got 25 qualifying catalogue A events and wrote an SVG whose coordinates match the expected answer exactly, so the run passed. ($0.14, 5 requests, 33 s)
- Right: Read DATA.md first, then filtered on magnitude not null and k='T'. The filter matched the expected set of 25 events.
- Right: Projected each epicentre onto the great circle with a local frame centred at 23°S 178°E (along = atan2, cross-track = sine of angle). It applied both filters correctly: along between 0 and the total length, and |cr| \<= sin(150/6371).
- Right: Scaled x as along/len\*1000 and y as depth/1.4 (z is stored negative, hence -z/1400). All 25 coordinates match the expected answer to 3 decimals.
- Right: Finished efficiently with 2 SQL queries and 1 write. data-id appears only on the circles and the radius is 3.
- Mistake: No real errors. The k='T' (tectonic) filter is not in the question text and presumably comes from a DATA.md convention; the agent did not state this reasoning, though the result matched.
- Mistake: The SQL step converted lon 174°W to 186 by hand and did not spot-check the antimeridian handling. It worked, but nothing in the transcript verifies it.

### pair_map_hypo

**Tool calling: passed.** The agent read DATA.md and loaded both catalogues with filters for magnitude, area across the antimeridian and the common time window. It computed candidates from 3D hypocentre distance and did greedy one-to-one matching with a recursive CTE, projected 67 matched midpoints, 67 unmatched A events and 24 unmatched B events, and wrote a 158-circle SVG. It passed. ($0.45, 7 requests, 63 s)
- Right: Read DATA.md before querying and applied its conventions: k='T' filter, magnitude scaled ×100 in A, depth sign and units, B's year-day date format and hemisphere suffixes.
- Right: Handled the antimeridian correctly in both the area filter (lon>=160 or lon\<=-170) and the projection (lon+360 for negative longitudes).
- Right: Restricted both catalogues to the period both cover.
- Right: Computed hypocentral distance including depth, using the chord formula with radius 6371 minus depth.
- Right: Implemented the greedy one-to-one acceptance with a recursive CTE over candidates ordered by time difference, distance, A id, B id.
- Right: Took the great-circle midpoint by summing unit vectors.
- Right: Kept the work to a few efficient SQL calls, and the feature count matched the expected 158.
- Mistake: The time window used hard-coded bounds (16:00 to 15:36). These were presumably taken from DATA.md, which was truncated in the transcript, so this cannot be verified, though the result matched the expected answer.
- Mistake: Added non-essential decoration to the SVG (title, gridlines, labels, legend). It was harmless because no other element carried a data-id.
