Verdict
A/B testing for LLMs. Statistical proof, not vibes.
Verdict is a Python framework for systematically comparing large language models with statistical rigor. Instead of picking models based on gut feeling, verdict helps you make data-driven decisions using rigorous experimental design and statistical analysis.
Features
- 🧪 Parallel A/B Testing — Run multiple model variants concurrently on the same queries
- 📊 Statistical Analysis — Built-in significance testing using scipy
- 💰 Cost Tracking — Monitor and compare inference costs across models
- 🎯 LLM Judge Scoring — Automatic evaluation using GPT-4o-mini with custom criteria
- ⚡ Performance Metrics — Track latency, tokens, and costs
- 📈 Variant Comparison — Side-by-side results with statistical significance
Installation
pip install llm-arbiter
Quick Start
from verdict import Experiment, Variant, Judge
# Define model variants to test
variants = [
Variant(
name="gpt-4o",
fn=call_model,
config={"model": "gpt-4o"},
model="gpt-4o"
),
Variant(
name="gpt-4o-mini",
fn=call_model,
config={"model": "gpt-4o-mini"},
model="gpt-4o-mini"
),
]
# Create an experiment
experiment = Experiment(
queries=["What is X?", "Explain Y"],
variants=variants,
)
# Run the experiment
results = experiment.run()
# Analyze results with optional LLM judge
judge = Judge(criteria=[
"Does it cite specific numbers?",
"Is the analysis correct?",
])
analysis = experiment.analyze(judge=judge)
print(analysis.summary())
Core Components
Variant
Represents a single model configuration being tested.
Variant(
name="gpt-4o",
fn=call_model, # (config, query) → str or dict
config={"model": "gpt-4o"}, # Passed to fn
model="gpt-4o", # For pricing lookup
pricing={"input": 2.50/1_000_000, "output": 10.00/1_000_000} # Optional override
)
Experiment
Defines and runs the test across all variants.
- queries: List of queries to test
- variants: List of Variant objects
- num_workers: Parallel execution threads (default: auto)
Judge
Scores model outputs using GPT-4o-mini based on custom criteria.
judge = Judge(
criteria=["Is it accurate?", "Does it cite sources?"],
model="gpt-4o-mini" # Can override
)
Analysis
Statistical results after running the experiment.
- RunResult: Individual execution data (latency, tokens, cost, score)
- summary(): Display results with significance testing
Supported Models & Pricing
Pre-configured pricing for OpenAI models:
gpt-4ogpt-4o-minigpt-4.1gpt-4.1-minigpt-4.1-nanoo3-mini
Custom pricing can be specified per variant.
Example: Market Research Analysis
See test.py for a complete example comparing models on market research questions.
Requirements
- Python 3.9+
- numpy >= 1.24
- scipy >= 1.10
- openai >= 1.0
Environment Variables
Set your OpenAI API key:
export OPENAI_API_KEY="sk-..."
License
MIT
Contributing
Contributions welcome! This project uses statistical rigor—pull requests should include validation.
Metadata
Release files for llm-arbiter 0.1.1
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 | |
|---|---|---|---|---|
| llm_arbiter-0.1.1.tar.gz | 9.3 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| llm_arbiter-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 19.6 kB
Release files / llm_arbiter-0.1.1.tar.gz
| Download URL | llm_arbiter-0.1.1.tar.gz |
|---|---|
| Size | 9.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4101df1a38246d38a946321ee6ee935fa0de48f7f4530f4209740a1da59b9610
|
|
BLAKE2b-256 checksum How to use checksums |
1f09f8eb0afd56bd4b157f98434c6d41d08912ebc56941c5958346df6332b809
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.5
|
Release files / llm_arbiter-0.1.1-py3-none-any.whl
| Download URL | llm_arbiter-0.1.1-py3-none-any.whl |
|---|---|
| Size | 10.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9240bd6f025188df646f1a8e66df3558ac738d961d9be8095b83e68d2335b959
|
|
BLAKE2b-256 checksum How to use checksums |
71f4e8b61fb45cef4b09d0c11875fedf6f03d23ce522949a059fb8154d230e5f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.5
|
Security for llm-arbiter 0.1.1
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.