← Wiki

DeepEval — pytest-native LLM evaluation framework

A different category from Langfuse / Arize Phoenix. Those are observability platforms — they tell you what happened. DeepEval is an evaluation framework — it tells you whether the answer was good, and fails the test if it wasn’t. The mental model is pytest, not Datadog: assertions in CI, not dashboards on a screen.

Built by Confident AI, Apache-2.0. The marketing claim — 100M+ daily evals, 150K+ developers, >50% of Fortune 500 — is unusually high for an OSS eval lib and signals that the category itself has crossed into mainstream CI/CD practice. 250+ GitHub contributors. The OSS framework is the engine; Confident AI is the cloud platform on top (regression testing, experimentation, tracing, production monitoring).

The shape of an LLM test

from deepeval import assert_test
from deepeval.test_case import LLMTestCase
from deepeval.metrics import AnswerRelevancyMetric, FaithfulnessMetric

def test_rag_pipeline():
    test_case = LLMTestCase(
        input="What's our refund policy?",
        actual_output=agent.run("What's our refund policy?"),
        retrieval_context=docs,
        expected_output="14-day return window with original packaging",
    )
    assert_test(test_case, [
        AnswerRelevancyMetric(threshold=0.7),
        FaithfulnessMetric(threshold=0.8),
    ])

LLMTestCase is a typed dataclass. Metrics return scores + reasoning. assert_test raises on threshold breach — same contract as a normal pytest assertion. Run via deepeval test run or stock pytest.

Three evaluation techniques

50+ metrics ship out of the box: hallucination, faithfulness, answer relevancy, contextual precision/recall/relevancy, toxicity, bias, summarization, task completeness, role adherence, knowledge retention. RAGAS metrics are first-class.

Where it sits in the agent stack

Observability + evals + benchmarks form a three-layer measurement stack — they don’t compete, they answer different questions:

Layer Question Tools
Observability What happened on this request? Arize Phoenix, Langfuse, OpenTelemetry
Evaluation Was the answer good? Did anything regress? DeepEval, RAGAS, OpenAI Evals
Benchmark How does my agent rank on a public, fixed task set? SWE-bench, PAC-1, BitGN ECOM, LongMemEval

DeepEval is also explicitly positioning itself as the eval harness for coding agents — Cursor, Claude Code — capturing full execution traces and grading at the span level. That makes it adjacent to harness engineering’s third component (feedback loops): evals are the architectural constraint for behavior, the way ArchUnit is the architectural constraint for code structure.

Connections

Source

Sources

Related