Zero-config, repo-aware AI evaluation.
Project description
ai-evals
Zero-config, repo-aware, model-agnostic AI evaluation.
Status: v0.1.0 — Phases 1–4 (static analysis, scaffolding, judge gateway, golden-set bootstrapper, run execution & insights). See
.kilo/plans/New_idea.mdfor the vision and.kilo/plans/ai-evals-cli-and-system-design.mdfor the full system design.
Install
pipx install dot-ai-evals # recommended
# or, for development:
pip install -e ".[dev]"
litellm,instructor, andanyioare core dependencies — no extrajudgeextra is needed to use the judge gateway.
Quick start
ai-evals init # scan repo, scaffold eval/
ai-evals bootstrap -- pytest -q # capture real runtime traces
ai-evals run # score the suite against the golden set
ai-evals diff --against last # show metric regressions + narratives
Run ai-evals --help to see all commands.
Ollama setup (default judge)
The default judge is the local model ollama/qwen2.5-coder:7b. Follow these steps
to set it up:
-
Install Ollama from https://ollama.com.
-
Start the local server (default port
11434):ollama serve -
Pull the default judge model:
ollama pull qwen2.5-coder:7b
-
Run as normal —
ai-evals init,ai-evals analyze, etc. use the local judge automatically.
If Ollama is unavailable, either set a cloud API key (e.g. OPENAI_API_KEY for the
regression judge openai/gpt-4o-mini) or fall back to the rules-based rubric
engine (detection/scaffolding only — no judge calls):
ai-evals init --rubric-engine rules
Set a different judge with --judge-default <model> (e.g.
ollama/llama3.2:3b or openai/gpt-4o-mini). Override the judge at run time
with ai-evals run --judge <model>.
Capabilities
Phase 1 — detection & scaffolding
ai-evals init— scans a Python repo, detects OpenAI / LangChain / ChromaDB usage, writeseval/rubrics.yaml,eval/tests.py,eval/golden_set.json, and.ai-evals/.ai-evals analyze— re-runs detection, proposes a mergedrubrics.yaml.ai-evals doctor— environment + config sanity check (incl. a judge-gateway probe; the probe is optional and never forces exit 1 on its own).ai-evals config --print— show resolved configuration with source per key.
Phase 2 — model-agnostic judge gateway
ai-evals judge --list— show configured judges (default/regression_check/fallback[*]) with a best-effort reachability ping.ai-evals judge --ping <model>— one-shot reachability probe of a single model id.ai-evals judge --prompt <text> --model <m>— one-shot judge completion.- Async transport via
litellm.acompletion+instructor; content-addressed cache under.ai-evals/cache/judge/(skipped with--no-cache). Two prompt tiers — CoT (complex/frontier models) and binary checklist (local/small models) — selected fromconfig/defaults.py:COMPLEX_MODEL_HINTS(overridable viajudge.tiering.complex_modelsinrubrics.yaml). - Built-in judge metrics:
argument_accuracy,hallucination_rate,context_precision(partial: deterministic signal + judge tiebreak),faithfulness. Non-judgelatency_p50/latency_p95are computed by the runner. Custom metrics load from theai_eval.metricsentry-point group.
Phase 3 — automated golden-set bootstrapper
ai-evals bootstrap -- <command>— captures real runtime traces (one golden example per top-level task invocation; nested LLM/retrieve calls fold intotrace.calls) by monkey-patching OpenAI / LangChain / ChromaDB / Pinecone in a child subprocess via a generatedsitecustomize.py. Each framework patch is independently skippable when the framework isn't installed.- Merges into
eval/golden_set.jsonwith--append/--replace,--max, and--taskfilters. Captures are flushed even if the child crashes. Secrets in captured args/results are redacted. --no-instrumentis reserved for a future OTEL path and currently exits 2.
Phase 4 — run execution & insights
ai-evals run— re-imports task modules, calls the entry symbol per golden example, scores each metric via the judge gateway, aggregates, and saves a run record (.ai-evals/runs/<id>/run.json) + history.--fail-on-regressionexits3on threshold breaches. Fresh repos (no baseline) show—for Δ and exit 0. An unregistered metric hard-fails with exit 1 and a fix hint, even thoughinit/analyzeonly warn.ai-evals diff --against last— per-metric Δ table;--explainemits a regression-judge narrative per regressing (metric, example) (one judge call each). Falls back to a deterministic text delta when the regression judge is unavailable, so it never crashes.ai-evals report [last]— render a past run as human / json / markdown (--out <file>);--webwrites a minimal HTML file and prints afile://URL.ai-evals history [--list|--show <id>|--prune --keep N|--export <file>]— manage.ai-evals/history.json(slim records; full runs underruns/<id>/).
Exit codes
| Code | Meaning |
|---|---|
| 0 | success |
| 1 | general / runtime error |
| 2 | usage error (bad flags, missing -- command, --no-input hit a prompt) |
| 3 | evaluation failed thresholds (run --fail-on-regression) |
Development
pip install -e ".[dev]" # pytest, ruff, mypy, pytest-timeout, syrupy
ruff check . # lint (must be clean)
mypy ai_eval # typecheck (pre-existing baseline errors only)
pytest -q --timeout=30 # full suite (fake judge transport — no network)
The test suite uses a fake async judge transport and stubbed frameworks, so it
runs fully offline in ~3s. The end-to-end test
(tests/test_e2e.py) exercises init → bootstrap → run → diff against a
scratch repo and asserts the golden set is populated, a run record is written,
and a regression delta is detected.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
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
File details
Details for the file dot_ai_evals-0.1.1.tar.gz.
File metadata
- Download URL: dot_ai_evals-0.1.1.tar.gz
- Upload date:
- Size: 326.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
914ba49b0239925d361ec68afd30c90a16aeaf956e6df231bb792afec6c74040
|
|
| MD5 |
b0da1b47000c26138ef33b5985572060
|
|
| BLAKE2b-256 |
779647ec921ef59e7f9b38badcc383de0e53ef0c6afdd3e2aea518471df1b600
|
File details
Details for the file dot_ai_evals-0.1.1-py3-none-any.whl.
File metadata
- Download URL: dot_ai_evals-0.1.1-py3-none-any.whl
- Upload date:
- Size: 159.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6be04d98a44926c5e74cbd5df9c535273df760a5eabbb1a07733deed30e6b7c4
|
|
| MD5 |
4635d5c578ae0a644964764be963fa45
|
|
| BLAKE2b-256 |
03022a76e0c670ed818225d90ef2a3553746dbcd724ad4630f023befd707f647
|