---
title: "Grok 4.7 on Pydantic AI Combined"
description: "The mean of the six Pydantic AI benchmarks; code mode is compared over the four that have a code mode run. Tool calling 78.6%, code mode 78.8% over four benchmarks; rank 9 of 32."
canonical: https://models.pydantic.dev/models/grok-4.7/pydantic_ai/
---

# Grok 4.7 on Pydantic AI Combined

> The mean of the six Pydantic AI benchmarks; code mode is compared over the four that have a code mode run. Tool calling 78.6%, code mode 78.8% over four benchmarks; rank 9 of 32.
>
> Markdown copy of https://models.pydantic.dev/models/grok-4.7/pydantic_ai/. 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/pydantic_ai.md. The model's page: https://models.pydantic.dev/models/grok-4.7.md

## Scores

Cost is the mean cost of one task. Code mode is compared with tool calling over the four benchmarks run in both modes (https://models.pydantic.dev/codemode.md).

|                                      | Tool calling | Code mode |
| ------------------------------------ | ------------ | --------- |
| Score, all six benchmarks            | 78.6%        | –         |
| Score, the four with a code mode run | 80.4%        | 78.8%     |
| Cost per task, all six               | $0.77        | –         |
| Cost per task, the four              | $1.12        | $0.99     |

## Each benchmark

| Benchmark                                                                                | Tool calling | Code mode | Change | Cost per task | Cost per task, code mode | Rank     | Runs                                                               |
| ---------------------------------------------------------------------------------------- | ------------ | --------- | ------ | ------------- | ------------------------ | -------- | ------------------------------------------------------------------ |
| [Pydantic AI Accounting](https://models.pydantic.dev/benchmarks/accounting_platform.md)  | 90%          | 80%       | −10    | $0.99         | $0.11                    | 2 of 32  | https://models.pydantic.dev/models/grok-4.7/accounting_platform.md |
| [Pydantic AI Support Inbox](https://models.pydantic.dev/benchmarks/support_inbox.md)     | 60%          | 50%       | −10    | $0.27         | $0.58                    | 2 of 32  | https://models.pydantic.dev/models/grok-4.7/support_inbox.md       |
| [Pydantic AI Transit Planner](https://models.pydantic.dev/benchmarks/transit_planner.md) | 90%          | 100%      | +10    | $1.95         | $1.44                    | 10 of 32 | https://models.pydantic.dev/models/grok-4.7/transit_planner.md     |
| [Pydantic AI Seed Deck](https://models.pydantic.dev/benchmarks/seed_deck.md)             | 81.5%        | 85.2%     | +3.7   | $1.28         | $1.83                    | 15 of 32 | https://models.pydantic.dev/models/grok-4.7/seed_deck.md           |
| [Pydantic AI Companies House](https://models.pydantic.dev/benchmarks/companies_house.md) | 100%         | –         | –      | $0.078        | –                        | 1 of 32  | https://models.pydantic.dev/models/grok-4.7/companies_house.md     |
| [Pydantic AI Judge Accuracy](https://models.pydantic.dev/benchmarks/judge_accuracy.md)   | 50%          | –         | –      | $0.031        | –                        | 21 of 32 | https://models.pydantic.dev/models/grok-4.7/judge_accuracy.md      |

## How it did on the Pydantic AI benchmarks

Written by an LLM from reviews of every run.

#### Overall
Across five benchmarks the model passed most runs: accounting_platform (tools 90%, code mode 80%), seed_deck (tools 81%, code mode 85%), companies_house (tools 100%), judge_accuracy (tools 50%) and transit_planner (tools 90%, code mode 100%). It handles concrete extraction, timetable logic and accounting mutations reliably. Its weak points are broad audits that require completeness checks and judgment over ambiguous wording. Code mode cut cost sharply on large data joins and routing searches, but it did not consistently improve reliability on small tasks.

#### Strengths
- In accounting_platform, both modes passed all mutation and margin runs, including oldest-due-first payment allocation, voided-invoice releases and per-student half-up rounding.
- In companies_house, it passed all 10 cases with a single submission each, handling £000 scaling and group-versus-parent disclosures correctly.
- In transit_planner, both modes passed all ordinary journey, meeting and departure-profile cases, handling previous-service-day offsets, interpolation and transfer margins.
- In seed_deck, both runs caught the September revenue correction (£351,442, not £403,642) and used `view_pdf` when `pdf_text` found no text layer.
- In judge_accuracy, it reliably extracted concrete amounts, dates and procedural steps, such as the seven-day webhook replay window.

#### Weaknesses
- In accounting_platform, general audits passed only 1/4 runs: one inspected just 21 invoices, and the code audits missed duplicate charges.
- In judge_accuracy, it passed only 5/10 cases, often reading criteria too narrowly or misclassifying concerns such as treating an assurance as a deadline commitment.
- In seed_deck, both final decks equated production capacity with meeting a minimum purchase obligation despite passing `check_deck` validation.
- In transit_planner, an unquoted `at` caused SQL parser errors in 18 conversations, and the tools-mode `tour` run ran out of requests.
- In companies_house, it summed undisclosed debtors for Cube Logic and omitted displayed zero creditor rows for Drishaun, yet both cases still passed.

#### Tool calling compared with code mode
- In accounting_platform, code mode cost $1.1390 against $9.9043 for tools (about 88.5% less), with the largest savings on duplicate and missed-attendance detection.
- In accounting_platform, code mode did not improve audit completeness and often cost more on simple lookups, mutations and margins.
- In transit_planner, code mode used about 25% fewer requests and cost 26% less, and it passed `tour` where tools mode failed from request exhaustion.
- In transit_planner, simple cases such as `one_vehicle` and `one_change` needed more requests in code mode.
- In seed_deck, code mode used 50% more requests and cost about 43% more than tools for the same pass outcome.
