Code librariesReviewed · Pydantic

Pydantic Evals

Pydantic Evals is a Python library for developers who want to test and score AI applications, including language models and agents. You write evaluations in code, and the documentation compares the approach to unit testing. The main catch is that the overview page does not state a licence, version, supported Python versions or the cost of model-based judging. It organises evaluations as datasets of cases, a task to run and evaluators that score the results. Evaluators can be plain code checks, LLM judges, OpenTelemetry span checks or agent trajectory graders. Results print in a terminal, can be saved, or can be viewed in Pydantic Logfire.

Researched 14 Nov 2026

In short.

Pydantic Evals is a Python library for developers who want to test and score AI applications, including language models and agents. Its approach is similar to unit testing. Its main catch is that this overview page gives no licence, version, supported Python versions or pricing for model-based judging. According to the page, you define a Dataset of Cases, point an Experiment at a Task (a Python task function under test), and score outputs with Evaluators. The page lists deterministic checks, LLM-as-a-judge, custom evaluators, span-based evaluation over OpenTelemetry traces and agentic evaluators that grade a tool-call trajectory. It also describes online evaluation of sampled live traffic. The library installs with pip or uv, does not require pydantic-ai, and has an optional logfire extra. Nothing was run for this report.

Researched and written by an AI model and checked by a second AI model. How it works

The analysis covers the complete Pydantic Evals overview documentation page at [https://pydantic.dev/docs/ai/evals/evals/index.md], as captured on 14 November 2026. Pages it links to are excluded, including the Quick Start, Core Concepts, evaluator guides, online evaluation, how-to guides, examples and the API reference. The analysis does not draw on any licence file, package metadata, source repository or release information. No code from the page was installed or run, and the printed example output is the documentation's own.

The overview

What this resource is

The documentation page describes Pydantic Evals as an evaluation framework for systematically testing and evaluating AI systems, from simple LLM calls to complex multi-agent applications. It is distributed as a Python package named pydantic-evals. The page is the overview and index of the Pydantic Evals documentation, hosted at [https://pydantic.dev/docs/ai/evals/evals/index.md].

The resource is the library itself, so it is classed as a code library. The page is its entry-point documentation, not a standalone app or hosted service.

Overall assessment

On the evidence of this page, Pydantic Evals is a substantial, coherent library. The page has a clear data model, install instructions, examples that look runnable and a map of deeper guides. The library aims at a real problem: checking probabilistic AI behaviour repeatedly and systematically, not only by eye.

The page is an overview, so several claims cannot be judged from it. These include how good the LLM judge is, how the trajectory grading works in detail, how online evaluation is set up, and how the library behaves at scale. The licence, current version, supported Python versions and maintenance state are not on the page. Nothing was executed, so the examples are unverified here, although the page marks them as complete and runnable.

Who it is for

It is for Python developers building applications on LLMs or agents who want repeatable checks on those applications. The page compares the workflow to unit testing. Cases and evaluators are like individual tests, datasets are like test suites, and an experiment is like running pytest and reading the summary.

Beginners need to be comfortable writing Python functions and classes. The page describes a code-first approach and contrasts it with platforms that use web-based configuration. It does not say the library is for non-programmers. Experienced developers will care about the custom evaluator API, the OpenTelemetry span-based checks, concurrency controls and the Logfire integration. The page introduces those features, but their full details are on linked pages that this report does not cover.

What it can do

According to the page, the library can grade an agent's final outputs and its trajectory, meaning the sequence and arguments of its tool calls. It can run against datasets defined in code. Through online evaluation, it can also run against a sample of live production traffic.

Evaluators can be deterministic code checks, such as a regex on output format or a check for PII or sensitive data. They can also assess non-deterministic qualities such as accuracy, precision and recall, hallucinations or instruction-following. The page documents five evaluator families: built-in evaluators (exact match, and instance checks such as IsInstance), LLM as a judge, custom evaluators, span-based evaluation using OpenTelemetry traces, and agentic evaluators.

The page lists other features too. Datasets can be saved, loaded and generated, and cases and evaluators can be defined in YAML or JSON. There are concurrency and performance controls, retry strategies for transient failures, custom metrics and attributes, and per-case lifecycle hooks for setup, teardown and context enrichment. An evaluation returns a report object that you can print, serialise and store, or send to a notebook or other application. The page also says agents can be evaluated at batch prices by adding BatchModelRequests, so that concurrent cases share batches.

Using it

Requirements

The page shows installation with pip or uv, so you need a Python environment with one of those tools. The supported Python versions are not stated on the page.

pydantic-evals does not depend on pydantic-ai. What you evaluate is a Python task function, as in the page's examples. The page does not say which other frameworks or kinds of function are supported. The package has an optional dependency on logfire, installed with the logfire extra, for OpenTelemetry traces in evals or for sending results to Logfire.

If you use LLM-as-a-judge evaluators, you will need access to a model. The overview page does not say which providers or credentials are required, so check the linked LLM judge page. Operating system support, hardware needs and network needs are not stated.

How it works

The page describes a simple data model. A Dataset holds many Cases and can be used across many Experiments over time. An Experiment runs one Task against each Case and uses several Evaluators. Dataset-wide evaluators run on every case, and case-specific evaluators run only on their own case.

The flow has five steps. First you define cases and evaluators in YAML, JSON or Python. Then you call dataset.evaluate_sync(task_function). Each case is executed against the task, evaluators score each output, and the results are collected into a summary report. A Case holds a name, inputs, an optional expected output, optional metadata and optional case-specific evaluators.

An Evaluator receives a context object holding the output and the expected output, and it returns a score. The page's custom evaluator returns a float: 1.0 for an exact match, 0.8 if the expected text is contained in the output, and 0.0 otherwise. The page notes that scores for text outputs are likely to be qualitative or categorical, because AI systems are probabilistic.

Span-based evaluation uses OpenTelemetry traces, so assertions can check internal behaviour such as tool calls and execution flow. The page adds that this keeps eval assertions aligned with production telemetry. It does not explain how span capture is configured.

Setup

The page gives these install commands: pip install pydantic-evals, or uv add pydantic-evals. For OpenTelemetry traces or Logfire, it gives pip install 'pydantic-evals[logfire]', or uv add 'pydantic-evals[logfire]'.

After installing, the page's suggested path is to write a Dataset with Cases, optionally attach evaluators, define the function to test, and call evaluate_sync. For more detail, it points to a Quick Start at [https://pydantic.dev/docs/ai/evals/getting-started/quick-start/] and Core Concepts at [https://pydantic.dev/docs/ai/evals/getting-started/core-concepts/].

This page does not cover Logfire account setup, authentication or online evaluation configuration, so those steps are unknown here.

Worked example from the page

The page's complete example builds one Case named simple_case, with the input 'What is the capital of France?', the expected output 'Paris' and metadata {'difficulty': 'easy'}. It puts the case in a Dataset named capital_quiz with two dataset-wide evaluators: the built-in IsInstance(type_name='str') and a custom MyEvaluator class.

The task is an async function, guess_city, which simply returns 'Paris'. The call dataset.evaluate_sync(guess_city) runs it and returns an EvaluationReport. Then report.print(include_input=True, include_output=True, include_durations=False) prints a table with Case ID, Inputs, Outputs, Scores and Assertions columns. The page shows MyEvaluator scoring 1.00 and 100.0% of assertions passing.

The example only demonstrates the mechanics. The task is hard-coded and does not call a model. It was not run for this report, and the printed table is the documentation's own output, not a result we obtained. A real project would replace guess_city with a call into its own LLM or agent code.

Assessment & evidence

Limitations and cautions

This report covers one overview page. In its main text the page explains some features at overview level: trajectory grading (the sequence and arguments of an agent's tool calls), online evaluation against a sample of live production traffic, and Logfire as an observability layer where experiment results appear automatically for visualisation and comparison. Other features, including the LLM judge, span-based evaluators, concurrency, retries and lifecycle hooks, appear mainly as navigation entries with short descriptions. The linked pages that cover all of these in depth are excluded, so their detailed behaviour and configuration are unknown here.

The page itself warns that evals are an emerging art and science, and that anyone who claims to know exactly how evals should be defined can be ignored. It also says AI outputs are probabilistic, so scores for text are more open to interpretation than a simple pass or fail. This page does not establish the reliability, variability or bias of its LLM judges.

The example task is a hard-coded stub, so it shows no real model behaviour. The page gives no benchmarks, performance figures, scale limits or known issues. Nothing was installed or run.

Why these conclusions

The assessment rests on the page's own statements about purpose, its install commands, its data model and its three code examples: the Dataset and Case example, the custom evaluator example and the combined experiment example. The classification as a code library follows from the pip and uv install instructions and the Python API (Dataset, Case, Evaluator, evaluate_sync).

The audience conclusion follows from the code-first design, the unit-testing metaphor and the absence of any no-code interface on the page. Cost, licence and version are left unknown because the page says nothing about them. The report does not infer them from the package manager or the host.

Alternatives and comparisons

The page names no competing tools. It contrasts its code-first approach with platforms that use web-based configuration. It also uses pytest-style unit testing as a rough metaphor, while noting that AI evaluation differs because outputs are probabilistic.

Comparative suitability is unknown. The evidence has no comparison data, so this report does not assess how Pydantic Evals compares with other evaluation tools, plain test assertions or hosted platforms on features, accuracy, cost or ease of use.

Evidence base

The evidence is the full text of one documentation page on pydantic.dev: the Pydantic Evals overview at [https://pydantic.dev/docs/ai/evals/evals/index.md]. It contains the overview, design philosophy, navigation links, install commands and data model diagram. It also contains the Dataset and Case example, the evaluator examples and the combined experiment example with its printed output. The examples and their printed output are the documentation's own, and none were independently executed.

Linked pages are excluded, including the Quick Start, built-in evaluators, LLM judge, span-based, agentic, online evaluation and Logfire pages. What this report says about those topics comes from the overview page itself. Its main text gives overview-level explanations of trajectory grading, online evaluation and the Logfire integration, and its navigation list gives short descriptions of the other guides. Details that appear only on the linked pages are not covered.

Access & freshness

Costs

The page states no price for pydantic-evals and no pricing for Logfire, so both are unknown from this evidence. The package installs from a package index with pip or uv, but the page does not say it is free.

The page does say that classical code-based tests are cheaper and easier than tests that need human or machine review of model outputs. It also says that adding BatchModelRequests lets you evaluate an agent at batch prices, because concurrent cases share batches of model requests. It does not quantify the saving or say which providers support it.

This page does not say how many model requests LLM-as-a-judge evaluators make, what provider charges apply or what model-based judging costs. All three are unknown. Compute, token and time costs for large datasets or for online evaluation of live traffic are also not assessed.

Rights and licence

The page contains no licence text, copyright notice or terms of use, so the licence of the library and of its documentation is unknown from this evidence. Check the package's own licence file before using it in a commercial or redistributed product.

The page presents Logfire as a separate Pydantic product with its own web UI, and it does not cover Logfire's terms or data handling. If you send evaluation results, traces or samples of production traffic to Logfire, review those terms and your own data-protection obligations. The page does not describe data retention or privacy.

Freshness

The page text carries no publication date, last-updated date or version number. It was captured on 14 November 2026. Whether it matches the latest release of the package is unknown.

Release history and maintenance cadence are also unknown from this evidence. Re-read the live documentation and the package's release notes before relying on specific details.

Suggested next steps

Read the Quick Start and Core Concepts pages, then install pydantic-evals in an isolated environment. Start with a handful of real cases and deterministic evaluators such as IsInstance and exact-match checks, which the page describes as cheaper and easier than model-based review.

Add an LLM judge only for qualities that code checks cannot capture, and estimate the model cost first. If your agent uses tools, read the span-based and agentic evaluator pages to see whether trajectory checks fit. Before adopting the library in production, confirm the package licence, supported Python versions and Logfire terms. Treat all scores as signals to interpret, not as proof of correctness.

Evidence for this report

selected-page.txtselected · checked 2026-11-14