Model or dataset
confident-ai/deepeval avatar
confident-ai/deepeval

DeepEval: LLM Evaluation as Pytest-Style Unit Testing

The LLM Evaluation Framework

18,279 stars1,932 forksPythonApache-2.0

At a glance

What is it?
DeepEval turns LLM evaluation into something closer to a test suite than a dashboard, running research-backed metrics locally against any model. The trade-off is that its metric surface is wide, its documentation is the real product, and the hosted Confident AI platform sits one click away.
Who is it for?
Adopt DeepEval if you already think in test cases and want evaluation to live in the same repository as your prompts and retrieval code, and if you are willing to read the docs site rather than the README before committing. Do not adopt it if you need a hosted comparison dashboard with no local infrastructure, since that is the Confident AI platform, not the library.
Can I use it commercially?
Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 1 day ago.
What is it written in?
Mainly Python, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on September 15, 2026, and from our analysis. They are not legal advice.

DEEP OPEN-SOURCE ANALYSIS

The gap DeepEval is built to fill

Teams shipping LLM features have a testing problem that ordinary unit tests do not cover. A function that returns a string either matches the assertion or it does not, and that binary is useless when the output is a paragraph. DeepEval's answer is to keep the ergonomics of a test runner and swap the assertion for a scored judgement. The README describes it as "similar to Pytest but specialized for unit testing LLM apps", and that framing is the whole pitch. The intended user is someone building an AI agent, a RAG pipeline, or a chatbot, possibly through LangChain or the OpenAI SDK, who wants to know whether a change to a prompt or a retrieval step made quality worse. The README lists three levels of granularity: the app end to end as a black box, a complete agent trajectory across decisions and actions, and individual agent steps such as LLM calls, tool use, retrieval, and sub-agent handoffs. That third level is where the project differs from a generic text-similarity checker. Evaluating a single tool call is a different problem from evaluating a final answer, and DeepEval treats them as separate metric families rather than one score with a threshold.

How the judging actually works

Two mechanisms are named in the README. The first is LLM-as-a-judge, where a model you supply scores an output against criteria. The second is classical NLP and statistical methods. The README states that metrics run "locally on your machine", which is a claim about where the scoring code executes, not about where the judge model lives. If you point the judge at a hosted API, your data leaves your machine; the local part is the framework, not necessarily the inference. G-Eval is the general-purpose entry, described as research-backed and able to evaluate against custom criteria. DAG is the more interesting design: a graph-based deterministic builder for LLM-as-a-judge metrics, which implies you compose a judging flow rather than write one prompt and hope. The metric list is organised by artifact type. Agentic metrics cover task completion, tool correctness, goal accuracy, step efficiency, plan adherence, plan quality, tool use, and argument correctness. RAG metrics cover answer relevancy, faithfulness, contextual recall, contextual precision, contextual relevancy, and a RAGAS composite. The naming is not decorative: contextual precision asks whether relevant nodes are ranked higher in the retrieval context, which is a ranking question, while faithfulness asks whether the output factually aligns with that context, which is an entailment question. Choosing between them is a decision about what you are willing to fix.

Getting it running and what you configure

The README's own quickstart section is a pointer to the documentation site rather than an inline code block, so the exact constructor calls are not in the material I have. What is confirmed: the package is Python, published on the default branch main, with a Python release line at 4.2.0 as of August 2026, and a parallel TypeScript line at 0.9.13. The Colab badge in the README points at a runnable notebook, which is the fastest way to see the API surface without installing anything. The configuration shape you should expect from the README's wording: you pick a metric, you supply the artifact under test, and you supply the judge LLM, since the metrics are "powered by ANY LLM of your choice". That last phrase is the practical configuration decision. The judge model determines cost per evaluation, latency, and how much you trust the score. Because I have not run this, I will not quote import paths or class names beyond those the README itself uses. Verify the install command and the test-case class names on deepeval.com/docs/getting-started before you write a single assertion.

The judge model is a dependency you now own

The largest limitation is structural and the README does not dwell on it. An LLM-as-a-judge metric is only as stable as the model doing the judging. If your judge is a hosted model behind an API, your test suite now depends on a third party's uptime, pricing, and silent model updates. A score that drifts because the judge changed is indistinguishable from a score that drifted because your prompt changed, unless you pin the judge and record which version produced each result. The README does not describe a judge-versioning mechanism in the material I have, so treat this as something to confirm rather than assume. The second limitation is cost and time. Every evaluation that routes through an LLM is a generation, and an agent trajectory with many steps multiplies that. Running a full metric suite on every commit is a different proposition from running it nightly. The third is interpretive: a metric like answer relevancy returns a number, and someone has to decide what number is acceptable. DeepEval gives you the measurement; it does not give you the threshold, and the README does not claim otherwise.

Where a plain assertion or Ragas fits better

If your evaluation target is deterministic, DeepEval is the wrong tool. Checking that a tool was called with a specific argument, that a JSON schema validates, or that a retrieval query hit a known document ID are all things a normal Pytest assertion does faster, cheaper, and without a judge model in the loop. Reach for DeepEval when the thing you are judging is genuinely a matter of degree. The more instructive comparison is with Ragas, whose metrics DeepEval re-exposes as a composite. Ragas is built around the retrieval-augmented generation pipeline specifically, with faithfulness and context relevance as its centre of gravity. DeepEval's approach is broader: the same framework covers agentic metrics like plan adherence and step efficiency, which are not RAG questions at all. The practical difference is scope of the abstraction. If your system is a RAG pipeline and nothing else, a RAG-focused library keeps the conceptual surface smaller. If you are shipping an agent that retrieves sometimes and calls tools other times, a framework that models both is worth the extra concepts. The README also positions DeepEval as a way to move from OpenAI to Claude with confidence, which is a model-swap use case rather than a RAG one.

Licence, releases, and the commercial boundary

The repository is Apache-2.0, which permits commercial use and modification, and the README links to a LICENSE.md at the repository root. That is the licence of the library. The README also promotes Confident AI as "the enterprise AI evals and observability platform", with a signup callout for comparing iterations, sharing evaluation reports, and monitoring in production. Those three capabilities are the ones the open-source library does not claim to provide. This is a normal open-core arrangement and worth naming plainly: the library evaluates, the platform stores, compares, and monitors. Nothing in the material suggests the library is crippled to force an upgrade, but if your requirement is a shared dashboard where a product manager can see week-over-week scores, you are evaluating the hosted product, not the Apache-2.0 package. On maintenance: the release cadence visible in the material shows a Python line at 4.2.0 and a TypeScript line at 0.9.13, both dated August 2026, with the last push to main in September 2026. The two version numbers moving independently is the thing to watch. A 0.x TypeScript line signals a less settled API than the 4.x Python line, so TypeScript users should expect more churn per upgrade.

What to verify before you commit a test suite to it

Start with the Colab notebook linked in the README, because it is the only runnable artifact in the material. Then answer four questions against the docs. First, which test-case type your artifact maps to: a black-box app evaluation, a full trajectory, or a single step. The agentic metrics only make sense if you are capturing step-level data, and if your agent does not emit that, several of the listed metrics are unavailable to you. Second, which judge model you will use and whether its cost per evaluation fits your CI budget. Third, whether your chosen metric requires retrieval context or an expected output, because faithfulness and contextual recall are not computable from an input and an output alone. Fourth, how you will pin the judge version, since a silently updated judge undermines the comparison you built the suite for. If you cannot answer the second and fourth, the suite will produce numbers you cannot act on. The library is the right shape for teams that already treat prompts and retrieval configuration as versioned code. It is the wrong shape for teams looking for a monitoring product with a user interface, and the README's own signup callout is the honest signal of where that line sits.

Editorial conclusion

Adopt DeepEval if you already think in test cases and want evaluation to live in the same repository as your prompts and retrieval code, and if you are willing to read the docs site rather than the README before committing. Do not adopt it if you need a hosted comparison dashboard with no local infrastructure, since that is the Confident AI platform, not the library. Before writing your first assertion, verify three things in the docs: which metric class matches your artifact (LLMTestCase versus the agent trajectory types), which model you will pass as the judge, and whether the metric you chose needs retrieval context or expected output to compute at all.

Official sources

  1. confident-ai/deepeval on GitHub
  2. License: Apache-2.0
  3. Project website
  4. README
  5. Releases
Community notes

Community notes