Skip to main content

Objective, provider-neutral evaluation for LLM applications

CI Python 3.11+ License Apache-2.0

About this fork

ragas-ng is a hard fork of vibrantlabsai/ragas, taken after the upstream repository went seven months without updates. It has two goals:

  1. Remove lock-in to any single frontier-lab vendor or framework wherever possible.
  2. Fix the functional issues reported against the original repository.

Changes so far:

  • No LangChain. import ragas loads no LangChain modules, and nothing LangChain-related is installed as a dependency. The LangChain, LangSmith, LangGraph and Opik integrations are gone. See the LangChain migration guide.
  • Provider-neutral by default. openai is no longer a declared dependency. Every llm_factory() call goes through LiteLLM, addressed by model name ("anthropic/claude-sonnet-5-5", "gemini/gemini-3.6-flash", "ollama/..."), so any provider LiteLLM supports works without its SDK. embedding_factory() works without a client too.
  • Native tracing. The LangChain callback system has been replaced by a native run tree plus the OpenTelemetry API. Spans cost nothing until you configure an OpenTelemetry SDK.
  • Collections metrics everywhere. Metrics have been ported to ragas.metrics.collections, including the non-LLM context metrics, AspectCritic, SimpleCriteriaScore and FaithfulnesswithHHEM, and metrics_experiment() scores them over a Dataset. The legacy metrics are removed; ragas.metrics keeps only the base classes and the DiscreteMetric / NumericMetric / RankingMetric family.
  • Upstream bugs fixed, with migration notes. Fixes that change behavior or scores are listed in Behavior changes and Score changes, so you can see what differs from upstream before upgrading.
  • Modern toolchain. Requires Python 3.11+. Uses uv with a committed lockfile, and the docs build in CI with mkdocs --strict.

The distribution is published as ragas-ng; the import name is still ragas, so existing code keeps importing the same way.

🛡️ Installation

pip install ragas-ng
# or
uv add ragas-ng

Optional features ship as extras, for example tracing, gdrive, ag-ui, dspy, or all:

pip install "ragas-ng[all]"

ragas-ng and upstream's ragas both install the ragas import package, so install one or the other, not both. To install the latest unreleased code from GitHub:

pip install git+https://github.com/arpieb/ragas-ng

🔥 Quickstart

Evaluate your LLM app

DiscreteMetric lets you judge any aspect of an output with an LLM. This example needs no vendor SDK: llm_factory routes through LiteLLM and reads credentials from the environment.

import asyncio

from ragas.llms import llm_factory
from ragas.metrics import DiscreteMetric

# Any LiteLLM model string works: "gpt-6-luna", "anthropic/claude-sonnet-5-5",
# "gemini/gemini-3.8-flash", "ollama/qwen3.8:27b", ...
llm = llm_factory("gpt-6-luna")

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'.""",
)


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: Set the API key your provider needs, such as OPENAI_API_KEY or ANTHROPIC_API_KEY. You can still pass an explicit client, such as llm_factory("gpt-6-luna", client=AsyncOpenAI()), if you prefer.

Start from a template project

ragas quickstart copies a complete example project:

ragas quickstart                          # list available templates
ragas quickstart rag_eval -o ./my-project # create a project

Templates: rag_eval, improve_rag, agent_evals, llamaIndex_agent_evals, text2sql, workflow_eval, prompt_evals, judge_alignment, benchmark_llm. The template sources live in examples/ragas_examples.

Documentation

The documentation lives in docs/ and is kept current with this fork. To build and browse it locally:

make serve-docs

The docs are published at https://arpieb.github.io/ragas-ng/. For AI agents, an llms.txt index is at https://arpieb.github.io/ragas-ng/llms.txt and the full text at https://arpieb.github.io/ragas-ng/llms-full.txt.

Upstream's hosted docs at docs.ragas.io describe the original project and will not match this fork on LangChain, provider setup or the metrics APIs.

Getting help

Development

git clone https://github.com/arpieb/ragas-ng.git
cd ragas-ng
make install-minimal   # lint, type-check and the full unit test suite (what CI installs)
make check             # format + type check
make test              # unit tests

Run make install for the full ML stack, which the e2e tests need. Some e2e and docs tests also call real providers and need an API key, such as OPENAI_API_KEY. See CONTRIBUTING.md for the full development guide.

Contributions are welcome. Fork the repo, create a feature branch, and open a pull request against main.

🔍 No usage analytics

ragas-ng collects no usage data. The upstream analytics module, which sent anonymized usage events to upstream's endpoint, has been removed, so ragas sends no telemetry and no longer writes a persistent user ID to disk. RAGAS_DO_NOT_TRACK is no longer needed.

Acknowledgements and citation

ragas-ng is built on the work of the original Ragas authors and contributors at VibrantLabs, and is distributed under the same Apache-2.0 license. If you use Ragas in research, please cite the original project:

@misc{ragas2024,
  author       = {VibrantLabs},
  title        = {Ragas: Supercharge Your LLM Application Evaluations},
  year         = {2024},
  howpublished = {\url{https://github.com/vibrantlabsai/ragas}},
}

Metadata

Release files for ragas-ng 2026.11.0

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-ng 2026.11.0
File Size Uploaded Provenance Actions
ragas_ng-2026.11.0.tar.gz 43.2 MB With provenance Details for ragas_ng-2026.11.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ragas-ng 2026.11.0
File Interpreter ABI Platform Actions
ragas_ng-2026.11.0-py3-none-any.whl Python 3 none any Details for ragas_ng-2026.11.0-py3-none-any.whl

Total release size: 43.7 MB

Release files / ragas_ng-2026.11.0.tar.gz

Download URL ragas_ng-2026.11.0.tar.gz
Size 43.2 MB
Tags Source
SHA-256 checksum
How to use checksums
e3deea162a4dd00469d934258f7a7f59546f198733c248360c4c7c7c8429acf0
BLAKE2b-256 checksum
How to use checksums
24be7e6cb40ed212f5b5451d3aba4b72b11adcc29725ed5b98f13e950602c1ff
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 12, 2026.

Transparency log

Release files / ragas_ng-2026.11.0-py3-none-any.whl

Download URL ragas_ng-2026.11.0-py3-none-any.whl
Size 444.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c97e8e586a9ab8008dc88e8046de043af1799c5b14e59467bcdd2ce1d7f5c275
BLAKE2b-256 checksum
How to use checksums
a7e8a24612397d4baae871af40efefe4b4b9943ec6455e053290f1b451db2c87
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 12, 2026.

Transparency log

Security for ragas-ng 2026.11.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for ragas_ng-2026.11.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 12, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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