cost. LLM-as-a-judge metrics call a model for every score, which costs tokens on hosted providers.
Who it is forA team running a RAG app that sometimes invents facts.
The problemManual spot checks do not scale and miss regressions.
The outcomeA numeric score per answer you can track across datasets and experiments.
What you need first
- Python with pip; install with `pip install opik`
- An Opik server: Comet.com cloud, or self-hosted with Docker (Kubernetes and Helm for larger setups)
- Optional: uv for `uvx opik mcp configure`
Steps
- Install the SDK with
pip install opikand runopik configure - Import Hallucination from Opik.evaluation.metrics
- Call metric.score with the input, output and context, as in the README
- Run evaluations over a dataset and compare experiments, or add them to CI with the PyTest integration
Prompt for your agent
Using comet-ml/opik, score 20 question, answer and context triples from <my RAG logs> with the Hallucination metric and list the five lowest scoring answers.
Caveat. This card is written from the comet-ml/opik README, not from a test run by Deduped. Before you start, make sure you have Python with pip. Check the repo for newer instructions before you rely on these steps.
Use this in your AI agent
Ask your agent
Using the Deduped MCP, get the setup steps for comet-ml/opik and "Score answers for hallucination with an LLM judge"
Add Deduped to Claude Code once
claude mcp add --transport http deduped https://dedupedai.com/mcp
Every Monday: the 5 hottest repos and exactly how to use them. Free, one email a week, unsubscribe anytime.
Get them freeShare: X LinkedIn Hacker News Email Copy link
Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer