Topic 2 of 5 · 4 min read
Open-source eval frameworks compared
Goal: Pick the open-source eval framework that fits a given task and read its basic config.
Match the framework to the shape of your work: promptfoo for prompt and model comparisons in CI, Inspect for agent tasks with sandboxes, DeepEval for pytest-style tests, and Ragas for retrieval pipelines. They overlap, but each has a centre of gravity.
Check yourself · 1 of 3
A team wants to run the same 100 cases against three models on every pull request and see a comparison table. Which fits best?
Why it matters
Picking by popularity leads to fighting the tool. A config-driven tool is awkward for a multi-step coding agent. A sandbox framework is heavy for a prompt tweak.
The four, in short
- promptfoo. You write a YAML file with prompts, providers and test cases with assertions. It runs the matrix of prompts and models, shows a comparison table and fits into CI. It is good for "which prompt or model is better on these cases".
- Inspect. From the UK AI Security Institute. A task is a dataset, a solver (the steps the model takes, including tool calls) and a scorer. It supports sandboxed execution, so an agent can run code safely during the eval. It suits agents and capability tests.
- DeepEval. Python tests that look like pytest. You build a test case with input, actual output and expected output, then assert a metric passes a threshold. It fits teams that already run pytest in CI.
- Ragas. Metrics for retrieval-augmented generation, such as whether the retrieved context supports the answer, and tools to generate test sets from documents.
Reading a config
A promptfoo file has three parts: what to run, which models, and what must be true.
prompts:
- "Classify this ticket as billing, bug or other: {{text}}"
providers:
- openai:chat:gpt-5.6
- anthropic:messages:claude-sonnet-5
tests:
- vars: { text: "I was charged twice this month" }
assert:
- type: equals
value: billing
Before and after
Before: a team writes its own harness to compare two prompts on three models, and a month later is maintaining caching and a results viewer. After: the same comparison is 15 lines of YAML, run in CI on each pull request, and the harness code is deleted.
What goes wrong
- Wrong centre of gravity. Forcing a tool-using agent into a single-prompt config.
- Defaults treated as design. Built-in assertions and metrics get used because they exist, not because they match your failure modes.
- Version drift. These projects change quickly. Pin the version and read the current docs before copying an old tutorial.
- Tool chosen, dataset skipped. All four need your own cases.
Examples
Reading the promptfoo file
The config runs one prompt against two providers on one test. equals is a code grader: the output must be exactly billing. Add more rows under tests and the same file compares every provider on every case, with a table of passes and failures per cell.
Key points
- promptfoo is config-driven and suits prompt and model comparisons in CI.
- Inspect models a task as dataset, solver and scorer, and supports sandboxes for agent evals.
- DeepEval writes LLM checks as pytest-style tests with metric thresholds.
- Ragas targets retrieval-augmented generation with context-based metrics.
- Pin the framework version and read current docs, because these projects change quickly.
Common mistakes
- Choosing a framework by popularity instead of the shape of the task.
- Using a built-in assertion or metric just because it ships with the tool.
- Copying an old tutorial against a newer version without checking the docs.
- Expecting any framework to supply the dataset.
Check yourself · 2 of 3
Which framework models an eval as a dataset, a solver and a scorer, with sandboxed tool use?
Check yourself · 3 of 3
A team already runs pytest in CI and wants LLM checks to fail the build like any test. What is the closest fit?
Practice items, not counted towards your mastery.
Start here
- Your AI product needs evals (Hamel Husain) (opens in a new tab)ArticleFree
Why error analysis and your own checks beat generic metrics, and how to start with simple tooling.
- Promptfoo introduction (opens in a new tab)ToolFree
Config-driven prompt tests: providers, test cases and assertions in one YAML file, runnable in CI.
- Inspect: open-source framework for LLM evaluations (UK AISI) (opens in a new tab)ToolFree
Tasks, solvers, scorers and sandboxed agent evals from the UK AI Security Institute.
More for this topic
- DeepEval documentation (opens in a new tab)ToolFree
Pytest-style LLM tests with built-in metrics, and how to write a custom one.