Stop believing your chatbot. Take the ragpill.
ragpill is an evaluation framework for LLM agents and RAG pipelines. Define facts, sources, and tool call expectations — and find out what your AI actually does.
What is RAGPill?
If you are building an LLM-based application, ragpill's ultimate goal is to help you:
- Build a testset that captures what "good" looks like for your application — facts, sources, tool calls, and domain-specific criteria.
- Run it locally against your app, with first-class integrations for MLflow (today) and Langfuse (planned), so traces and evaluations live next to your existing observability stack.
- Integrate it into your workflow (CI/CD, pre-deploy checks, local iteration loops) to prevent regressions and objectively measure progress when you tweak system prompts, swap models, change retrieval parameters, or refactor agent logic.
It specializes in "offline" evaluation of LLM-based systems — meant to be part of your CI/CD pipeline or scheduled tests, not real-time monitoring.
RAGPill helps you:
- Create test datasets from CSV files - Easy collaboration with domain experts
- Define custom evaluators - Add domain-specific knowledge to evaluations
- Track results in MLflow - Full experiment tracking and tracing
- Follow best practices - Opinionated design guides you to robust testing
Where this is heading: agent-assisted evaluation
ragpill is built so that an agent (e.g. Claude Code) can be a first-class participant in the evaluation loop:
-
Testset co-creation: ragpill will expose a skill that your agent can consume to build the testset together with the developer — turning vague product expectations into concrete cases, evaluators, tags, and attributes.
-
Investigative harness: the package will provide the harness an agent needs to investigate an evaluation run and suggest improvements — to the testset, the application config, or the overall solution.
Example: a question asks about the timeline of events scattered across different chunks. The agent analyzes the failed run, notices the timestamps are already present in chunk metadata but can't be filtered on, which clutters retrieval with irrelevant chunks — and suggests adding a metadata filter on the date field.
Core Philosophy
Here we focus a lot on the LLM Judge evaluator, although it's the last evaluator you should use - prefer deterministic evaluators (regex, exact match) whenever possible. However, for deterministic tests, there's already a lot of tooling available, like pytest for example (yes, we like the 'code-first' approach).
Expert-Defined Attributes
LLM judges usually lack context awareness to judge which discrepancies between chatbot answers and expected answers are relevant - especially in specialized fields like law, engineering, and science where words have precise definitions.
Domain experts should define specific attributes and criteria for evaluation.
Binary Evaluations
We use boolean pass/fail values only, not scoring scales (1-10), because:
- Scales are arbitrary and often decided by LLMs
- Binary decisions are more stable and reproducible (although LLMs of course remain probabilistic)
- Easier to track and reason about over time
Tags and Attributes for Organization
Evaluators can have:
- Tags: Categorical labels for filtering (e.g.,
retrieval,time-aware-rag,basic_logic) - Attributes: Key-value metadata for categorization (e.g.,
importance: high,scope: Phase1)
Metrics are automatically calculated per tag and attribute.
Quick Navigation
Getting Started:
Evaluators:
Key Concepts
ragpill is built around three independent layers — execute, evaluate, upload — so you can mix and match them to fit your workflow. See the Layered Architecture Guide for details.
Key Components
- Dataset / Case: Plain dataclasses from
ragpill.eval_typesthat hold test cases with inputs, evaluators, and metadata - Evaluators: Check if outputs meet criteria (LLMJudge, regex matchers, custom evaluators)
- Three-Layer Pipeline:
execute_dataset(run tasks + capture traces) →evaluate_results(apply evaluators) →upload_to_mlflow(persist). Use the layers independently or together viaevaluate_testset_with_mlflow. See the Layered Architecture Guide.
Features
- Async-only API: Integrates naturally with modern async frameworks. Wrap in
asyncio.run()if you need sync. - Dual-backend tracing: Capture traces to a local temp SQLite DB (no server needed) or directly to an MLflow server.
- Run once, evaluate many: The captured
DatasetRunOutputis JSON-serializable, so you can re-evaluate historical outputs against new evaluator sets without re-running the task. - Great MLflow Integration: Traces your agent/function execution to MLflow with evaluations in the native format
- CSV/Excel Adapter: Load test cases from CSV files with evaluator configurations
- Flexible Evaluators: Built-in LLM judges, regex matchers, and easy custom evaluator creation
- Metrics per Tags/Attributes: Automatic metric calculation for each tag and attribute combination
- Type Safety: Built on plain dataclasses with full type safety throughout
Built-in Evaluators
- LLMJudge: Uses an LLM to judge correctness based on a rubric
- RegexInSourcesEvaluator: Checks if regex patterns appear in retrieved sources
- RegexInDocumentMetadataEvaluator: Checks regex in document metadata
- Custom Evaluators: Inherit from
BaseEvaluatorand implement your logic
Best Practices
Documentation
Full documentation is available at joelgotsch.github.io/ragpill/latest including:
- Installation Guide: Setup instructions
- Quickstart Tutorial: Run your first evaluation
- CSV Adapter Guide: Learn the CSV format and column meanings
- Evaluators Guide: Create custom evaluators
- MLflow Integration: Advanced MLflow usage
- API Reference: Complete API documentation
Roadmap
- Adapter for testset from CSV
- Documentation via mkdocs
- Evaluators for sources and regex
- Repeat Task Evaluations (run task multiple times and evaluate with threshold)
- Adapter for task from CSV (upload to mlflow)
- Create demo video
- CI/CD (tests, build package, publish docs)
- Global evaluators from CSV (empty input)
- Track git-commit hash in experiment
- Tests with mlflow server
- Dependency injection for llm, input_to_key functions
- pytest integration
Contributing
Contributions are welcome! Please see CONTRIBUTING.md for guidelines.
Metadata
Release files for ragpill 0.5.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ragpill-0.5.0.tar.gz | 92.1 kB | Without provenance | Details for ragpill-0.5.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ragpill-0.5.0-py3-none-any.whl | Python 3 | none | any | Details for ragpill-0.5.0-py3-none-any.whl |
Total release size: 205.9 kB
Release files / ragpill-0.5.0.tar.gz
| Download URL | ragpill-0.5.0.tar.gz |
|---|---|
| Size | 92.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0089857cbd7ace3f9ebf8afa41cfcf966702159c74cc534df5c40a584cb14a29
|
|
BLAKE2b-256 checksum How to use checksums |
ca34086927ab9bf8436cf4d946d946f3a841a17e1be5fb4e82f2ab844d0fb3bf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / ragpill-0.5.0-py3-none-any.whl
| Download URL | ragpill-0.5.0-py3-none-any.whl |
|---|---|
| Size | 113.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0d331dd91d54102a7a8ae343d4ea425077a4a2638a47fe1aaf565123a8e228d7
|
|
BLAKE2b-256 checksum How to use checksums |
63f42c40e8e4281b9a2231bd3b396a11dd21b375e1fb220ff5c1877804cfc020
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for ragpill 0.5.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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
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.