---
title: "DeepSeek V4.1 Flash 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 59.4%, code mode 50.3% over four benchmarks; rank 25 of 32."
canonical: https://models.pydantic.dev/models/deepseek-v4.1-flash/pydantic_ai/
---

# DeepSeek V4.1 Flash 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 59.4%, code mode 50.3% over four benchmarks; rank 25 of 32.
>
> Markdown copy of https://models.pydantic.dev/models/deepseek-v4.1-flash/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/deepseek-v4.1-flash.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            | 59.4%        | –         |
| Score, the four with a code mode run | 49.1%        | 50.3%     |
| Cost per task, all six               | $0.022       | –         |
| Cost per task, the four              | $0.031       | $0.032    |

## 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)  | 70%          | 40%       | −30    | $0.027        | $0.0031                  | 19 of 32 | https://models.pydantic.dev/models/deepseek-v4.1-flash/accounting_platform.md |
| [Pydantic AI Support Inbox](https://models.pydantic.dev/benchmarks/support_inbox.md)     | 30%          | 30%       | ±0     | $0.0096       | $0.0081                  | 26 of 32 | https://models.pydantic.dev/models/deepseek-v4.1-flash/support_inbox.md       |
| [Pydantic AI Transit Planner](https://models.pydantic.dev/benchmarks/transit_planner.md) | 20%          | 60%       | +40    | $0.027        | $0.044                   | 27 of 32 | https://models.pydantic.dev/models/deepseek-v4.1-flash/transit_planner.md     |
| [Pydantic AI Seed Deck](https://models.pydantic.dev/benchmarks/seed_deck.md)             | 76.3%        | 71.1%     | −5.2   | $0.059        | $0.073                   | 21 of 32 | https://models.pydantic.dev/models/deepseek-v4.1-flash/seed_deck.md           |
| [Pydantic AI Companies House](https://models.pydantic.dev/benchmarks/companies_house.md) | 90%          | –         | –      | $0.0066       | –                        | 14 of 32 | https://models.pydantic.dev/models/deepseek-v4.1-flash/companies_house.md     |
| [Pydantic AI Judge Accuracy](https://models.pydantic.dev/benchmarks/judge_accuracy.md)   | 70%          | –         | –      | $0.0019       | –                        | 14 of 32 | https://models.pydantic.dev/models/deepseek-v4.1-flash/judge_accuracy.md      |

## How it did on the Pydantic AI benchmarks

Written by an LLM from reviews of every run.

#### Overall
The model is inexpensive and applies written rules well, with strong one-shot extraction on companies_house (90%) and solid tool-calling results on accounting_platform (70%) and seed_deck (76%). Its dominant failure is calling `final_result` before the work is done, often with placeholder or invented values, while its own reasoning says it is about to fetch more data. This fault hit 13 of 20 transit_planner runs and 5 accounting_platform code-mode runs. It also leans toward yes on borderline judgements and sometimes stops early on large audits.

#### Strengths
- On companies_house it scaled all three £000 cases correctly, kept group and parent figures separate in six cases, and signed deficits, liabilities and tax credits correctly, with no wrong monetary figure in any checked field.
- On accounting_platform with tool calling it passed both write cases, allocating payments oldest-first after netting an existing allocation and running void-and-reissue in the right order.
- On seed_deck both runs read the full data room, reconciled revenue against units × price, and caught the restated September revenue and the Northline cancellation.
- On judge_accuracy every case ended in one well-formed `final_result` call with no malformed calls or missing verdict ids, at about $0.019 in total.
- On transit_planner it read `DATA.md` correctly on weekday bits, access letters, walk limits and service-day offsets, and in code mode it delivered verified answers with SVGs for four cases.

#### Weaknesses
- On transit_planner it called `final_result` prematurely in 13 of 20 runs, submitting values such as `run: "bogus"`, `legs: []` or ids that appear in no query result.
- On accounting_platform code mode it submitted placeholders like `{"pence": 0}` or `{"ids": ["x"]}`, and in one run it fabricated invoice ids and amounts after exhausting the sandbox budget.
- On accounting_platform with tool calling it stopped large audits early, for example checking 26 of 384 invoices and guessing the rest.
- On judge_accuracy all three failures were yes where the labels said no, including one case where its reasoning concluded no and then switched.
- On seed_deck code mode it asked the founder before reading the files, did not resolve an ambiguous slide order, and misreported which image it had shipped.

#### Tool calling compared with code mode
- On accounting_platform tool calling was more reliable (7 of 10 against 4 of 10), and code mode's roughly ninefold lower cost came mostly from runs that ended early with placeholders.
- On accounting_platform code mode solved duplicate-lines at one sixteenth of the tool-calling cost when it finished, but it usually made one tool call per `run_code` and hit both sandbox limits.
- On transit_planner code mode passed 6 of 10 against 2 of 10 for tool calling, at $0.044 per run against $0.027, and tool calling solved no case that code mode missed.
- On seed_deck tool calling passed with half the requests, while code mode lost requests to sandbox gaps such as `view_image` not being callable and `import html` missing.
- Across accounting_platform and transit_planner, a guard that rejects placeholder `final_result` payloads is needed for either mode, especially code mode.
