ragjudge
Typed, async evals for RAG pipelines — the Python package. TypeScript port at packages/js.
Install
pip install ragjudge # core (pydantic + httpx + rich)
pip install "ragjudge[openai]" # + OpenAI judge
pip install "ragjudge[anthropic]" # + Anthropic judge
Requires Python 3.10+. Strict-typed end to end.
60-second quickstart
import asyncio
from ragjudge import (
Sample, Suite, ContextRelevance, Faithfulness, AnswerRelevance,
)
from ragjudge.judges.openai import OpenAIJudge
samples = [
Sample(
question="What is the capital of France?",
contexts=["Paris is the capital of France."],
answer="Paris.",
),
]
suite = Suite(
name="my-rag",
metrics=[ContextRelevance(), Faithfulness(), AnswerRelevance()],
judge=OpenAIJudge(model="gpt-4o-mini"),
)
report = asyncio.run(suite.run(samples))
print(f"{report.passed_count}/{report.total} passed")
CLI
ragjudge run samples.jsonl \
--judge openai \
--model gpt-4o-mini \
--metrics context_relevance,faithfulness,answer_relevance \
--report-out report.json \
--fail-under 0.8
Each line of samples.jsonl is a Sample — see examples/samples.jsonl.
Metrics
| Metric | What it catches | Threshold default |
|---|---|---|
context_relevance |
Retriever pulling unrelated chunks | 0.7 |
faithfulness |
Hallucination — claims not grounded in context | 0.8 |
answer_relevance |
Answer that misses the question | 0.7 |
answer_correctness |
Semantic drift from a reference answer | 0.7 |
Custom judge
Anything matching this shape is a judge — Judge is a runtime_checkable Protocol, no inheritance needed:
class MyJudge:
async def judge(self, prompt: str, schema: dict) -> "JudgeResponse":
...
Custom metric
from ragjudge import Judge, Metric, Sample, Score
class MyMetric:
name = "my_metric"
threshold = 0.5
async def score(self, sample: Sample, judge: Judge) -> Score:
...
Pass instances of it to Suite(metrics=[...]). That's it.
License
MIT.
Metadata
Release files for ragjudge 0.1.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 |
|---|---|---|---|---|
| ragjudge-0.1.0.tar.gz | 14.0 kB | Without provenance | Details for ragjudge-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ragjudge-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for ragjudge-0.1.0-py3-none-any.whl |
Total release size: 32.6 kB
Release files / ragjudge-0.1.0.tar.gz
| Download URL | ragjudge-0.1.0.tar.gz |
|---|---|
| Size | 14.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
41f4cf13c8ddcb01fde06a923aa3deb8ef590588e16dd907d420c1f4a4f050f5
|
|
BLAKE2b-256 checksum How to use checksums |
6d8de96f88042125aeda0eebecbe18c131038ece3eea08c5eb60ef7e0b7ef43d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.6
|
Release files / ragjudge-0.1.0-py3-none-any.whl
| Download URL | ragjudge-0.1.0-py3-none-any.whl |
|---|---|
| Size | 18.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f4be1c23cc836a6ca94aa72a11323fb129ca65d48b2ff6a584a6c9fa3414f009
|
|
BLAKE2b-256 checksum How to use checksums |
0b35564381b6c748c7fe3fd8f3a17bb5852ce0ac0a60ca2e128c14849f0bacc6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.6
|
Security for ragjudge 0.1.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.