---
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 62.7%, code mode 50.3% over four benchmarks; rank 28 of 44."
canonical: https://pydantic.dev/models/list/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 62.7%, code mode 50.3% over four benchmarks; rank 28 of 44.
>
> Markdown copy of https://pydantic.dev/models/list/deepseek-v4.1-flash/pydantic_ai/. 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/pydantic_ai.md. The model's page: https://pydantic.dev/models/list/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://pydantic.dev/models/codemode.md).

|                                      | Tool calling | Code mode |
| ------------------------------------ | ------------ | --------- |
| Score, all six benchmarks            | 62.7%        | –         |
| Score, the four with a code mode run | 54.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 - Billing ops](https://pydantic.dev/models/benchmarks/billing_ops.md)             | 70%          | 40%       | −30    | $0.027        | $0.0031                  | 21 of 44 | https://pydantic.dev/models/list/deepseek-v4.1-flash/billing_ops.md       |
| [Pydantic AI - Customer support](https://pydantic.dev/models/benchmarks/customer_support.md)   | 50%          | 30%       | −20    | $0.010        | $0.0081                  | 12 of 44 | https://pydantic.dev/models/list/deepseek-v4.1-flash/customer_support.md  |
| [Pydantic AI - SQL data analysis](https://pydantic.dev/models/benchmarks/sql_data_analysis.md) | 20%          | 60%       | +40    | $0.027        | $0.044                   | 30 of 44 | https://pydantic.dev/models/list/deepseek-v4.1-flash/sql_data_analysis.md |
| [Pydantic AI - Research & deck](https://pydantic.dev/models/benchmarks/research_deck.md)       | 76.3%        | 71.1%     | −5.2   | $0.059        | $0.073                   | 25 of 44 | https://pydantic.dev/models/list/deepseek-v4.1-flash/research_deck.md     |
| [Pydantic AI - Structured output](https://pydantic.dev/models/benchmarks/structured_output.md) | 90%          | –         | –      | $0.0066       | –                        | 15 of 44 | https://pydantic.dev/models/list/deepseek-v4.1-flash/structured_output.md |
| [Pydantic AI - LLM Judge](https://pydantic.dev/models/benchmarks/llm_judge.md)                 | 70%          | –         | –      | $0.0019       | –                        | 18 of 44 | https://pydantic.dev/models/list/deepseek-v4.1-flash/llm_judge.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 Structured output (90%) and solid tool-calling results on Billing ops (70%) and Research & 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 SQL data analysis runs and 5 Billing ops code-mode runs. It also leans toward yes on borderline judgements and sometimes stops early on large audits.

#### Strengths
- On Structured output 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 Billing ops 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 Research & deck both runs read the full data room, reconciled revenue against units × price, and caught the restated September revenue and the Northline cancellation.
- On LLM Judge 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 SQL data analysis 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 SQL data analysis 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 Billing ops 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 Billing ops with tool calling it stopped large audits early, for example checking 26 of 384 invoices and guessing the rest.
- On LLM Judge all three failures were yes where the labels said no, including one case where its reasoning concluded no and then switched.
- On Research & 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 Billing ops 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 Billing ops 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 SQL data analysis 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 Research & 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 Billing ops and SQL data analysis, a guard that rejects placeholder `final_result` payloads is needed for either mode, especially code mode.
