api-evangelist/deepeval
GitHub: api-evangelist/deepeval
DeepEval 是一个类似 Pytest 的开源 LLM 评估框架,提供丰富的学术指标和基准测试能力,帮助团队系统性地测试和追踪大语言模型应用的质量回归。
Stars: 0 | Forks: 0
# DeepEval (deepeval)
DeepEval 是一个开源的 LLM 评估框架——由 Confident AI 构建和维护——用于测试和基准测试大型语言模型应用。它的结构类似于 Pytest,但专门针对 LLM 系统进行了优化,提供了 40 多种基于研究的指标,可以在本地针对任何 LLM 提供商运行。DeepEval 以 `deepeval` Python 包的形式发布在 PyPI 上,并附带了一个 `deepeval` 命令行工具。它与 pytest、LangChain、LangGraph、LlamaIndex、OpenAI Agents、CrewAI、Pydantic AI、AWS AgentCore、Google ADK 和 Strands 原生集成,并为 Confident AI 的商业评估、可观测性和红队评估平台提供支持。
**URL:** [访问 APIs.json](https://raw.githubusercontent.com/api-evangelist/deepeval/refs/heads/main/apis.yml)
**运行:** [使用 Naftiko 的功能](https://github.com/naftiko/fleet?utm_source=api-evangelist&utm_medium=readme&utm_campaign=opensource-api-evangelist&utm_content=repo)
## 标签
LLM 评估, LLM 测试, 评估框架, 评估指标, LLM 可观测性, LLM 作为评判者, G-Eval, RAG 评估, Agent 评估, 幻觉检测, 偏见检测, 毒性检测, 红队评估, 基准测试, MMLU, 合成数据生成, Prompt 优化, CI/CD, Pytest, Python, 开源, Apache 2.0, MCP
## 时间戳
- **创建时间:** 2026-05-25
- **修改时间:** 2026-05-25
## 项目概览
| 字段 | 值 |
|---|---|
| 项目 | [confident-ai/deepeval](https://github.com/confident-ai/deepeval) |
| 维护者 | [Confident AI](https://www.confident-ai.com) |
| 许可证 | Apache-2.0 |
| 语言 | Python |
| 最新版本 | v4.0.3 (2026年5月21日) |
| 安装 | `pip install -U deepeval` |
| GitHub 星标 | 15,600+ |
| 关联项目 | [confident-ai/deepteam](https://github.com/confident-ai/deepteam) — LLM 红队评估框架 |
## 安装与快速入门
```
pip install -U deepeval
# 可选:将本地 test runs 连接到 Confident AI cloud
deepeval login
# 运行 deepeval test suite(底层使用 pytest)
deepeval test run test_example.py
```
```
from deepeval import assert_test
from deepeval.metrics import GEval
from deepeval.test_case import LLMTestCase, SingleTurnParams
def test_correctness():
metric = GEval(
name="Correctness",
criteria="Determine if output is correct based on expected output.",
evaluation_params=[SingleTurnParams.ACTUAL_OUTPUT, SingleTurnParams.EXPECTED_OUTPUT],
threshold=0.5,
)
case = LLMTestCase(
input="What if these shoes don't fit?",
actual_output="You have 30 days for a full refund.",
expected_output="30-day full refund available.",
retrieval_context=["All customers eligible for 30 day refund."],
)
assert_test(case, [metric])
```
## 指标
**通用 / 自定义**
- G-Eval — 针对任意标准的基于研究的 LLM-as-a-judge
- DAG — 基于图的确定性指标构建器
**Agentic**
- Task Completion, Tool Correctness, Goal Accuracy, Step Efficiency, Plan Adherence, Plan Quality, Tool Use, Argument Correctness
**RAG**
- Answer Relevancy, Faithfulness, Contextual Recall, Contextual Precision, Contextual Relevancy, RAGAS
**多轮 / 对话**
- Knowledge Retention, Conversation Completeness, Turn Relevancy, Turn Faithfulness, Role Adherence
**MCP**
- Task Completion (MCP), MCP Use, Multi-Turn MCP Use
**多模态**
- Text to Image, Image Editing, Image Coherence, Image Helpfulness, Image Reference
**安全 / 质量**
- Hallucination, Summarization, Bias, Toxicity, JSON Correctness, Prompt Alignment
## 基准测试
针对 MMLU, HellaSwag, DROP, BIG-Bench Hard, TruthfulQA, HumanEval, GSM8K 的单行命令基准测试。
## 评估模型提供商
OpenAI, Azure OpenAI, Anthropic, Gemini, Amazon Bedrock, Vertex AI, DeepSeek, Grok, Moonshot, OpenRouter, Ollama, vLLM, LM Studio, LiteLLM, Portkey.
## 框架集成
OpenAI Agents, LangChain, LangGraph, LlamaIndex, CrewAI, Pydantic AI, Anthropic, AWS AgentCore, Google ADK, Strands.
## Confident AI 平台
`deepeval login` 将本地运行连接到 Confident AI 云端,以实现共享的回归报告、数据集标注、生产追踪、Prompt 版本控制、多轮模拟、实时警报、AI 风险评估(针对 Agentic 应用的 OWASP Top 10)以及人工反馈闭环(HITL)。
| 层级 | 价格 | 备注 |
|---|---|---|
| 免费 | 永久 $0 | 2 个席位,1 个项目,每周 5 次测试运行,1 GB-月追踪 |
| Starter | 每位用户每月 $19.99 起 | 完整的单元 + 回归测试,自定义指标,数据集标注,HITL |
| Premium | 每位用户每月 $49.99 起 | 聊天模拟,无代码工作流,pre-commit 评估,完全 API 访问权限 |
| Team | 自定义 | 基于 Git 的 Prompt 工作流,数据集版本控制,SSO,HIPAA / SOC 2 |
| Enterprise | 自定义 | 专用本地部署,24/7 支持,渗透测试 |
## 常用属性
- [网站 — confident-ai.com](https://www.confident-ai.com)
- [门户 — deepeval.com](https://deepeval.com)
- [文档 — 入门指南](https://deepeval.com/docs/getting-started)
- [代码库 — confident-ai/deepeval](https://github.com/confident-ai/deepeval)
- [GitHub 组织 — confident-ai](https://github.com/confident-ai)
- [包 — PyPI](https://pypi.org/project/deepeval/)
- [许可证 — Apache-2.0](https://github.com/confident-ai/deepeval/blob/main/LICENSE.md)
- [问题](https://github.com/confident-ai/deepeval/issues)
- [发布 / 更新日志](https://github.com/confident-ai/deepeval/releases)
- [贡献](https://github.com/confident-ai/deepeval/blob/main/CONTRIBUTING.md)
- [博客](https://www.confident-ai.com/blog)
- [论坛 — Discord](https://discord.com/invite/3SEyvpgu2f)
- [定价](https://www.confident-ai.com/pricing)
- [注册](https://app.confident-ai.com/auth/signup)
- [应用 — Confident AI 云端](https://app.confident-ai.com)
- [工具 — DeepTeam (红队评估)](https://github.com/confident-ai/deepteam)
- [工具 — Confident MCP Server](https://github.com/confident-ai/confident-mcp-server)
- [文档 — DeepTeam](https://trydeepteam.com)
- [代码示例 — 博客示例](https://github.com/confident-ai/blog-examples)
- [集成 — 模型](https://deepeval.com/integrations/models/openai)
- [Twitter](https://twitter.com/confident_ai)
- [LinkedIn](https://www.linkedin.com/company/confident-ai)
- [YouTube](https://www.youtube.com/@confident-ai)
## API
DeepEval 是一个 Python 框架和 CLI——该框架本身没有公开的 REST API 接口。该框架在本地运行评估,并(可选地)将结果同步到 Confident AI 云端。Confident AI 宣称在 Premium 及更高级别提供完全的 API 访问权限,但目前尚未发布公开的 OpenAPI 规范或开发者参考。因此,此目录条目不包含任何 OpenAPI 相关内容。
## 维护者
**姓名:** Kin Lane
**邮箱:** info@apievangelist.com
标签:AI大模型, Clair, LLM, LNA, Python, Unmanaged PE, 文档结构分析, 无后门, 模型评估, 测试框架, 逆向工具