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
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
evalspec-0.1.0.tar.gz
(15.1 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
evalspec-0.1.0-py3-none-any.whl
(19.9 kB
view details)
File details
Details for the file evalspec-0.1.0.tar.gz.
File metadata
- Download URL: evalspec-0.1.0.tar.gz
- Upload date:
- Size: 15.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.2.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5f16f6b1c885bfb6505f3dae058e0b9b38cabb5f8e27594cf7d6b16add7eca01
|
|
| MD5 |
cad1aa9b78640a34b00d20e760f75365
|
|
| BLAKE2b-256 |
93dd32cd2d21207bc72b48a063a919e4bdb18040a7765539bd037250a13c397d
|
File details
Details for the file evalspec-0.1.0-py3-none-any.whl.
File metadata
- Download URL: evalspec-0.1.0-py3-none-any.whl
- Upload date:
- Size: 19.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.2.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
91f811f2b6dfd3db8a479f6ac2bf20284cb54037770f12b820c71292b2aa0eb1
|
|
| MD5 |
a3955e8f00982744a11512d414ac0646
|
|
| BLAKE2b-256 |
334870959a9714ba6102137e2fbe18692263b843d52bc1af90cd22064c5f9768
|