confident-ai/deepeval
The LLM Evaluation Framework
DeepEval is an open-source framework for testing and evaluating large language model (LLM) applications. Think of it as a testing tool similar to Pytest, but specifically designed for LLM-based systems like chatbots, AI agents, and RAG pipelines.
What it does:
- Lets you write test cases that check if your LLM app behaves correctly, using metrics like answer relevancy, hallucination detection, task completion, and many more.
- These metrics can be powered by any LLM (as a judge), statistical methods, or local NLP models that run on your machine.
- You can evaluate your app end-to-end (as a black box), trace an AI agent's full decision path, or test individual steps like tool calls or retrieval.
Key features:
- Wide range of ready-made metrics covering AI agents, voice agents, multi-turn conversations, RAG (retrieval-augmented generation), MCP (model context protocol), multimodal (text-to-image, image editing), and general safety (bias, toxicity, hallucination).
- Custom metrics – build your own and they integrate automatically.
- Synthetic data generation – create single- and multi-turn datasets, and simulate voice calls.
- CI/CD integration – plug into any continuous integration pipeline.
- Prompt optimization – automatically improve prompts based on evaluation results.
- Benchmarking – test any LLM on popular benchmarks like MMLU, GSM8K, and HumanEval in under 10 lines of code.
How it works:
- You write a test case with an input, the actual output from your app, and an expected output.
- You attach one or more metrics (e.g., G-Eval for correctness) and set a pass/fail threshold.
- Run tests via the CLI command
deepeval test run. - All metrics score from 0 to 1, and the threshold decides if the test passes.
Integrations:
- Works with many LLM frameworks: LangChain, LangGraph, OpenAI, Anthropic, CrewAI, LlamaIndex, and more.
- Also connects to voice agent platforms like Vapi, ElevenLabs, LiveKit, and Pipecat.
- The companion platform Confident AI provides production monitoring, clustering failing traces, and turning them into new evals.
Getting started:
- Requires Python 3.10+.
- Install with
pip install -U deepeval. - Optionally log in to the free cloud platform for shareable reports.
- Write a test file, set your LLM API key, and run
deepeval test run.
DeepEval is designed to help you improve AI quality, prevent prompt drift, and confidently switch between models or architectures.
Related
- Project
- Dispatch
- Project
- Project
- Project