AI Card Bao FBKPNJTPMWDASH.AICARDBAO.COM
Home / open source / Ragas
AI TOOL / #12824

Ragas

An evaluation framework for LLM applications and RAG pipelines that allows for the quantification of metrics such as hallucination, fidelity, and relevance.

Introduction

Supercharge Your LLM Application Evaluations 🚀

Documentation |

Quick start | Join Discord | Blog | NewsLetter | Careers

Objective metrics, intelligent test generation, and data-driven insights for LLM apps

Ragas is your ultimate toolkit for evaluating and optimizing Large Language Model (LLM) applications. Say goodbye to time-consuming, subjective assessments and hello to data-driven, efficient evaluation workflows. Don't have a test dataset ready? We also do production-aligned test set generation.

Key Features

  • 🎯 Objective Metrics: Evaluate your LLM applications with precision using both LLM-based and traditional metrics.
  • 🧪 Test Data Generation: Automatically create comprehensive test datasets covering a wide range of scenarios.
  • 🔗 Seamless Integrations: Works flawlessly with popular LLM frameworks like LangChain and major observability tools.
  • 📊 Build feedback loops: Leverage production data to continually improve your LLM applications.

:shield: Installation

Pypi:

pip install ragas

Alternatively, from source:

pip install git+https://github.com/vibrantlabsai/ragas

:fire: Quickstart

Clone a Complete Example Project

The fastest way to get started is to use the ragas quickstart command:

# List available templates
ragas quickstart

# Create a RAG evaluation project
ragas quickstart rag_eval

# Specify where you want to create it.
ragas quickstart rag_eval -o ./my-project

Available templates:

  • rag_eval - Evaluate RAG systems

Coming Soon:

  • agent_evals - Evaluate AI agents
  • benchmark_llm - Benchmark and compare LLMs
  • prompt_evals - Evaluate prompt variations
  • workflow_eval - Evaluate complex workflows

Evaluate your LLM App

ragas comes with pre-built metrics for common evaluation tasks. For example, Aspect Critique evaluates any aspect of your output using DiscreteMetric:

import asyncio
from openai import AsyncOpenAI
from ragas.metrics import DiscreteMetric
from ragas.llms import llm_factory

# Setup your LLM
client = AsyncOpenAI()
llm = llm_factory("gpt-4o", client=client)

# Create a custom aspect evaluator
metric = DiscreteMetric(
    name="summary_accuracy",
    allowed_values=["accurate", "inaccurate"],
    prompt="""Evaluate if the summary is accurate and captures key information.

Response: {response}

Answer with only 'accurate' or 'inaccurate'."""
)

# Score your application's output
async def main():
    score = await metric.ascore(
        llm=llm,
        response="The summary of the text is..."
    )
    print(f"Score: {score.value}")  # 'accurate' or 'inaccurate'
    print(f"Reason: {score.reason}")

if __name__ == "__main__":
    asyncio.run(main())
Note: Make sure your OPENAI_API_KEY environment variable is set.

Find the complete Quickstart Guide

Want help in improving your AI application using evals?

In the past 2 years, we have seen and helped improve many AI applications using evals. If you want help with improving and scaling up your AI application using evals.

🔗 Book a slot or drop us a line: [email protected].

🫂 Community

If you want to get more involved with Ragas, check out our discord server. It's a fun community where we geek out about LLM, Retrieval, Production issues, and more.

Contributors

+----------------------------------------------------------------------------+
|     +----------------------------------------------------------------+     |
|     | Developers: Those who built with `ragas`.                      |     |
|     | (You have `import ragas` somewhere in your project)            |     |
|     |     +----------------------------------------------------+     |     |
|     |     | Contributors: Those who make `ragas` better.       |     |     |
|     |     | (You make PR to this repo)                         |     |     |
|     |     +----------------------------------------------------+     |     |
|     +----------------------------------------------------------------+     |
+----------------------------------------------------------------------------+

We welcome contributions from the community! Whether it's bug fixes, feature additions, or documentation improvements, your input is valuable.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

🔍 Open Analytics

At Ragas, we believe in transparency. We collect minimal, anonymized usage data to improve our product and guide our development efforts.

✅ No personal or company-identifying information

✅ Open-source data collection code

✅ Publicly available aggregated data

To opt-out, set the RAGAS_DO_NOT_TRACK environment variable to true.

Cite Us

@misc{ragas2024,
  author       = {VibrantLabs},
  title        = {Ragas: Supercharge Your LLM Application Evaluations},
  year         = {2024},
  howpublished = {\url{https://github.com/vibrantlabsai/ragas}},
}
Visits:59 Updated:2026-12-04 AI tools

Related

Connected Paper Connected Paper is a unique visualization tool that utilizes the SematicScholar database to analyze the relationships between various scholarly publications. Its primary purpose is to help you quickly locate relevant papers within your area of research. You can use it through Pap… PixPin PixPin is an incredibly versatile tool for taking and editing screenshots. It directly competes with the well-known Snipaste, and in addition to that, it offers many other useful features such as OCR text recognition, the ability to take long screenshots, and the capability to record GIF animations – all functions that are widely used by users. So far, the developer has only released the Windows version of this tool. PubScholar College students were overjoyed when it was announced on November 1st that the PubScholar public welfare academic platform, jointly developed by the Chinese Academy of Sciences, would be officially opened to the public. This platform offers free academic literature services, providing a wealth of scholarly resources for institutions and members of the general public who have such needs. The platform is backed by the Chinese Academy of Sciences. National flags of countries around the world The website Flags of the World collects high-definition flag images for 254 countries and regions around the world, all of which can be downloaded for free directly. In addition to the download of high-definition flag images, the site also provides emoji symbols associated with each flag. Pyta Writing Cat In the past two years, have you noticed how various AI technologies have become increasingly prevalent in our daily lives? Writing articles, creating artwork, providing voiceovers—it seems that all these tasks can now be accomplished by AI tools. At first, people viewed AI with skepticism, thinking it was nothing more than a form of “artificial stupidity.” However, with the rapid advances in technology over the past two years, the capabilities of AI models have truly expanded... VideoDownload 4K Video Downloader is a video download tool for foreign mainstream platforms, such as oil pipelines, Facebook, ins, B stations and other platforms! You just need to paste in the video link to download all the quality of the video, including 4K, 8K and even 3D videos.