ragas
vibrantlabsai/ragas
Supercharge Your LLM Application Evaluations
Overview
Ragas is a Python toolkit for evaluating and optimizing Large Language Model (LLM) applications with objective metrics, intelligent test generation, and data-driven insights.
Categories
Tags
Relationships
Similar tools
langflow
langflow-ai/langflow
Langflow is a powerful platform for building and deploying AI-powered agents and workflows.
ai-engineering-from-scratch
rohitg00/ai-engineering-from-scratch
Curriculum for building AI systems from scratch
langfuse
langfuse/langfuse
Open source AI engineering platform
FastGPT
labring/FastGPT
FastGPT is a knowledge-based platform for developing and deploying complex question-answering systems using LLMs, offering out-of-the-box capabilities like data processing, RAG retrieval, and visual A
mlflow
mlflow/mlflow
The open source AI engineering platform for agents, LLMs, and ML models
llm-action
liguodongiot/llm-action
分享大模型技术原理与实战经验,涵盖工程化和应用落地
Install
pip install ragasREADME
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 agentsbenchmark_llm- Benchmark and compare LLMsprompt_evals- Evaluate prompt variationsworkflow_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 'accura