confident-ai/deepeval
Python and pytest-based regression testing for LLM outputs and agent traces
Automated SPDX check for reference only — not legal advice. Disclaimer
GitHub Star History
Full-history star trajectory from GitHub official history. Switch ranges or hover any point for exact counts.
Evidence-Backed Technical Brief
AI Deep ReviewArchitecture & Core Mechanics
DeepEval is a Python evaluation harness, not an inference server or a fixed benchmark. For black-box testing, an application supplies its output in an LLMTestCase, and assert_test applies metric thresholds. For an instrumented run, evals_iterator() feeds dataset goldens through the application; @observe() and update_current_span() attach component-level test data to spans, while trace(metrics=[...]) can score the ordered execution path as a whole.
Poetry registers the Typer-based CLI at deepeval.cli.main:app and the pytest plugin at deepeval.plugins.plugin. The manifest includes pytest-xdist, pytest-asyncio, aiohttp, and opentelemetry-api. Integration hooks differ by stack: LangChain and LangGraph use a callback handler, while the OpenAI and Anthropic examples wrap their clients. The separate typescript/ tree is excluded from the Python package.
Key Capabilities & Differentiators
DeepEval can test a final response, a complete agent trajectory, or an individual retrieval, model, tool, or handoff step. G-Eval lets teams specify a scoring rubric and the case fields the judge can see; the correctness example compares actual and expected output on a 0–1 scale, then applies a threshold of 0.5. Ready-made metrics cover answer relevancy, hallucination, task completion, tool and argument correctness, and plan adherence.
The scoring options include custom LLM judges, statistical methods, and locally runnable NLP models. DAG gives LLM judging a graph-structured decision path, while JevEval scores closed-ended judgments with probabilities rather than generated verdict text. Voice integrations can exercise a live interaction: the Vapi and Pipecat connectors use WebSocket, and the LiveKit connector exchanges audio over WebRTC.
Trade-offs & Limitations
DeepEval is a good fit when evaluation policy should live alongside application code as versioned test cases, rubrics, and thresholds. For teams considering LangSmith primarily for shared production trace analysis, compare that workflow separately with DeepEval's optional Confident AI integration for monitoring and annotation. The standalone Apache-2.0 package can run without an account; it is not a self-hosted copy of the hosted platform.
Trace-level checks can distinguish an incorrect tool call from an answer that merely sounds wrong, but useful traces require consistent spans and case fields. LLM judge scores can move when the judge model or rubric changes, and API-backed scoring adds request cost and rate-limit exposure. Before enforcing thresholds in CI, pin the judge configuration where possible and calibrate it against human-reviewed cases. For local scorers, memory and throughput depend on model choice and concurrency.
Hardware & Deployment Guide
The Python manifest targets >=3.10, <4.0. Install with pip install -U deepeval for a trial; in CI, pin the version you validated and run deepeval test run test_ai_agent.py or the corresponding suite. The default quickstart uses OPENAI_API_KEY; a custom judge is also supported. Using a local metric does not make the whole run offline if the application, judge, or voice connector still calls a remote service. Treat deepeval login as a separate decision: the cloud reporting flow can upload test cases.
The release tags distinguish Python (python-v4.2.4, which introduces Jev), TypeScript (typescript-v0.9.13, which standardizes score direction to higher-is-better), and setup (setup-v0.1.0). The Poetry snapshot lists 4.3.7, which differs from the listed Python release tag. Confirm the installed version and its metric behavior before using its scores as a release gate.
deepeval CLI at deepeval.cli.main:app and the pytest plugin at deepeval.plugins.plugin.assert_test applies metric thresholds to LLMTestCase objects; G-Eval supports custom criteria and explicit input fields.evals_iterator() replays dataset goldens, while @observe() and update_current_span() attach component evidence for scoring.Teams adding CI regression checks for RAG, chat, or agents that need to score both final outputs and the retrieval or tool steps behind them.
You need a fixed model leaderboard, an inference server, or a self-hosted production monitoring and annotation platform rather than an evaluation library.
Quick Start & Installation
pip install -U deepeval
AI Context Briefing (for Claude / Cursor / Windsurf)
Standardized architecture summary & quickstart commands ready to paste into coding agents.
curl -sL https://repoforai.com/repo/confident-ai/deepeval.md
Active README embeds unlock Hot-Tier 6h Telemetry Refresh automatically (zero pay-to-rank).
Frequently Asked Questions about deepeval
Do I have to instrument my application to start testing it?
LLMTestCase with the input and output, add an expected output if your metric needs it, and call assert_test. Add @observe() and span-level test data for component evaluation, or use an available framework integration when you need the full sequence of model calls, tool calls, and other steps.Do I need a GPU, and what drives evaluation overhead?
Can we use DeepEval commercially and run it on our own infrastructure?
When is DeepEval a better starting point than LangSmith?
Upstream README & Documentation
This profile focuses on independent engineering analysis and live telemetry. Read the full upstream README, changelog, and examples directly on GitHub.
Top 10 Breakout Open-Source AI Repos, Every Thursday
Signal-only digest of fast-growing AI repos, SPDX license alerts, and architecture picks. Zero spam.
Zero spam · 1-click unsubscribe · Privacy Policy