{
 "schema_version": 1,
 "generated": "2026-10-31",
 "id": "vibrantlabsai-ragas--score-llm-summaries-with-a-ragas-discrete-metric",
 "repo": "vibrantlabsai/ragas",
 "repo_url": "https://github.com/vibrantlabsai/ragas",
 "repo_slug": "vibrantlabsai-ragas",
 "title": "Score LLM outputs with a custom pass or fail metric",
 "page_title": "How to score LLM outputs with a custom pass or fail metric with Ragas",
 "summary": "Define an Aspect Critique style metric with DiscreteMetric and let an LLM judge label each response.",
 "who": "A product engineer who wants a quick accurate or inaccurate check on generated summaries.",
 "problem": "Manual review of every summary does not scale.",
 "outcome": "A label and a written reason for each response you score.",
 "steps": [
  "Install Ragas with `pip install ragas` and set your OPENAI_API_KEY environment variable",
  "Create an LLM with llm_factory and an AsyncOpenAI client as in the README",
  "Define a DiscreteMetric with a name, allowed_values like accurate and inaccurate, and a prompt",
  "Call metric.ascore with the llm and your response, then print score.value and score.reason"
 ],
 "agent_prompt": "With vibrantlabsai/ragas, write a script that defines a DiscreteMetric named summary_accuracy with allowed values accurate and inaccurate, scores each response in <my file of summaries> with metric.ascore, and writes value and reason to a CSV.",
 "agents": [
  "claude-code",
  "codex",
  "cursor",
  "gemini-cli"
 ],
 "difficulty": "Intermediate",
 "time": "30 minutes",
 "basis": "readme",
 "caveat": "LLM judges can be wrong; spot check a sample by hand.",
 "category": "Software and DevOps",
 "tags": [
  "Software and DevOps"
 ],
 "lang": "python",
 "requirements": [
  "Python with pip",
  "An LLM provider key for LLM-based metrics, for example OPENAI_API_KEY in the README example",
  "uv or another way to run the quickstart CLI is optional"
 ],
 "risk": "none",
 "seen_in_the_wild": false,
 "mentioned_publicly": false,
 "risks": [
  {
   "tag": "cost",
   "notice": "Every scored response is an LLM call billed to your provider account."
  },
  {
   "tag": "credentials",
   "notice": "The example reads your OPENAI_API_KEY from the environment; keep it out of committed code."
  }
 ],
 "best": false,
 "score": 0.9,
 "evidence": [],
 "url": "https://dedupedai.com/use-cases/vibrantlabsai-ragas/score-llm-summaries-with-a-ragas-discrete-metric/",
 "md": "https://dedupedai.com/use-cases/vibrantlabsai-ragas/score-llm-summaries-with-a-ragas-discrete-metric/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/vibrantlabsai-ragas--score-llm-summaries-with-a-ragas-discrete-metric.json",
 "api_version": "v1"
}
