DEDUPED Hot AI repos. Real use cases. What people build. Get the Monday 5

How to score answers for hallucination with an LLM judge with Opik

Use the built-in Hallucination metric to check whether an output is supported by its context.

Short answer: Install the SDK with pip install opik and run opik configure; then import Hallucination from Opik.evaluation.metrics; call metric.score with the input, output and context, as in the README. All steps.

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

  1. Install the SDK with pip install opik and run opik configure
  2. Import Hallucination from Opik.evaluation.metrics
  3. Call metric.score with the input, output and context, as in the README
  4. 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

Cursor, ChatGPT, others

Share: X LinkedIn Hacker News Email Copy link

Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer