Failure case analysis in the era of LLM.
Project description
EvalVitals
EvalVitals is an sklearn-like toolkit for failure-case analysis in the era of
LLMs, VLMs, omni (text+image+audio+video) models, and agentic systems. Model
identity (ModelSpec) is separate from runtime (Backend); analyzers
(Analyzer) connect to models by capability matching (Capability), so the
same spec runs through a black-box API or a white-box local backend — only
the capability set changes.
| Contract | Role |
|---|---|
ModelSpec |
Model identity: family, HF repo, architecture traits, modalities. |
Backend |
Runtime: local HF internals, black-box API, or offline batch engines. |
Model |
A runnable object with generate() and forward(capture=...) -> Trace. |
Analyzer |
An sklearn-style estimator: Analyzer(**params).run(model, data) -> Result. |
Capability |
Vocabulary matching analyzers to compatible model runtimes. |
FailureCase |
Central data unit for prompts, labels, provenance, agent trajectories. |
Result |
Uniform output: human-readable summary + structured findings. |
What's Inside
EvalVitals covers three layers of the analysis workflow, usable independently or chained into one automated loop:
- Analyzer toolkit — 26 registered analyzers (attention, uncertainty,
hallucination, Shapley attribution, logit lens, representation geometry,
agent-trajectory analysis) run against any model/backend pair through the
same
Analyzer(**params).run(model, data) -> Resultcall shape. See the Demo below and the Analyzer Zoo. - Data analysis agent (M2/M3) —
evalvitals explorepoints a coding agent at a raw results directory (any JSON/JSONL shape, no host-side parsing) and gets back descriptive takeaways, charts, and 1-3 falsifiable hypotheses — no code required. See Exploratory Analysis (M2/M3). - Intervention (M4/M5) —
HypothesisTesterverifies a hypothesis statistically and against the stated experiment protocol;FixAgentthen proposes and validates candidate repairs (prompt → scaffold → internals → parameter space) against the unmodified baseline with paired McNemar + e-value. See Intervention & Verification (M4/M5).
VLDiagnoseLoop chains all three (M1→M2→M3→M5, M4 post-loop) into one
automated failure-attribution pipeline — see Quickstart.
Demo
Relative attention on a VLM — "MLLMs Know Where to Look" (code):
from PIL import Image
from evalvitals import compose, Capability
from evalvitals.analyzers.attention import RelativeAttentionAnalyzer
from evalvitals.core.case import Inputs
# Load Qwen2.5-VL with white-box attention capture
model = compose("qwen2.5-vl-7b-instruct", "hf_local", want={Capability.ATTENTION})
# Run relative attention: ratio of task-specific vs generic image attention
result = RelativeAttentionAnalyzer(layer=22, top_k=5).run(
model,
Inputs(prompt="What color is the car?", image=Image.open("scene.jpg")),
)
print(result.summary()) # agent-readable findings
result.plot() # (H, W) heatmap — requires evalvitals[viz]
The same call shape works for any registered model/analyzer pair — a plain
text LLM, a config-driven YAML run, or an explicit backend — see
Quickstart for those and for the automated
failure-attribution loop (VLDiagnoseLoop, M1→M2→M3→M5) and no-code
exploratory analysis (evalvitals explore).
Install
pip install -e .
pip install -e ".[viz]"
pip install -e ".[dev]"
Documentation
- Docs overview
- Quickstart — runnable examples for every entry point, the diagnosis loop, and submitting a run
- Exploratory Analysis (M2/M3) — standalone
evalvitals explore - Intervention & Verification (M4/M5) —
HypothesisTesterverification,FixAgenttiered repair - Analyzer Zoo — reference tables of analyzers and registered models
- Architecture — package structure and design contracts
- Extending EvalVitals — add analyzers, specs, backends
- Roadmap
Examples
Each directory under examples/ is a self-contained, runnable demo:
cd examples/analyzer_demos/qwen_attention && docker compose up # attention analysis on a text LLM
cd examples/m2_statistics/deco_hallu_explore && docker compose up # M2/M3 explore, real M1 data
cd examples/m2_statistics/deco_hallu_explore && bash run_attn.sh # ... attention-enriched: FAIL/PASS distributions + cross-checkpoint geometry (no GPU; data ships with the repo)
cd examples/m2_statistics/deco_hallu_explore && bash run_attn_pipeline.sh # ... FULL held-out pipeline: propose → held-out test + LLM judge → L1..L3b fix → one 4-tab report (SKIP_FIX=1 for the no-GPU half)
cd examples/diagnosis_loops/qwen_loop_agy && docker compose up # VLDiagnoseLoop M1→M5 (VLM)
See examples/README.md for the full list, grouped by
layer (single analyzers, standalone M2/M3, full diagnosis loop).
Project details
Release history Release notifications | RSS feed
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 evalvitals-0.1.0.tar.gz.
File metadata
- Download URL: evalvitals-0.1.0.tar.gz
- Upload date:
- Size: 523.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a6913a9319aaaf9d618f6bd84ffd04147c6a566ae4e680c2eb02749680387f0b
|
|
| MD5 |
df16cf55595648b50d0684802e231714
|
|
| BLAKE2b-256 |
d759e668830d494c69fbc7337fea82ca867fc4feef8e1341189202709fb74098
|
Provenance
The following attestation bundles were made for evalvitals-0.1.0.tar.gz:
Publisher:
release.yml on evalvitals/evalvitals
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
evalvitals-0.1.0.tar.gz -
Subject digest:
a6913a9319aaaf9d618f6bd84ffd04147c6a566ae4e680c2eb02749680387f0b - Sigstore transparency entry: 2141653825
- Sigstore integration time:
-
Permalink:
evalvitals/evalvitals@4b75b185c92c48fabd5e3ba6b8c99e6501d5c29d -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/evalvitals
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@4b75b185c92c48fabd5e3ba6b8c99e6501d5c29d -
Trigger Event:
push
-
Statement type:
File details
Details for the file evalvitals-0.1.0-py3-none-any.whl.
File metadata
- Download URL: evalvitals-0.1.0-py3-none-any.whl
- Upload date:
- Size: 636.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7ec494955ccf411324843d9a18ed34fba897d9f8266557eec157f94f176b40b8
|
|
| MD5 |
c0e706f05bb06eb3d56612d061327107
|
|
| BLAKE2b-256 |
97a576f90b15042bae30b45e3302237c2c610208693af5c76d99b8741bda22cf
|
Provenance
The following attestation bundles were made for evalvitals-0.1.0-py3-none-any.whl:
Publisher:
release.yml on evalvitals/evalvitals
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
evalvitals-0.1.0-py3-none-any.whl -
Subject digest:
7ec494955ccf411324843d9a18ed34fba897d9f8266557eec157f94f176b40b8 - Sigstore transparency entry: 2141653837
- Sigstore integration time:
-
Permalink:
evalvitals/evalvitals@4b75b185c92c48fabd5e3ba6b8c99e6501d5c29d -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/evalvitals
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@4b75b185c92c48fabd5e3ba6b8c99e6501d5c29d -
Trigger Event:
push
-
Statement type: