vibrantlabsai/ragas
Python library and CLI for scoring RAG outputs and generating regression tests
Automated SPDX check for reference only — not legal advice. Disclaimer
GitHub Star History
Full-history star trajectory from GitHub official history. Switch ranges or hover any point for exact counts.
Evidence-Backed Technical Brief
AI Deep ReviewArchitecture & Core Mechanics
Ragas is a Python evaluation library with a CLI scaffolder, not an inference server. The application supplies the output under test, while the evaluation code configures a metric and, for model-based scoring, a judge. In the async example, llm_factory wraps an AsyncOpenAI client, DiscreteMetric defines a prompt and allowed labels, and ascore(...) returns a result exposing both value and reason.
Package code sits under src/, with separate tests/ and examples/ directories. The manifest includes pydantic>=2.0.0, datasets>=4.0.0, NumPy, OpenAI, Instructor, and the LangChain package family. The CLI quickstart bootstraps a project; scoring itself is available through the Python API. The concrete extension points shown are the judge factory and configurable metric, not a separate plugin service or wire protocol.
Key Capabilities & Differentiators
Ragas combines LLM-based scoring, traditional metrics, and RAG test-set generation. The DiscreteMetric example defines a custom summary_accuracy rubric with two allowed labels, accurate and inaccurate, and exposes a reason alongside the label. That is useful for reviewing individual failures, but the example passes only the response into the prompt. To judge fidelity to a source, supply that source or an appropriate reference as part of the evaluation input.
Test-set generation provides a starting point when a hand-curated dataset is not available, and production examples can feed later evaluation rounds. LangChain integration is supported, and the concrete judge example uses gpt-4o via AsyncOpenAI. v0.4.4 reports compatibility fixes for current OpenAI and Anthropic models, but that is not a model-by-model support matrix. rag_eval is the available quickstart template; agent, model benchmark, prompt, and workflow templates are listed as forthcoming.
Trade-offs & Limitations
Compared with hand-written assertions, Ragas gives teams a way to reuse semantic rubrics and add generated test cases, at the cost of a wider dependency tree and more configuration. Keep direct checks for deterministic properties such as output schema or exact values. For semantic judgments, calibrate against human-reviewed examples and keep judge configuration fixed when comparing runs. A reason is useful for triage, but it is not independent proof that a label is correct.
Compared with a managed evaluation or observability platform, the package can run in your own Python environment; you still own scheduling, result retention, and access controls. API-based judging adds network, rate-limit, billing, and data-governance constraints. Running Ragas locally does not keep judge inputs local when you call an external provider. Apache-2.0 covers the package, not provider terms; package usage analytics can be disabled with RAGAS_DO_NOT_TRACK=true.
Hardware & Deployment Guide
The package declares Python >=3.9. Install with pip install ragas in an isolated environment, then scaffold with ragas quickstart rag_eval or import the library into an existing suite. Check that the resolved dependencies support your chosen interpreter. The demonstrated AsyncOpenAI path requires OPENAI_API_KEY and provider connectivity; it needs no local model or GPU. The CLI is a project generator, not a hosted service, and this API example is not an offline deployment recipe.
Pin the resolved environment and smoke-test import ragas plus a representative judge call before adding it to CI. v0.4.4 restores fresh installs after langchain-community 0.4 removed VertexAI modules, includes a published security fix, and reports updated OpenAI and Anthropic compatibility. v0.4.3 added DSPyOptimizer with MIPROv2 and DSPy caching. For API-backed runs, size local compute for data handling and concurrency, and budget provider calls separately.
DiscreteMetric.ascore(...) returns a score whose value and reason can be read separately.DiscreteMetric accepts a custom prompt and a fixed set of allowed labels.llm_factory("gpt-4o", client=client) uses an AsyncOpenAI client in the worked example.ragas quickstart rag_eval -o ./my-project creates a RAG evaluation project at the specified path.langchain-community 0.4 and reports a published security fix.Teams building repeatable RAG regression suites that mix deterministic checks, model-based rubrics, and generated test cases.
A few deterministic assertions cover your needs, or you require a turnkey hosted platform or a verified offline judge stack without additional integration.
Quick Start & Installation
pip install ragasAI Context Briefing (for Claude / Cursor / Windsurf)
Standardized architecture summary & quickstart commands ready to paste into coding agents.
curl -sL https://repoforai.com/repo/vibrantlabsai/ragas.md
Active README embeds unlock Hot-Tier 6h Telemetry Refresh automatically (zero pay-to-rank).
Frequently Asked Questions about ragas
How do I integrate a custom judge into an existing Python application?
DiscreteMetric.ascore(...) and await the result. The example constructs the judge with llm_factory and AsyncOpenAI, then reads score.value and score.reason. Your application remains responsible for producing the output being evaluated; the rag_eval CLI template is an optional starting point.Do I need a GPU, and what determines runtime overhead?
Can we use Ragas commercially and keep evaluation data in our own environment?
RAGAS_DO_NOT_TRACK=true if you need to disable package usage analytics.When is Ragas a better choice than a hand-written Python evaluation harness?
Upstream README & Documentation
This profile focuses on independent engineering analysis and live telemetry. Read the full upstream README, changelog, and examples directly on GitHub.
Top 10 Breakout Open-Source AI Repos, Every Thursday
Signal-only digest of fast-growing AI repos, SPDX license alerts, and architecture picks. Zero spam.
Zero spam · 1-click unsubscribe · Privacy Policy