Skip to main content

Ragas CLI

A one-step Ragas cli tool to evaluate QCAG testsets generated by RAG apps. (Q = Question, C = Contexts, A = Answer, G = Ground_truth)

Install with pip

pip install ragas langchain==0.0.354

then:

pip install ragas_once

Arguments

  • --model: Specifies the model to use for evaluation.
    • Default value is "gpt-3.5-turbo". Langchain compatible.
  • --api_base: Specifies the base URL for the API.
  • --api_key: Specifies the API key to authenticate requests.
    • Not required if using psuedo-openai API server, e.g. vLLM, Fastchat, etc.
  • --embeddings: Specifies the Huggingface embeddings model to use for evaluation.
    • Embeddings will run locally.
    • Will use OpenAI embeddings if not set.
    • Better set if using psuedo-openai API server.
  • --metrics: Specifies the metrics to use for evaluation.
    • Will use Ragas default metrics if not set.
    • Default metrics: ["answer_relevancy", "context_precision", "faithfulness", "context_recall", "context_relevancy"]
    • Other metrics: "answer_similarity", "answer_correctness"
  • --dataset: Specifies the path to the dataset for evaluation.
    • Dataset format must meet RAGAS requirements.
    • Will use fiqa dataset as demo if not set.

Usage

Fiqa dataset demo:

python3 -m ragas_once.cli --api_key "YOUR_OPENAI_API_KEY"

Evaluate with GPT-4 and BAAI/bge-small-en embeddings

The huggingface embeddings will run locally, so Make sure your machine works and have sentence-transformers installed:

pip install sentence-transformers

Then run:

python3 -m ragas_once.cli --model "gpt-4" --api_key "YOUR_OPENAI_API_KEY" --embeddings "BAAI/bge-small-en" --dataset "path/to/dataset.csv"

Prepare Dataset

See Ragas documentation

Metadata

Release files for ragas-once 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ragas-once 0.0.1
File Size Uploaded
ragas_once-0.0.1.tar.gz 8.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ragas-once 0.0.1
File Interpreter ABI Platform
ragas_once-0.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 17.1 kB

Release files / ragas_once-0.0.1.tar.gz

Download URL ragas_once-0.0.1.tar.gz
Size 8.3 kB
Tags Source
SHA-256 checksum
How to use checksums
8fd7ccbb9f4899eb53ec6ff3440a5e6de6e533b77b7674a95de8639af5dc38c6
BLAKE2b-256 checksum
How to use checksums
45603fb9735070f16cbe158b7e1352161b3d3f9fdbf673dc4851734975486c44
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.5

Release files / ragas_once-0.0.1-py3-none-any.whl

Download URL ragas_once-0.0.1-py3-none-any.whl
Size 8.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c604bf550c47864f30f658997ff8cf7034f582efff1d1dc9124c661bac947023
BLAKE2b-256 checksum
How to use checksums
dc58d28b11c5359386371a3a252b731f08e078ca18e888bcda2082dc2d3c5387
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.5

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page