---
title: "Pydantic AI - Code review"
description: "One yes/no question per kind of defect in a function of real Python, TypeScript or Rust: catch the bugs, pass the clean code. One of the Decision models benchmarks; not part of the intelligence index."
canonical: https://pydantic.dev/models/benchmarks/code_review/
---

# Pydantic AI - Code review

> One yes/no question per kind of defect in a function of real Python, TypeScript or Rust: catch the bugs, pass the clean code. One of the Decision models benchmarks; not part of the intelligence index.
>
> Markdown copy of [https://pydantic.dev/models/benchmarks/code_review/](https://pydantic.dev/models/benchmarks/code_review/). Index for agents: [llms.txt](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: `GET https://pydantic.dev/models/api/select?description=<what the agent does>`. It returns up to five ranked models with reasons; POST a JSON body instead to send code. Format: [select.md](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: [usage.md](https://pydantic.dev/models/usage.md)

Code review measures whether a model can spot real defects in one function of production code without flagging clean code, by answering one yes/no question per kind of defect.

- **Created by:** [Pydantic](https://pydantic.dev)
- **All Pydantic AI decision benchmarks:** [/models/benchmarks/pydantic_ai_decision/](/models/benchmarks/pydantic_ai_decision/)
- **Decision models:** [/models/list/?kind=decision](/models/list/?kind=decision)
- **Scores from:** [Pydantic (CC BY 4.0)](/models/benchmarks/code_review/), results updated 2026-12-05

## Description

The model reads one Python, TypeScript or Rust function, with the class or `impl` header around it and the signatures of what it calls from the same file, and answers 17 or 18 yes/no questions. The 13 or 14 about bugs are scored: a wrong boundary, the wrong variable, an inverted condition, an input the contract allows but the code does not handle, a swallowed error, skipped cleanup, a half-finished update, a lookup that can fail, a false assertion (`unwrap`, `!`, `as`), a numeric hazard, an unexpected mutation, an async hazard, untrusted input and repeated work (not every question applies to every language). The rest, about docstrings, naming and Rust's `unsafe`, are asked but not scored.
Checks a linter or type checker already makes are left out.
This is the job of a cheap first pass over every function in a codebase, before a person or a larger model looks at what it flags.

The functions come from four codebases: [Pydantic](https://github.com/pydantic/pydantic) and [Monty](https://github.com/pydantic/monty), which are open source, and two private ones.
There are two kinds of case:

- **Defects to catch.** 354 functions with one defect injected by Claude Sonnet 5.5, each checked to be real and visible from the function alone, and 11 functions with a bug found in the code as it is. A defect is caught by a yes to any question it fits, since one defect can fit two (an inverted comparison at a boundary is both a wrong condition and a wrong boundary).
- **Clean functions to pass.** 989 functions with no bug. A function is passed only by a no to every scored question.

Every label was checked by Claude agents that read the whole file and its callers at a pinned commit: Claude Sonnet 5.5 judged each case, and Claude Opus 5.5 tried to disprove every bug it found and gave a second opinion on every borderline call.
The clean functions were drawn from 20,000 sampled functions in proportion to how many decision models had flagged each, and are weighted back, so the pass rate stands for all 20,000.

The score is the mean of the share of defects caught and the share of clean functions passed, so a model that answers no to everything scores 50 and one that flags everything scores 50.
The source code is not published: this page shows scores, costs and times only.

### Caveats

- Most of the defects are injected, not found in the wild. Real bugs of these kinds are rare: about 1 in 100 functions in this code had one, too few to score on alone.
- The labels are Claude's judgement, checked twice, not a person's. A borderline defect (judged minor) counts neither way.
- One run per model. A difference of 3 points or less between two models is within the noise of 365 defects and 989 clean functions.
- 77% of the clean functions and 67% of the defects are from the private codebases, so the open source code, which a model may have seen in training, is a minority of the cases.
- Decision models were called on their vendor's own API where we have a key, and otherwise on OpenRouter's decisions endpoint, whose time is then part of the model time shown.

## Results

The best result per model, with the reasoning setting it was run at where the source gives one. Blended price is US dollars per million tokens, three input to one output, from the provider the model's page leads with.

| Rank | Model                                                                                | Setting | Score | Cost per case | Model time per case | Blended price |
| ---- | ------------------------------------------------------------------------------------ | ------- | ----- | ------------- | ------------------- | ------------- |
| 1    | [d1.3-ultra](https://pydantic.dev/models/list/liquid-d1.3-ultra.md)                  | –       | 83.2% | $0.00017      | 0.5 s               | $0.032        |
| 2    | [Decider V1.3](https://pydantic.dev/models/list/pplx-decider-v1.3.md)                | –       | 78.0% | $0.00         | 0.5 s               | $0.015        |
| 3    | [Decider V1.2](https://pydantic.dev/models/list/pplx-decider-v1.2.md)                | –       | 77.8% | $0.000081     | 0.5 s               | $0.015        |
| 4    | [d1-ultra](https://pydantic.dev/models/list/liquid-d1-ultra.md)                      | –       | 77.3% | $0.00017      | 0.3 s               | $0.032        |
| 5    | [d1.2-ultra](https://pydantic.dev/models/list/liquid-d1.2-ultra.md)                  | –       | 76.7% | $0.00017      | 0.4 s               | $0.032        |
| 6    | [Gemini Decision 1](https://pydantic.dev/models/list/gemini-decision-1.md)           | –       | 76.3% | $0.00044      | 0.4 s               | $0.075        |
| 7    | [GPT-6 Luna Decisions](https://pydantic.dev/models/list/gpt-6-luna-decisions.md)     | –       | 75.2% | $0.00061      | 0.5 s               | $0.075        |
| 8    | [Microsoft-Decision-1.1](https://pydantic.dev/models/list/microsoft-decision-1.1.md) | –       | 74.5% | $0.00016      | 0.4 s               | $0.032        |
| 9    | [d1.2](https://pydantic.dev/models/list/liquid-d1.2.md)                              | –       | 71.5% | $0.000081     | 0.3 s               | $0.015        |
| 10   | [Jev 1.14](https://pydantic.dev/models/list/jev-1.14.md)                             | –       | 69.8% | $0.00018      | 0.2 s               | $0.032        |
| 11   | [Clef](https://pydantic.dev/models/list/clef.md)                                     | –       | 69.1% | $0.0012       | 0.7 s               | $0.18         |
| 12   | [Jev 1.13](https://pydantic.dev/models/list/jev-1.13.md)                             | –       | 68.5% | $0.00018      | 0.2 s               | $0.032        |
| 13   | [Decider Flash V1.2](https://pydantic.dev/models/list/pplx-decider-flash-v1.2.md)    | –       | 64.0% | $0.000041     | 0.5 s               | $0.007        |
| 14   | [Microsoft-Decision-1](https://pydantic.dev/models/list/microsoft-decision-1.md)     | –       | 63.4% | $0.00016      | 0.5 s               | $0.032        |
| 14   | [Decider Flash V1.3](https://pydantic.dev/models/list/pplx-decider-flash-v1.3.md)    | –       | 63.4% | $0.00         | 0.2 s               | $0.007        |
| 16   | [Clef Omni](https://pydantic.dev/models/list/clef-omni.md)                           | –       | 62.1% | $0.00073      | 0.3 s               | $0.11         |
| 17   | [Clef-flash](https://pydantic.dev/models/list/clef-flash.md)                         | –       | 56.3% | $0.00019      | 0.7 s               | $0.029        |
