DeepEval
Pytest-style unit testing for LLM apps, scoring outputs with research-backed eval metrics.
- Source repo
- confident-ai/deepeval
- Stars
- ★ 19k
- Last updated
- 2d ago
- License
- Apache-2.0
- Primary language
- Python
- FA score
- 53/100 · Major gaps
At a glance
- How it runs
- Works with
- Universal · cross-platformOpenAI API · Claude API
- Cost
- Free software; you pay for model usage
- Setup effort
- Low · running in minutes
- You'll need
- Typical use
- Application teams adding regression tests for a support chatbot before each release, catching hallucinated answers
- Not a fit if
- Teams that want a GUI-driven evaluation workflow and no Python code
- Source review
- 53/100 · Major gaps 1 safety controls not found
What does this agent do, and when should you use it?
DeepEval is an open-source evaluation framework for large language model systems, designed to feel like Pytest but aimed at unit testing LLM applications. It ships a large library of metric classes — G-Eval, answer relevancy, hallucination, RAG metrics, agent trajectory metrics, multi-turn, voice, MCP and multimodal metrics — that score outputs from 0 to 1 using LLM-as-a-judge or local NLP models and always return an explanation. You can write a test_ai_agent.py and run it with deepeval test run, call evaluate() in a notebook, or use a metric standalone via measure(). It evaluates black-box end-to-end apps, full agent trajectories, and individual agent steps such as tool calls and retrieval, and can generate single- and multi-turn synthetic datasets. The framework plugs into any LLM backend and any CI/CD pipeline; an optional Confident AI platform hosts shareable reports and production monitoring.
A test target is an LLMTestCase holding fields like input, actual_output, expected_output and retrieval_context. The user picks a metric class (GEval, AnswerRelevancyMetric, TaskCompletionMetric, FaithfulnessMetric and many others), sets a threshold, and then calls assert_test(), evaluate([...], [...]) or metric.measure(test_case); the metric invokes the configured LLM or a local model and returns a 0-1 score plus a reason. For agents, tracing via the @observe() decorator or an integration (OpenAI, LangChain, LangGraph, CrewAI, LlamaIndex, Google ADK, Anthropic and more) captures the ordered sequence of decisions and tool calls, and dataset.evals_iterator(metrics=[...]) runs trajectory-level metrics over it. deepeval login uploads test runs to Confident AI for shareable reports, and the framework can also benchmark any LLM on MMLU, HellaSwag, DROP, BIG-Bench Hard, TruthfulQA, HumanEval and GSM8K in under ten lines of code.
- Application teams adding regression tests for a support chatbot before each release, catching hallucinated answers
- RAG engineers using Contextual Recall and Contextual Precision to isolate retrieval failures from generation failures
- Agent developers scoring multi-step tool-calling trajectories with TaskCompletionMetric and ToolCorrectness
- Multi-turn product teams validating long conversations with Knowledge Retention and Role Adherence
- Platform teams wiring
deepeval test runinto CI/CD as a gate so prompt edits cannot silently regress quality
How do you install or deploy this agent?
DeepEval requires Python>=3.9. Install with pip:
pip install -U deepevalModel-based metrics need a model API key, for example:
export OPENAI_API_KEY="..."At import time DeepEval auto-loads .env.local then .env from the working directory, with precedence process env > .env.local > .env; set DEEPEVAL_DISABLE_DOTENV=1 to opt out.
How do you use this agent?
Create a test file and write your first end-to-end test case:
import pytest
from deepeval import assert_test
from deepeval.metrics import GEval
from deepeval.test_case import LLMTestCase, SingleTurnParams
def test_case():
correctness_metric = GEval(
name="Correctness",
criteria="Determine if the 'actual output' is correct based on the 'expected output'.",
evaluation_params=[SingleTurnParams.ACTUAL_OUTPUT, SingleTurnParams.EXPECTED_OUTPUT],
threshold=0.5
)
test_case = LLMTestCase(
input="What if these shoes don't fit?",
actual_output="You have 30 days to get a full refund at no extra cost.",
expected_output="We offer a 30-day full refund at no extra costs.",
)
assert_test(test_case, [correctness_metric])Run it from the command line:
deepeval test run test_ai_agent.pyOr evaluate without Pytest, which suits notebooks:
from deepeval import evaluate
from deepeval.metrics import AnswerRelevancyMetric
from deepeval.test_case import LLMTestCase
answer_relevancy_metric = AnswerRelevancyMetric(threshold=0.7)
test_case = LLMTestCase(
input="What if these shoes don't fit?",
actual_output="We offer a 30-day full refund at no extra costs.",
retrieval_context=["All customers are eligible for a 30 day full refund at no extra costs."]
)
evaluate([test_case], [answer_relevancy_metric])For cloud reports, run deepeval login and paste the API key.
What are this agent's strengths and limitations?
- Broad metric coverage across agents, multi-turn chat, voice, RAG, MCP, multimodal and general cases, each returning a score with an explanation
- Pytest-compatible workflow means an existing Python test suite can add
deepeval test runas a CI gate with little rework - Model-agnostic: works with any LLM of your choice, statistical methods, or local NLP models that run on your machine
- Trajectory-level evaluation with @observe() and first-class integrations for LangChain, LangGraph, CrewAI, OpenAI Agents, LlamaIndex and others
- Can generate single- and multi-turn synthetic datasets and benchmark any LLM on MMLU, HumanEval and similar suites in under 10 lines
- LLM-as-a-judge metrics depend on an external model API, adding per-run cost and latency
- The large metric catalogue means you must pick the right metric for your scenario; a mismatched choice misleads quality decisions
- DAG custom metrics and Guardrails are still unchecked on the published roadmap
- Cloud reporting and production monitoring rely on the Confident AI platform, an unusable piece for strictly local teams
- Docs and examples are English-first; non-English projects must verify how judge models score the target language
How does this agent compare with similar options?
Key facts side by side with the most closely related agents.
| Agent | Source review | Form / cost | Stars | Updated | Language | Full support on |
|---|---|---|---|---|---|---|
| DeepEval This agent | 53 · Major gaps | CLIFree + model costs | ★ 19k | 2d ago | Python | OpenAI API · Claude API |
| AI Eval Skills | 52 · Major gaps | Agent plugin / skill | ★ 1.5k | 27d ago | — | — |
| Giskard | 47 · Major gaps | Library / SDKFree + model costs | ★ 5.9k | 1d ago | Python | OpenAI API · Claude API |
| Oumi | 58 · Major gaps | CLIFree + model costs | ★ 9.4k | today | Python | Claude Code · OpenAI API |
How does FollowAgents rate this agent?
Why each dimension lost points
Evidence shows the framework defaults to interacting with the Confident AI cloud via `deepeval login`, README states all test cases are automatically logged to the cloud, and pyproject depends on posthog telemetry; data-flow transparency is only a link to external docs with no in-repo privacy statement, so deducted. Dependency list uses many `*` wildcard versions (pytest, openai, aiohttp, jinja2, setuptools), so no known-vulnerability status can be statically confirmed; dependency_security scored 1. The CLI `--official` flag only warns and skips when no API key is present, a mild confirmation handling, but explicit user confirmation and rollback are absent, so rollback is 0. source_attribution has Apache-2.0 copyright and author info, scored 2.
The CLI command explicitly propagates pytest exit codes with clear comments on each code, giving good failure messages and self-consistency (2 each). However many dependencies are `*`, and the integrations group comment notes mistralai is quarantined on PyPI causing resolution failures, a real dependency-availability risk, scored 1.
README covers agents, multi-turn, voice, RAG, MCP, multimodal scenarios and many framework integrations, audience_and_scenarios scored 3. Capability boundaries list metrics but do not systematically state non-applicable cases, scored 2. Trigger precision relies on the pytest plugin and CLI flags, reasonably defined but boundaries undocumented, scored 2. Environment fit declares Python>=3.9 with some integrations limited to 3.10-3.14, partial coverage, scored 2.
README is well structured with complete install and quickstart and rich examples (examples_and_faq 3); license is full Apache-2.0 text (3). But there is no in-repo CHANGELOG, version only in pyproject (versioning_changelog 1); known_limitations barely mentioned (1); maintenance responsibility rests on an author email and external platform with unverified publisher identity, scored 1.
Outputs are metric scores with explanations, usable alongside pytest reports (2). As an evaluation framework it has clear marginal value (2). But cost involves LLM-as-a-judge external model calls, telemetry and a cloud platform, and the cost/benefit tradeoff is not explained in-repo, scored 1.
README makes many claims (human-like accuracy, local execution) without in-repo traceable benchmarks or citations, claim_traceability scored 1. Only README, LICENSE, pyproject and a few test files are present, limiting cross-source corroboration, scored 1. Fact and inference are not well separated, with marketing language mixed with facts, scored 1.
- Not found in source: rollback or recovery pathBack up first, or work on a git branch or snapshot, so its changes can be undone.
- Default login auto-logs test cases to the Confident AI cloud and includes posthog telemetry; confirm data privacy and opt-out before use.
- Dependency list uses many wildcard versions and the integrations group has PyPI-quarantine resolution risks; pin versions and scan for vulnerabilities before production use.
- README accuracy claims lack in-repo traceable benchmarks and should not be taken at face value.
- Publisher identity is unverified; maintenance responsibility and update path must be independently confirmed.
FAQ
Can I use it without Pytest?
deepeval test run, you can call evaluate([test_case], [metric]) directly or run metric.measure(test_case) and read score and reason, which fits notebook use.Is Confident AI login mandatory?
deepeval login adds cloud-hosted shareable reports and production monitoring; local evaluation only needs the package plus a model API key.Does it work without an OpenAI key?
Can it evaluate a full agent run, not just a final answer?
dataset.evals_iterator(metrics=[...]) with trajectory metrics such as TaskCompletionMetric over the whole path.Does it require my test data to leave my machine?
deepeval login.