{
 "schema_version": 1,
 "generated": "2026-11-09",
 "id": "comet-ml-opik--score-hallucinations-with-opik-llm-judge",
 "repo": "comet-ml/opik",
 "repo_url": "https://github.com/comet-ml/opik",
 "repo_slug": "comet-ml-opik",
 "title": "Score answers for hallucination with an LLM judge",
 "page_title": "How to score answers for hallucination with an LLM judge with Opik",
 "summary": "Use the built-in Hallucination metric to check whether an output is supported by its context.",
 "who": "A team running a RAG app that sometimes invents facts.",
 "problem": "Manual spot checks do not scale and miss regressions.",
 "outcome": "A numeric score per answer you can track across datasets and experiments.",
 "steps": [
  "Install the SDK with `pip install opik` and run `opik 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"
 ],
 "agent_prompt": "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.",
 "agents": [
  "claude-code",
  "codex",
  "cursor",
  "gemini-cli"
 ],
 "difficulty": "Intermediate",
 "time": "1 hour",
 "basis": "readme",
 "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.",
 "category": "Software and DevOps",
 "tags": [
  "Software and DevOps"
 ],
 "lang": "python",
 "requirements": [
  "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`"
 ],
 "risk": "none",
 "seen_in_the_wild": false,
 "mentioned_publicly": false,
 "risks": [
  {
   "tag": "cost",
   "notice": "LLM-as-a-judge metrics call a model for every score, which costs tokens on hosted providers."
  }
 ],
 "best": false,
 "score": 0.9,
 "evidence": [],
 "url": "https://dedupedai.com/use-cases/comet-ml-opik/score-hallucinations-with-opik-llm-judge/",
 "md": "https://dedupedai.com/use-cases/comet-ml-opik/score-hallucinations-with-opik-llm-judge/index.md",
 "disclaimer": "Deduped lists open-source repositories that belong to other people. We do not own, maintain, audit, or vouch for any of them, and a repo appearing here is not an endorsement or a safety check. The use cases, steps, and prompts are written by AI and may be incomplete, outdated, or just wrong. Where a use case is marked \"Seen in the wild\", we link to public posts where someone described something similar, but we have not verified those posts and the use case itself is still our AI's own write-up. Use all of this at your own risk. Only run code, commands, or agents on systems and accounts you are authorized to use, and read the code and every command before you run it, especially anything that touches credentials, files, or the network. Nothing here is professional, security, legal, or financial advice. All trademarks and project names belong to their respective owners, and their use here does not imply affiliation. Content is provided as is, without warranties of any kind. Found a mistake, a safety problem, or something you want removed? Email hello@dedupedai.com and we will look at it promptly.",
 "api": "https://dedupedai.com/api/v1/usecases/comet-ml-opik--score-hallucinations-with-opik-llm-judge.json",
 "api_version": "v1"
}
