DeepEval: An Open-Source LLM Evaluation Framework, Explained
DeepEval is a local-first, open-source framework for testing LLM applications with Pytest-style assertions and more than 50 metrics. This guide explains its three evaluation modes, metric families, relationship to Confident AI, a working first test, CI/CD use and the limits the official docs state.
View 2 referencesAllow the functional cookie to save your likes. Privacy details
What is DeepEval?
DeepEval is an open-source, local-first evaluation framework for LLM applications. It lets you unit-test model outputs with Pytest-style assertions, score traces and agent trajectories with more than 50 metrics, and gate releases on regression tests. It runs in your environment and supports both Python and TypeScript.
The framework targets AI agents, voice agents, multi-turn chatbots, RAG pipelines, MCP systems, prompts and end-to-end LLM workflows. It supports component-level scoring and system-level scoring, and it can generate synthetic datasets for edge cases that are hard to collect manually. DeepEval runs in your own environment; you only need a provider key such as OPENAI_API_KEY for metrics that use an LLM judge. An account is required only if you want to send traces or results to Confident AI. The project ships in both Python and TypeScript. Official introduction
What metrics does DeepEval provide?
DeepEval ships more than 50 metrics across general-purpose, agentic, RAG, multi-turn, MCP, multimodal and safety categories. The design goal is that you can start with a built-in metric and replace it with a custom one without changing your evaluation harness.
| Category | Examples from the docs |
|---|---|
| General purpose | G-Eval, JevEval, DAG, answer relevancy, hallucination, summarization, bias, toxicity, JSON correctness, prompt alignment |
| Agentic | Task completion, tool correctness, goal accuracy, step efficiency, plan adherence, plan quality, argument correctness |
| RAG | Faithfulness, contextual recall, contextual precision, contextual relevancy, RAGAS |
| Multi-turn | Knowledge retention, conversation completeness, turn relevancy, turn faithfulness, role adherence |
| MCP | MCP task completion, MCP use, multi-turn MCP use |
| Multimodal | Text to image, image editing, image coherence, image helpfulness, image reference |
| Safety | Red teaming is built into the framework |
G-Eval is a research-backed LLM-as-a-judge metric for arbitrary custom criteria. JevEval uses Jev, a System One model that answers with calibrated probabilities rather than generated text. You can also define your own metrics and have them integrated into the DeepEval ecosystem. Metric list
What are the three evaluation modes in DeepEval?
DeepEval offers end-to-end, component-level and trajectory-based evaluation, and you can combine all three. End-to-end treats the app as a black box; component-level scores individual spans; trajectory-based scores the whole execution chain. A useful sequence is to score the result, then the trajectory, then the failing span.
- End-to-end treats your application as a black box. You supply inputs, outputs, expected behavior and metrics. It suits raw LLM APIs, simple apps, chatbots and black-box regression checks.
- Component-level traces your app and scores individual spans, tools, planners, retrievers, generators or sub-agent handoffs. It suits agents and MCP systems where one bad step explains a bad result.
- Trajectory-based scores the complete chain of plans, model calls, tools and handoffs as one trajectory. It suits long-horizon agents whose execution path affects quality.
A productive pattern is to score the black-box result first, then the full trajectory, then individual spans to locate the failing step. Voice-native evaluation is a separate capability: it scores the call audio itself, so you can test how a voice agent sounded and when it spoke, not just what the transcript said. Evaluation modes
How is DeepEval different from Confident AI?
DeepEval is the open-source evaluation framework that runs locally before you ship. Confident AI is the monitoring platform for production traces: it surfaces failing traces before anyone has written an eval for them, clusters them into failure modes, and turns them into your next eval.
This split explains a common point of confusion. DeepEval does not require an account, and it runs in your own environment. Confident AI adds collaboration, observability and managed production workflows. The two are designed to connect, not to compete: a failing production trace in Confident AI becomes a test case in DeepEval.
DeepEval also differs from observability tools. Observability helps you inspect what happened; DeepEval decides whether behavior is good enough by running metrics against test cases, traces, spans and datasets. You can use both together. On privacy, DeepEval states that its OpenTelemetry instrumentation collects only the names of the metrics that ran, not prompts, inputs, outputs or evaluation data. FAQ
How do you write your first DeepEval test?
A first DeepEval test needs only a test case and a metric. The example scores one answer for answer relevancy with a 0.7 threshold and requires no account, though LLM-judge metrics need a provider key. The core building blocks are test cases, datasets, metrics and traces.
from deepeval import assert_test
from deepeval.test_case import LLMTestCase
from deepeval.metrics import AnswerRelevancyMetric
test_case = LLMTestCase(
input="What is the capital of Japan?",
actual_output="The capital of Japan is Tokyo.",
)
metric = AnswerRelevancyMetric(threshold=0.7)
assert_test(test_case, [metric])
The core building blocks are test cases, datasets, metrics and traces. A test case is one behavior: task input, agent output, expected behavior, tools, context and metadata. A dataset is a collection of goldens that makes evals repeatable across prompts, models and releases. A trace is the runtime record of your agent's steps, spans, inputs, outputs and tool calls.
For applications built with other frameworks, DeepEval offers drop-in integrations: replacing from openai import OpenAI with from deepeval.openai import OpenAI turns each chat completion call into an LLM span, and LangGraph, Pydantic AI and other adapters expose similar hooks. Component-level docs
Can you run DeepEval in CI/CD?
Yes. DeepEval is built to run with pytest and CI providers, so you can gate changes on LLM regression tests. The CLI exposes a deepeval test run command, and datasets let the same goldens run on every commit. Judge metrics need a provider key in CI, which adds cost and a dependency.
A practical CI setup keeps LLM-judge metrics on the important cases and uses cheaper statistical or local NLP metrics for broad sweeps. Metrics that use an LLM judge need a provider key in the CI environment, which is a cost and a dependency you should budget for. Because evaluations run locally, your prompts and outputs do not leave your environment unless you explicitly send them to Confident AI.
What are the limits of DeepEval?
DeepEval measures outputs against metrics you choose; it does not decide which behaviors matter for your product. A passing suite is evidence about the cases you encoded, not proof of production safety. LLM judges carry bias and cost, synthetic data can over-represent easy patterns, and a large metric catalog invites over-measurement.
Three limitations deserve attention. LLM-as-a-judge metrics inherit the judge's biases and cost, so threshold choices need calibration against human review. Synthetic datasets are useful for edge cases but can over-represent patterns the generator finds easy. And the framework's breadth, more than 50 metrics and three evaluation modes, means a team can spend significant effort on measurement infrastructure before improving the underlying system. The docs are candid that DeepEval and observability tools answer different questions; using one as a substitute for the other is a category error.
Frequently asked questions about DeepEval
These questions cover the practical checks before adopting DeepEval: licensing and cost, model compatibility, the distinction between metrics and test cases, voice-agent support, and what its telemetry collects. Answers come from the official documentation and FAQ, not from third-party summaries.
Is DeepEval free and open source?
Yes. DeepEval is an open-source framework that runs locally without an account. You pay only for external services you choose to use, such as an LLM provider for judge metrics or Confident AI for monitoring.
Does DeepEval only work with OpenAI models?
No. The framework is model-agnostic. As long as you can plug your application's outputs into the evaluation flow, you can use any provider or framework.
What is the difference between a metric and a test case?
A test case describes one behavior: input, output, expected behavior and context. A metric is the scoring logic that decides whether that behavior satisfies your criteria. You attach metrics to test cases or traces.
Can DeepEval evaluate voice agents?
Yes. Alongside transcript-based checks, DeepEval runs voice-native evaluations that score the call audio itself, covering how the agent sounded and when it spoke.
Does DeepEval collect my prompts through telemetry?
DeepEval states that its OpenTelemetry instrumentation collects only the names of metrics that were run. It does not collect prompts, inputs, outputs or evaluation data through that instrumentation.
Bottom line
DeepEval is most valuable when you treat it as a test harness rather than a scoreboard. Start with one end-to-end metric on a small golden set, add component-level tracing when a failure needs localization, and only then consider trajectory scoring. The framework is mature enough that the main risk is not capability but over-measurement: pick metrics that map to a decision you will actually make.