evalspec
Gold-label evaluation framework for LLM agents. Measure what your model actually does, track it over time, and catch regressions before they ship.
Quick start
pip install evalspec
# Create a dataset
cat > datasets/analytics.yaml <<EOF
questions:
- id: Q-001
question: "How many swaps happened last quarter?"
gold_answer: "tool_call"
expected_tool: "get_swap_counts"
expected_behaviour: "answer_with_citation"
language: EN
EOF
# Run against OpenAI
export OPENAI_API_KEY="sk-..."
evalspec-run --all --provider openai --model gpt-4o --tag baseline-v1
# Record baseline and check for regressions
evalspec-regression --record baselines/gpt4o.json --provider openai --model gpt-4o
evalspec-regression --check baselines/gpt4o.json --provider openai --model gpt-4o
Gold labels
Every question gets a gold_answer that defines correct behavior:
| Label | Meaning | Measured by |
|---|---|---|
ABSTAIN |
Model must refuse | was_refused=True |
CLARIFY |
Model must ask for clarification | asked_clarification=True |
tool_call |
Model must call the expected tool | expected_tool in called tools |
Agents
| Provider | Flag | Environment |
|---|---|---|
| OpenAI | --provider openai --model gpt-4o |
OPENAI_API_KEY |
| opencode | --provider opencode --model deepseek |
opencode CLI |
| Mock | --mock --mock-mode perfect |
None |
| HTTP | --agent-url http://localhost:8080 |
None |
CLI tools
| Command | Purpose |
|---|---|
evalspec-run |
Run evaluation harness |
evalspec-split |
80/20 stratified holdout split |
evalspec-compare |
Side-by-side model comparison |
evalspec-regression |
CI regression gate |
evalspec-leakage |
Parametric leakage filter |
Model comparison
evalspec-run --all --provider openai --model gpt-4o --tag gpt4o --report runs/gpt4o.json
evalspec-run --all --provider openai --model gpt-4o-mini --tag gpt4o-mini --report runs/gpt4o-mini.json
evalspec-compare runs/gpt4o.json runs/gpt4o-mini.json --html compare.html
CI gate
# .github/workflows/eval.yml
on: [pull_request]
jobs:
eval:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: pip install evalspec openai pyyaml
- run: evalspec-regression --check baselines/gpt4o.json -p openai --model gpt-4o
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
Philosophy
- Gold labels, not heuristics: Every question defines what "correct" means (refuse, clarify, or call a specific tool).
- Version-frozen: Reports include dataset hashes so you know exactly which corpus a score refers to.
- Held-out split: 80/20 stratified split prevents overfitting to the eval set.
- CI-gated: 3% regression tolerance means prompt or model changes don't silently degrade quality.
License
MIT
Metadata
Release files for evalspec 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 |
|---|---|---|---|---|
| evalspec-0.1.0.tar.gz | 15.1 kB | Without provenance | Details for evalspec-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| evalspec-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for evalspec-0.1.0-py3-none-any.whl |
Total release size: 35.0 kB
Release files / evalspec-0.1.0.tar.gz
| Download URL | evalspec-0.1.0.tar.gz |
|---|---|
| Size | 15.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5f16f6b1c885bfb6505f3dae058e0b9b38cabb5f8e27594cf7d6b16add7eca01
|
|
BLAKE2b-256 checksum How to use checksums |
93dd32cd2d21207bc72b48a063a919e4bdb18040a7765539bd037250a13c397d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.3
|
Release files / evalspec-0.1.0-py3-none-any.whl
| Download URL | evalspec-0.1.0-py3-none-any.whl |
|---|---|
| Size | 19.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
91f811f2b6dfd3db8a479f6ac2bf20284cb54037770f12b820c71292b2aa0eb1
|
|
BLAKE2b-256 checksum How to use checksums |
334870959a9714ba6102137e2fbe18692263b843d52bc1af90cd22064c5f9768
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.3
|
Security for evalspec 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.