juryeval
Lightweight NLP/LLM evaluation toolkit: metrics, LLM-as-Judge, statistical significance testing, prompt robustness analysis, and a CLI.
Designed for fast smoke-tests, demos, and as a drop-in dependency for frameworks like LM Eval Harness, DeepEval, Lighteval, and LangChain.
Install
pip install juryeval
Optional extras:
| Extra | What you get |
|---|---|
[judge] |
LLM-as-Judge (openai) |
[semantic] |
Embedding similarity (sentence-transformers) |
[lmeval] |
lm-eval-harness integration |
[full] |
All metrics (sklearn, sacrebleu, transformers, torch, etc.) |
[all] |
Everything |
CLI
# Score a single output
juryeval score --question "What is 2+2?" --output "4"
# Compare two outputs
juryeval compare --question "Capital of France?" --output-a "Paris" --output-b "London"
# Evaluate a dataset
juryeval evaluate --metric classification --predictions preds.json --references refs.json
# Judge calibration
juryeval calibrate --model gpt-4
# Prompt sensitivity analysis
juryeval prompt --question "Explain AI" --num-variants 5
Input files are JSON arrays, JSONL, or plain text (one sample per line). Run juryeval <command> --help for full options.
Python API
Metrics
from juryeval import (
eval_classification, eval_translation, eval_summarization,
perplexity, flesch_kincaid, bert_score,
)
acc_f1 = eval_classification(preds=["pos", "neg"], refs=["pos", "pos"])
bleu = eval_translation(preds=["hello world"], refs=["bonjour le monde"])
rouge = eval_summarization(preds=["summary"], refs=["reference"])
ppl = perplexity("This is a sentence.")
fk = flesch_kincaid("This is easy to read.")
bs = bert_score(preds=["answer"], refs=["reference"])
LLM-as-Judge
from juryeval import PairwiseJudge, PointwiseJudge, MultiJudgeEnsemble, JudgeCalibration
# Pairwise comparison
judge = PairwiseJudge("gpt-4")
result = judge.compare(
answer_a="Paris is the capital of France.",
answer_b="It's Paris.",
question="What is the capital of France?",
)
# {"winner": "A", "score": 1.0, "reason": "..."}
# Pointwise scoring
scorer = PointwiseJudge("gpt-4")
result = scorer.score("Paris is the capital.", question="What is the capital of France?")
# {"score": 0.9, "reason": "..."}
# Multi-judge ensemble
ensemble = MultiJudgeEnsemble([
PairwiseJudge("gpt-4"),
PairwiseJudge("claude-3-opus"),
])
result = ensemble.compare(answer_a, answer_b, question)
# {"majority_winner": "A", "agreement": 0.67, ...}
# Judge calibration
cal = JudgeCalibration()
report = cal.evaluate(judge)
# {"position_bias": 0.05, "consistency": 0.95, "length_bias": 0.1, ...}
Statistical Significance
from juryeval import bootstrap_ci, compare_models
ci = bootstrap_ci(scores, num_resamples=2000)
# {"estimate": 0.72, "lower": 0.68, "upper": 0.76, "std_err": 0.02}
result = compare_models(model_a_scores, model_b_scores)
# {"win_rate": 0.65, "p_value": 0.003, "mean_a": 0.72, "mean_b": 0.68, ...}
Prompt Robustness
from juryeval import PromptVariance
pv = PromptVariance(model_fn=lambda prompt: "output")
report = pv.analyze("What is 2+2?")
# {"num_variants": 7, "output_length_mean": 5.0, "outputs": [...], ...}
Framework Integrations
| Framework | Setup |
|---|---|
| lm-eval-harness | pip install juryeval[lmeval] then from juryeval.lmeval import register_all; register_all() |
| DeepEval | pip install deepeval[juryeval] then from deepeval.metrics.juryeval import JuryEvalMetric |
| Lighteval | pip install lighteval[juryeval] then use JuryEvalPointwiseJudge / JuryEvalPairwiseJudge metrics |
| LangChain | pip install langchain[juryeval] |
See each framework's documentation for detailed usage.
Development
pip install pytest
pytest tests/ -v
License
MIT
Metadata
Release files for juryeval 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 |
|---|---|---|---|---|
| juryeval-0.5.0.tar.gz | 24.8 kB | Without provenance | Details for juryeval-0.5.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| juryeval-0.5.0-py3-none-any.whl | Python 3 | none | any | Details for juryeval-0.5.0-py3-none-any.whl |
Total release size: 58.3 kB
Release files / juryeval-0.5.0.tar.gz
| Download URL | juryeval-0.5.0.tar.gz |
|---|---|
| Size | 24.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cf0c1ad6738681725134d1bd50fdec5dc2d977294c3ee16f3f66901f659ebc20
|
|
BLAKE2b-256 checksum How to use checksums |
cb2c6a90680fbc01587f18720c5572e2556ec0a79477aaa6053184fd684833d7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.12
|
Release files / juryeval-0.5.0-py3-none-any.whl
| Download URL | juryeval-0.5.0-py3-none-any.whl |
|---|---|
| Size | 33.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f104233f76dc1f89c12f4580d2f7aca99a04954a996256682d90bfde7e620997
|
|
BLAKE2b-256 checksum How to use checksums |
1c568d4064b9fd02acf8ee00794a698a521494b2f01482ce9ca198479ad5bc1f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.12
|
Security for juryeval 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.