deepeval-evaluation
БесплатноБез исполняемых скриптовНе проверенUse for any question or task about testing an LLM or RAG app with pytest, including hallucination checks in CI and answers that invent facts missing from the…
от testland★ 18 звёзд на GitHubОб этом скилле
deepeval-evaluation
Overview
Per de-start, DeepEval is "an open-source LLM eval
package" enabling "evaluation of LLM applications locally through
test cases and metrics." The model: each test constructs an
LLMTestCase, applies one or more Metric instances, and either
asserts (assert_test) or batch-evaluates (evaluate). Pytest
discovery + reporting works unchanged.
When to use
- The repo already uses pytest; LLM tests should live alongside unit tests.
- The user works with RAG and needs Faithfulness / Contextual-* metrics without writing them from scratch.
- The team wants a managed dashboard (Confident-AI) for regression tracking + prompt-vs-prompt comparison.
- Programmatic test-case authoring (data-driven from a CSV/JSONL) is needed and pytest fixtures fit better than YAML config.
Step 1 - Install
pip install -U deepeval
Optional Confident-AI login (for dashboard):
deepeval login
Per de-start: after login "Confident AI will generate testing reports and automate regression testing whenever you run a test run."
Step 2 - First test
Per de-gh (verbatim quickstart):
import pytest
from deepeval import assert_test
from deepeval.metrics import GEval
from deepeval.test_case import LLMTestCase, SingleTurnParams
def test_case():
correctness_metric = GEval(
name="Correctness",
criteria="Determine if the 'actual output' is correct based on the 'expected output'.",
evaluation_params=[SingleTurnParams.ACTUAL_OUTPUT, SingleTurnParams.EXPECTED_OUTPUT],
threshold=0.5
)
test_case = LLMTestCase(
input="What if these shoes don't fit?",
actual_output="You have 30 days to get a full refund at no extra cost.",
expected_output="We offer a 30-day full refund at no extra costs.",
retrieval_context=["All customers are eligible for a 30 day full refund at no extra costs."]
)
assert_test(test_case, [correctness_metric])
Run it:
deepeval test run test_chatbot.py
(Per de-gh.)
Step 3 - LLMTestCase fields
Per de-start, LLMTestCase fields:
| Field | Required | Notes |
|---|---|---|
input |
yes | The user prompt / query |
actual_output |
yes | What the LLM produced |
expected_output |
optional | Reference answer (used by metrics that compare) |
retrieval_context |
optional | The chunks your retriever actually returned for this input, at test time. Faithfulness and the Contextual-* metrics judge against it |
context |
optional | Ground-truth reference text you supply. Only HallucinationMetric reads it; passing retrieved chunks here leaves Faithfulness with nothing to check (de-halluc) |
Step 3b - A golden set that can fail
A suite only catches what its cases can expose. Three gaps let an inventing bot pass:
- Expected answers copied from the app. If
expected_outputwas saved from the bot's own replies, every comparison metric measures the bot against itself. Write expected answers by hand, or have a person check each one against the source documents. - No unanswerable questions. Add questions the knowledge base does not answer (a policy it never mentions, a product you do not sell) and check the reply declines, says it does not know, or hands off. Use a G-Eval criterion for that behaviour, since an answer-relevancy metric rewards a confident invented answer:
from deepeval.metrics import GEval
from deepeval.test_case import SingleTurnParams
JUDGE_MODEL = "<one dated judge model id>" # pinned once, used by every metric
declines = GEval(
name="Declines when the docs are silent",
criteria="The retrieved context does not answer the question. Pass only if the "
"actual output says it cannot confirm the answer or offers a hand-off, "
"and states no policy, number or date that is absent from the context.",
evaluation_params=[SingleTurnParams.INPUT, SingleTurnParams.ACTUAL_OUTPUT,
SingleTurnParams.RETRIEVAL_CONTEXT],
threshold=0.8,
model=JUDGE_MODEL,
)
- Only happy-path topics. Cover the questions that went wrong in production and the ones with exact facts (windows, prices, limits).
Step 4 - Metric catalog
Per de-gh the available metrics include:
| Metric | Use |
|---|---|
GEval |
Custom rubric-based scoring (LLM-as-judge with chain-of-thought) |
| `Answe |
Установить deepeval-evaluation в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл deepeval-evaluation?
Use for any question or task about testing an LLM or RAG app with pytest, including hallucination checks in CI and answers that invent facts missing from the retrieved documents: DeepEval LLMTestCase, built-in metrics such as G-Eval, answer relevancy, faithfulness, contextual recall and precision, hallucination, bias and toxicity, deepeval test run with assert_test, and the Confident AI dashboard.
Как установить скилл deepeval-evaluation?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл deepeval-evaluation запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic