evalvitals 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (244) hide show
  1. evalvitals-0.1.0/LICENSE +121 -0
  2. evalvitals-0.1.0/PKG-INFO +300 -0
  3. evalvitals-0.1.0/README.md +111 -0
  4. evalvitals-0.1.0/evalvitals/__init__.py +112 -0
  5. evalvitals-0.1.0/evalvitals/agent_assets/__init__.py +2 -0
  6. evalvitals-0.1.0/evalvitals/agent_assets/skills/README.md +28 -0
  7. evalvitals-0.1.0/evalvitals/agent_assets/skills/eval-chart-style/SKILL.md +113 -0
  8. evalvitals-0.1.0/evalvitals/agent_assets/skills/evalvitals-report-ui/SKILL.md +116 -0
  9. evalvitals-0.1.0/evalvitals/agent_assets/skills/nature-figure/LICENSE +201 -0
  10. evalvitals-0.1.0/evalvitals/agent_assets/skills/nature-figure/README.md +400 -0
  11. evalvitals-0.1.0/evalvitals/agent_assets/skills/nature-figure/SKILL.md +60 -0
  12. evalvitals-0.1.0/evalvitals/agent_assets/skills/nature-figure/manifest.yaml +59 -0
  13. evalvitals-0.1.0/evalvitals/agent_assets/skills/nature-figure/references/api.md +428 -0
  14. evalvitals-0.1.0/evalvitals/agent_assets/skills/nature-figure/references/backend-selection.md +100 -0
  15. evalvitals-0.1.0/evalvitals/agent_assets/skills/nature-figure/references/chart-types.md +281 -0
  16. evalvitals-0.1.0/evalvitals/agent_assets/skills/nature-figure/references/common-patterns.md +350 -0
  17. evalvitals-0.1.0/evalvitals/agent_assets/skills/nature-figure/references/demos.md +65 -0
  18. evalvitals-0.1.0/evalvitals/agent_assets/skills/nature-figure/references/design-theory.md +436 -0
  19. evalvitals-0.1.0/evalvitals/agent_assets/skills/nature-figure/references/figure-contract.md +93 -0
  20. evalvitals-0.1.0/evalvitals/agent_assets/skills/nature-figure/references/figure-legend-conventions.md +71 -0
  21. evalvitals-0.1.0/evalvitals/agent_assets/skills/nature-figure/references/nature-2026-observations.md +112 -0
  22. evalvitals-0.1.0/evalvitals/agent_assets/skills/nature-figure/references/qa-contract.md +119 -0
  23. evalvitals-0.1.0/evalvitals/agent_assets/skills/nature-figure/references/r-template-index.md +66 -0
  24. evalvitals-0.1.0/evalvitals/agent_assets/skills/nature-figure/references/r-workflow.md +161 -0
  25. evalvitals-0.1.0/evalvitals/agent_assets/skills/nature-figure/references/tutorials.md +251 -0
  26. evalvitals-0.1.0/evalvitals/agent_assets/skills/nature-figure/static/core/contract.md +29 -0
  27. evalvitals-0.1.0/evalvitals/agent_assets/skills/nature-figure/static/core/stance.md +37 -0
  28. evalvitals-0.1.0/evalvitals/agent_assets/skills/nature-figure/static/fragments/backend/python.md +37 -0
  29. evalvitals-0.1.0/evalvitals/agent_assets/skills/nature-figure/static/fragments/backend/r.md +44 -0
  30. evalvitals-0.1.0/evalvitals/agent_assets/skills/outcome-driver-analysis/SKILL.md +202 -0
  31. evalvitals-0.1.0/evalvitals/agent_assets/skills/outcome-driver-analysis/assets/analysis_report_template.md +53 -0
  32. evalvitals-0.1.0/evalvitals/agent_assets/skills/outcome-driver-analysis/references/model_selection.md +72 -0
  33. evalvitals-0.1.0/evalvitals/agent_assets/skills/outcome-driver-analysis/scripts/explanatory_var_eda.R +130 -0
  34. evalvitals-0.1.0/evalvitals/agent_assets/skills/outcome-driver-analysis/scripts/explanatory_var_eda.py +150 -0
  35. evalvitals-0.1.0/evalvitals/agent_assets/skills/outcome-driver-analysis/scripts/fit_outcome_model.R +181 -0
  36. evalvitals-0.1.0/evalvitals/agent_assets/skills/outcome-driver-analysis/scripts/fit_outcome_model.py +186 -0
  37. evalvitals-0.1.0/evalvitals/agent_assets/skills/outcome-driver-analysis/scripts/univariate_eda.R +149 -0
  38. evalvitals-0.1.0/evalvitals/agent_assets/skills/outcome-driver-analysis/scripts/univariate_eda.py +177 -0
  39. evalvitals-0.1.0/evalvitals/agent_assets/skills.py +27 -0
  40. evalvitals-0.1.0/evalvitals/analysis/__init__.py +107 -0
  41. evalvitals-0.1.0/evalvitals/analysis/adjudicate.py +154 -0
  42. evalvitals-0.1.0/evalvitals/analysis/cli.py +114 -0
  43. evalvitals-0.1.0/evalvitals/analysis/dashboard.py +206 -0
  44. evalvitals-0.1.0/evalvitals/analysis/dashboard_app.py +3283 -0
  45. evalvitals-0.1.0/evalvitals/analysis/eval_case_matrix.py +118 -0
  46. evalvitals-0.1.0/evalvitals/analysis/eval_viz_theme.py +785 -0
  47. evalvitals-0.1.0/evalvitals/analysis/explore_run.py +223 -0
  48. evalvitals-0.1.0/evalvitals/analysis/explorer.py +1101 -0
  49. evalvitals-0.1.0/evalvitals/analysis/fused_pipeline.py +489 -0
  50. evalvitals-0.1.0/evalvitals/analysis/hypothesis_agent.py +187 -0
  51. evalvitals-0.1.0/evalvitals/analysis/operationalize.py +442 -0
  52. evalvitals-0.1.0/evalvitals/analysis/planner.py +165 -0
  53. evalvitals-0.1.0/evalvitals/analysis/profile.py +268 -0
  54. evalvitals-0.1.0/evalvitals/analysis/stats_agent.py +8 -0
  55. evalvitals-0.1.0/evalvitals/analysis/stats_tools.py +25 -0
  56. evalvitals-0.1.0/evalvitals/analyzers/__init__.py +39 -0
  57. evalvitals-0.1.0/evalvitals/analyzers/agent/__init__.py +13 -0
  58. evalvitals-0.1.0/evalvitals/analyzers/agent/counterfactual.py +81 -0
  59. evalvitals-0.1.0/evalvitals/analyzers/agent/first_error_judge.py +92 -0
  60. evalvitals-0.1.0/evalvitals/analyzers/agent/ignored_obs.py +77 -0
  61. evalvitals-0.1.0/evalvitals/analyzers/agent/loop_detect.py +75 -0
  62. evalvitals-0.1.0/evalvitals/analyzers/attention/__init__.py +19 -0
  63. evalvitals-0.1.0/evalvitals/analyzers/attention/relative_attn.py +607 -0
  64. evalvitals-0.1.0/evalvitals/analyzers/attention/rollout.py +73 -0
  65. evalvitals-0.1.0/evalvitals/analyzers/attention/sink.py +56 -0
  66. evalvitals-0.1.0/evalvitals/analyzers/attention/summary.py +190 -0
  67. evalvitals-0.1.0/evalvitals/analyzers/attribution/__init__.py +6 -0
  68. evalvitals-0.1.0/evalvitals/analyzers/attribution/generic_attn.py +31 -0
  69. evalvitals-0.1.0/evalvitals/analyzers/attribution/gradcam.py +30 -0
  70. evalvitals-0.1.0/evalvitals/analyzers/base.py +12 -0
  71. evalvitals-0.1.0/evalvitals/analyzers/geometry/__init__.py +6 -0
  72. evalvitals-0.1.0/evalvitals/analyzers/geometry/cka.py +70 -0
  73. evalvitals-0.1.0/evalvitals/analyzers/geometry/linear_probe.py +157 -0
  74. evalvitals-0.1.0/evalvitals/analyzers/hallucination/__init__.py +8 -0
  75. evalvitals-0.1.0/evalvitals/analyzers/hallucination/chair.py +75 -0
  76. evalvitals-0.1.0/evalvitals/analyzers/hallucination/opera.py +26 -0
  77. evalvitals-0.1.0/evalvitals/analyzers/hallucination/pope.py +107 -0
  78. evalvitals-0.1.0/evalvitals/analyzers/hallucination/vcd.py +26 -0
  79. evalvitals-0.1.0/evalvitals/analyzers/lens/__init__.py +6 -0
  80. evalvitals-0.1.0/evalvitals/analyzers/lens/logit_lens.py +130 -0
  81. evalvitals-0.1.0/evalvitals/analyzers/lens/tuned_lens.py +30 -0
  82. evalvitals-0.1.0/evalvitals/analyzers/patching/__init__.py +5 -0
  83. evalvitals-0.1.0/evalvitals/analyzers/patching/causal_trace.py +30 -0
  84. evalvitals-0.1.0/evalvitals/analyzers/perturbation/__init__.py +8 -0
  85. evalvitals-0.1.0/evalvitals/analyzers/perturbation/_shapley.py +54 -0
  86. evalvitals-0.1.0/evalvitals/analyzers/perturbation/mm_shap.py +97 -0
  87. evalvitals-0.1.0/evalvitals/analyzers/perturbation/prompt_contrast.py +244 -0
  88. evalvitals-0.1.0/evalvitals/analyzers/perturbation/rise.py +94 -0
  89. evalvitals-0.1.0/evalvitals/analyzers/perturbation/vl_shap.py +99 -0
  90. evalvitals-0.1.0/evalvitals/analyzers/uncertainty/__init__.py +14 -0
  91. evalvitals-0.1.0/evalvitals/analyzers/uncertainty/entropy.py +90 -0
  92. evalvitals-0.1.0/evalvitals/analyzers/uncertainty/logprob_entropy.py +69 -0
  93. evalvitals-0.1.0/evalvitals/analyzers/uncertainty/self_consistency.py +64 -0
  94. evalvitals-0.1.0/evalvitals/analyzers/uncertainty/verbalized_conf.py +64 -0
  95. evalvitals-0.1.0/evalvitals/cli.py +123 -0
  96. evalvitals-0.1.0/evalvitals/config.py +77 -0
  97. evalvitals-0.1.0/evalvitals/core/__init__.py +85 -0
  98. evalvitals-0.1.0/evalvitals/core/analyzer.py +129 -0
  99. evalvitals-0.1.0/evalvitals/core/capability.py +54 -0
  100. evalvitals-0.1.0/evalvitals/core/case.py +320 -0
  101. evalvitals-0.1.0/evalvitals/core/experiment.py +106 -0
  102. evalvitals-0.1.0/evalvitals/core/model.py +198 -0
  103. evalvitals-0.1.0/evalvitals/core/pipeline.py +42 -0
  104. evalvitals-0.1.0/evalvitals/core/registry.py +142 -0
  105. evalvitals-0.1.0/evalvitals/core/result.py +64 -0
  106. evalvitals-0.1.0/evalvitals/core/spec.py +155 -0
  107. evalvitals-0.1.0/evalvitals/core/tokentype.py +165 -0
  108. evalvitals-0.1.0/evalvitals/core/tool.py +66 -0
  109. evalvitals-0.1.0/evalvitals/datasets/__init__.py +41 -0
  110. evalvitals-0.1.0/evalvitals/datasets/base.py +68 -0
  111. evalvitals-0.1.0/evalvitals/datasets/gui_os.py +52 -0
  112. evalvitals-0.1.0/evalvitals/datasets/llm_qa.py +57 -0
  113. evalvitals-0.1.0/evalvitals/datasets/pure_qa.py +12 -0
  114. evalvitals-0.1.0/evalvitals/datasets/vlm_qa.py +695 -0
  115. evalvitals-0.1.0/evalvitals/datasets/web_search_qa.py +52 -0
  116. evalvitals-0.1.0/evalvitals/eval_agent/__init__.py +315 -0
  117. evalvitals-0.1.0/evalvitals/eval_agent/_docker_runner.py +89 -0
  118. evalvitals-0.1.0/evalvitals/eval_agent/_tools.py +81 -0
  119. evalvitals-0.1.0/evalvitals/eval_agent/ab_runner.py +50 -0
  120. evalvitals-0.1.0/evalvitals/eval_agent/cli_agent.py +56 -0
  121. evalvitals-0.1.0/evalvitals/eval_agent/cli_runtime.py +97 -0
  122. evalvitals-0.1.0/evalvitals/eval_agent/cli_skills.py +5 -0
  123. evalvitals-0.1.0/evalvitals/eval_agent/cli_transcript.py +138 -0
  124. evalvitals-0.1.0/evalvitals/eval_agent/cli_types.py +63 -0
  125. evalvitals-0.1.0/evalvitals/eval_agent/codegen/__init__.py +5 -0
  126. evalvitals-0.1.0/evalvitals/eval_agent/codegen/runner.py +88 -0
  127. evalvitals-0.1.0/evalvitals/eval_agent/evolution.py +396 -0
  128. evalvitals-0.1.0/evalvitals/eval_agent/experiment_harness.py +117 -0
  129. evalvitals-0.1.0/evalvitals/eval_agent/factory.py +102 -0
  130. evalvitals-0.1.0/evalvitals/eval_agent/git_manager.py +215 -0
  131. evalvitals-0.1.0/evalvitals/eval_agent/hypothesis.py +128 -0
  132. evalvitals-0.1.0/evalvitals/eval_agent/log_schema.py +332 -0
  133. evalvitals-0.1.0/evalvitals/eval_agent/loop.py +1741 -0
  134. evalvitals-0.1.0/evalvitals/eval_agent/models/__init__.py +6 -0
  135. evalvitals-0.1.0/evalvitals/eval_agent/models/agy.py +144 -0
  136. evalvitals-0.1.0/evalvitals/eval_agent/models/claude.py +114 -0
  137. evalvitals-0.1.0/evalvitals/eval_agent/nl_runner.py +460 -0
  138. evalvitals-0.1.0/evalvitals/eval_agent/orchestrator.py +61 -0
  139. evalvitals-0.1.0/evalvitals/eval_agent/preregister.py +93 -0
  140. evalvitals-0.1.0/evalvitals/eval_agent/prompts/__init__.py +1 -0
  141. evalvitals-0.1.0/evalvitals/eval_agent/prompts/case_discovery.py +25 -0
  142. evalvitals-0.1.0/evalvitals/eval_agent/prompts/diagnosis.py +48 -0
  143. evalvitals-0.1.0/evalvitals/eval_agent/prompts/experiment_writer.py +253 -0
  144. evalvitals-0.1.0/evalvitals/eval_agent/prompts/explorer.py +319 -0
  145. evalvitals-0.1.0/evalvitals/eval_agent/prompts/fix_agent.py +124 -0
  146. evalvitals-0.1.0/evalvitals/eval_agent/prompts/hypothesis_tester.py +15 -0
  147. evalvitals-0.1.0/evalvitals/eval_agent/prompts/nl_runner.py +35 -0
  148. evalvitals-0.1.0/evalvitals/eval_agent/prompts/probe_agent.py +25 -0
  149. evalvitals-0.1.0/evalvitals/eval_agent/prompts/probe_generator.py +35 -0
  150. evalvitals-0.1.0/evalvitals/eval_agent/prompts/stats_agent.py +44 -0
  151. evalvitals-0.1.0/evalvitals/eval_agent/prompts/stats_tool_generator.py +43 -0
  152. evalvitals-0.1.0/evalvitals/eval_agent/prompts/whitebox_probe_generator.py +38 -0
  153. evalvitals-0.1.0/evalvitals/eval_agent/providers/__init__.py +21 -0
  154. evalvitals-0.1.0/evalvitals/eval_agent/providers/antigravity.py +27 -0
  155. evalvitals-0.1.0/evalvitals/eval_agent/providers/base.py +97 -0
  156. evalvitals-0.1.0/evalvitals/eval_agent/providers/claude_code.py +39 -0
  157. evalvitals-0.1.0/evalvitals/eval_agent/providers/codex.py +33 -0
  158. evalvitals-0.1.0/evalvitals/eval_agent/providers/gemini_cli.py +26 -0
  159. evalvitals-0.1.0/evalvitals/eval_agent/providers/kimi_cli.py +27 -0
  160. evalvitals-0.1.0/evalvitals/eval_agent/providers/opencode.py +27 -0
  161. evalvitals-0.1.0/evalvitals/eval_agent/providers/registry.py +58 -0
  162. evalvitals-0.1.0/evalvitals/eval_agent/report.py +58 -0
  163. evalvitals-0.1.0/evalvitals/eval_agent/run_context.py +460 -0
  164. evalvitals-0.1.0/evalvitals/eval_agent/run_log.schema.json +717 -0
  165. evalvitals-0.1.0/evalvitals/eval_agent/run_logger.py +1454 -0
  166. evalvitals-0.1.0/evalvitals/eval_agent/sandbox.py +517 -0
  167. evalvitals-0.1.0/evalvitals/eval_agent/skills/__init__.py +19 -0
  168. evalvitals-0.1.0/evalvitals/eval_agent/skills/installer.py +68 -0
  169. evalvitals-0.1.0/evalvitals/eval_agent/skills/prompt_policy.py +85 -0
  170. evalvitals-0.1.0/evalvitals/eval_agent/skills/resolver.py +19 -0
  171. evalvitals-0.1.0/evalvitals/eval_agent/stages/__init__.py +49 -0
  172. evalvitals-0.1.0/evalvitals/eval_agent/stages/analysis.py +316 -0
  173. evalvitals-0.1.0/evalvitals/eval_agent/stages/case_discovery.py +222 -0
  174. evalvitals-0.1.0/evalvitals/eval_agent/stages/diagnosis.py +571 -0
  175. evalvitals-0.1.0/evalvitals/eval_agent/stages/experiment_writer.py +1488 -0
  176. evalvitals-0.1.0/evalvitals/eval_agent/stages/fix_agent.py +1341 -0
  177. evalvitals-0.1.0/evalvitals/eval_agent/stages/fix_internals.py +209 -0
  178. evalvitals-0.1.0/evalvitals/eval_agent/stages/fix_pipeline.py +284 -0
  179. evalvitals-0.1.0/evalvitals/eval_agent/stages/fix_tiers.py +177 -0
  180. evalvitals-0.1.0/evalvitals/eval_agent/stages/fix_tools.py +629 -0
  181. evalvitals-0.1.0/evalvitals/eval_agent/stages/hypothesis_tester.py +695 -0
  182. evalvitals-0.1.0/evalvitals/eval_agent/stages/probe.py +173 -0
  183. evalvitals-0.1.0/evalvitals/eval_agent/stages/probe_agent.py +859 -0
  184. evalvitals-0.1.0/evalvitals/eval_agent/stages/probe_generator.py +302 -0
  185. evalvitals-0.1.0/evalvitals/eval_agent/stages/protocol.py +96 -0
  186. evalvitals-0.1.0/evalvitals/eval_agent/stages/stats_agent.py +856 -0
  187. evalvitals-0.1.0/evalvitals/eval_agent/stages/stats_tool_agent.py +261 -0
  188. evalvitals-0.1.0/evalvitals/eval_agent/stages/stats_tool_generator.py +407 -0
  189. evalvitals-0.1.0/evalvitals/eval_agent/stages/stats_tools.py +1114 -0
  190. evalvitals-0.1.0/evalvitals/eval_agent/stages/surgery.py +491 -0
  191. evalvitals-0.1.0/evalvitals/eval_agent/stages/whitebox_probe_generator.py +327 -0
  192. evalvitals-0.1.0/evalvitals/eval_agent/store.py +231 -0
  193. evalvitals-0.1.0/evalvitals/models/__init__.py +161 -0
  194. evalvitals-0.1.0/evalvitals/models/_discover.py +101 -0
  195. evalvitals-0.1.0/evalvitals/models/agent.py +198 -0
  196. evalvitals-0.1.0/evalvitals/models/backends/__init__.py +38 -0
  197. evalvitals-0.1.0/evalvitals/models/backends/api.py +150 -0
  198. evalvitals-0.1.0/evalvitals/models/backends/base.py +50 -0
  199. evalvitals-0.1.0/evalvitals/models/backends/hf_local.py +452 -0
  200. evalvitals-0.1.0/evalvitals/models/backends/vllm_offline.py +116 -0
  201. evalvitals-0.1.0/evalvitals/models/base.py +24 -0
  202. evalvitals-0.1.0/evalvitals/models/blackbox/__init__.py +4 -0
  203. evalvitals-0.1.0/evalvitals/models/blackbox/agent.py +31 -0
  204. evalvitals-0.1.0/evalvitals/models/blackbox/base.py +29 -0
  205. evalvitals-0.1.0/evalvitals/models/blackbox/gemini.py +79 -0
  206. evalvitals-0.1.0/evalvitals/models/blackbox/llm_api.py +17 -0
  207. evalvitals-0.1.0/evalvitals/models/blackbox/vlm_api.py +17 -0
  208. evalvitals-0.1.0/evalvitals/models/compose.py +66 -0
  209. evalvitals-0.1.0/evalvitals/models/inference.py +88 -0
  210. evalvitals-0.1.0/evalvitals/models/toolcodec.py +140 -0
  211. evalvitals-0.1.0/evalvitals/models/whitebox/__init__.py +16 -0
  212. evalvitals-0.1.0/evalvitals/models/whitebox/agent.py +31 -0
  213. evalvitals-0.1.0/evalvitals/models/whitebox/base.py +24 -0
  214. evalvitals-0.1.0/evalvitals/models/whitebox/qwen.py +61 -0
  215. evalvitals-0.1.0/evalvitals/models/whitebox/qwen_omni.py +53 -0
  216. evalvitals-0.1.0/evalvitals/models/whitebox/qwen_vl.py +62 -0
  217. evalvitals-0.1.0/evalvitals/reporting/__init__.py +16 -0
  218. evalvitals-0.1.0/evalvitals/reporting/compiler.py +436 -0
  219. evalvitals-0.1.0/evalvitals/reporting/model.py +105 -0
  220. evalvitals-0.1.0/evalvitals/reporting/stages.py +59 -0
  221. evalvitals-0.1.0/evalvitals/specs.py +331 -0
  222. evalvitals-0.1.0/evalvitals/stats/__init__.py +38 -0
  223. evalvitals-0.1.0/evalvitals/stats/api.py +142 -0
  224. evalvitals-0.1.0/evalvitals/stats/bootstrap.py +86 -0
  225. evalvitals-0.1.0/evalvitals/stats/ebh.py +27 -0
  226. evalvitals-0.1.0/evalvitals/stats/evalue.py +40 -0
  227. evalvitals-0.1.0/evalvitals/stats/friedman.py +138 -0
  228. evalvitals-0.1.0/evalvitals/stats/mcnemar.py +40 -0
  229. evalvitals-0.1.0/evalvitals/stats/multiplicity.py +159 -0
  230. evalvitals-0.1.0/evalvitals/stats/subset_sampling.py +55 -0
  231. evalvitals-0.1.0/evalvitals/viz/__init__.py +7 -0
  232. evalvitals-0.1.0/evalvitals/viz/labels.py +77 -0
  233. evalvitals-0.1.0/evalvitals/viz/prompts.py +39 -0
  234. evalvitals-0.1.0/evalvitals/viz/renderer.py +263 -0
  235. evalvitals-0.1.0/evalvitals/viz/schema.py +36 -0
  236. evalvitals-0.1.0/evalvitals/viz/style.py +106 -0
  237. evalvitals-0.1.0/evalvitals.egg-info/PKG-INFO +300 -0
  238. evalvitals-0.1.0/evalvitals.egg-info/SOURCES.txt +242 -0
  239. evalvitals-0.1.0/evalvitals.egg-info/dependency_links.txt +1 -0
  240. evalvitals-0.1.0/evalvitals.egg-info/entry_points.txt +3 -0
  241. evalvitals-0.1.0/evalvitals.egg-info/requires.txt +54 -0
  242. evalvitals-0.1.0/evalvitals.egg-info/top_level.txt +1 -0
  243. evalvitals-0.1.0/pyproject.toml +133 -0
  244. evalvitals-0.1.0/setup.cfg +4 -0
@@ -0,0 +1,121 @@
1
+ Creative Commons Legal Code
2
+
3
+ CC0 1.0 Universal
4
+
5
+ CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE
6
+ LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN
7
+ ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS
8
+ INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES
9
+ REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS
10
+ PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM
11
+ THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED
12
+ HEREUNDER.
13
+
14
+ Statement of Purpose
15
+
16
+ The laws of most jurisdictions throughout the world automatically confer
17
+ exclusive Copyright and Related Rights (defined below) upon the creator
18
+ and subsequent owner(s) (each and all, an "owner") of an original work of
19
+ authorship and/or a database (each, a "Work").
20
+
21
+ Certain owners wish to permanently relinquish those rights to a Work for
22
+ the purpose of contributing to a commons of creative, cultural and
23
+ scientific works ("Commons") that the public can reliably and without fear
24
+ of later claims of infringement build upon, modify, incorporate in other
25
+ works, reuse and redistribute as freely as possible in any form whatsoever
26
+ and for any purposes, including without limitation commercial purposes.
27
+ These owners may contribute to the Commons to promote the ideal of a free
28
+ culture and the further production of creative, cultural and scientific
29
+ works, or to gain reputation or greater distribution for their Work in
30
+ part through the use and efforts of others.
31
+
32
+ For these and/or other purposes and motivations, and without any
33
+ expectation of additional consideration or compensation, the person
34
+ associating CC0 with a Work (the "Affirmer"), to the extent that he or she
35
+ is an owner of Copyright and Related Rights in the Work, voluntarily
36
+ elects to apply CC0 to the Work and publicly distribute the Work under its
37
+ terms, with knowledge of his or her Copyright and Related Rights in the
38
+ Work and the meaning and intended legal effect of CC0 on those rights.
39
+
40
+ 1. Copyright and Related Rights. A Work made available under CC0 may be
41
+ protected by copyright and related or neighboring rights ("Copyright and
42
+ Related Rights"). Copyright and Related Rights include, but are not
43
+ limited to, the following:
44
+
45
+ i. the right to reproduce, adapt, distribute, perform, display,
46
+ communicate, and translate a Work;
47
+ ii. moral rights retained by the original author(s) and/or performer(s);
48
+ iii. publicity and privacy rights pertaining to a person's image or
49
+ likeness depicted in a Work;
50
+ iv. rights protecting against unfair competition in regards to a Work,
51
+ subject to the limitations in paragraph 4(a), below;
52
+ v. rights protecting the extraction, dissemination, use and reuse of data
53
+ in a Work;
54
+ vi. database rights (such as those arising under Directive 96/9/EC of the
55
+ European Parliament and of the Council of 11 March 1996 on the legal
56
+ protection of databases, and under any national implementation
57
+ thereof, including any amended or successor version of such
58
+ directive); and
59
+ vii. other similar, equivalent or corresponding rights throughout the
60
+ world based on applicable law or treaty, and any national
61
+ implementations thereof.
62
+
63
+ 2. Waiver. To the greatest extent permitted by, but not in contravention
64
+ of, applicable law, Affirmer hereby overtly, fully, permanently,
65
+ irrevocably and unconditionally waives, abandons, and surrenders all of
66
+ Affirmer's Copyright and Related Rights and associated claims and causes
67
+ of action, whether now known or unknown (including existing as well as
68
+ future claims and causes of action), in the Work (i) in all territories
69
+ worldwide, (ii) for the maximum duration provided by applicable law or
70
+ treaty (including future time extensions), (iii) in any current or future
71
+ medium and for any number of copies, and (iv) for any purpose whatsoever,
72
+ including without limitation commercial, advertising or promotional
73
+ purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each
74
+ member of the public at large and to the detriment of Affirmer's heirs and
75
+ successors, fully intending that such Waiver shall not be subject to
76
+ revocation, rescission, cancellation, termination, or any other legal or
77
+ equitable action to disrupt the quiet enjoyment of the Work by the public
78
+ as contemplated by Affirmer's express Statement of Purpose.
79
+
80
+ 3. Public License Fallback. Should any part of the Waiver for any reason
81
+ be judged legally invalid or ineffective under applicable law, then the
82
+ Waiver shall be preserved to the maximum extent permitted taking into
83
+ account Affirmer's express Statement of Purpose. In addition, to the
84
+ extent the Waiver is so judged Affirmer hereby grants to each affected
85
+ person a royalty-free, non transferable, non sublicensable, non exclusive,
86
+ irrevocable and unconditional license to exercise Affirmer's Copyright and
87
+ Related Rights in the Work (i) in all territories worldwide, (ii) for the
88
+ maximum duration provided by applicable law or treaty (including future
89
+ time extensions), (iii) in any current or future medium and for any number
90
+ of copies, and (iv) for any purpose whatsoever, including without
91
+ limitation commercial, advertising or promotional purposes (the
92
+ "License"). The License shall be deemed effective as of the date CC0 was
93
+ applied by Affirmer to the Work. Should any part of the License for any
94
+ reason be judged legally invalid or ineffective under applicable law, such
95
+ partial invalidity or ineffectiveness shall not invalidate the remainder
96
+ of the License, and in such case Affirmer hereby affirms that he or she
97
+ will not (i) exercise any of his or her remaining Copyright and Related
98
+ Rights in the Work or (ii) assert any associated claims and causes of
99
+ action with respect to the Work, in either case contrary to Affirmer's
100
+ express Statement of Purpose.
101
+
102
+ 4. Limitations and Disclaimers.
103
+
104
+ a. No trademark or patent rights held by Affirmer are waived, abandoned,
105
+ surrendered, licensed or otherwise affected by this document.
106
+ b. Affirmer offers the Work as-is and makes no representations or
107
+ warranties of any kind concerning the Work, express, implied,
108
+ statutory or otherwise, including without limitation warranties of
109
+ title, merchantability, fitness for a particular purpose, non
110
+ infringement, or the absence of latent or other defects, accuracy, or
111
+ the present or absence of errors, whether or not discoverable, all to
112
+ the greatest extent permissible under applicable law.
113
+ c. Affirmer disclaims responsibility for clearing rights of other persons
114
+ that may apply to the Work or any use thereof, including without
115
+ limitation any person's Copyright and Related Rights in the Work.
116
+ Further, Affirmer disclaims responsibility for obtaining any necessary
117
+ consents, permissions or other rights required for any use of the
118
+ Work.
119
+ d. Affirmer understands and acknowledges that Creative Commons is not a
120
+ party to this document and has no duty or obligation with respect to
121
+ this CC0 or use of the Work.
@@ -0,0 +1,300 @@
1
+ Metadata-Version: 2.4
2
+ Name: evalvitals
3
+ Version: 0.1.0
4
+ Summary: Failure case analysis in the era of LLM.
5
+ License: Creative Commons Legal Code
6
+
7
+ CC0 1.0 Universal
8
+
9
+ CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE
10
+ LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN
11
+ ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS
12
+ INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES
13
+ REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS
14
+ PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM
15
+ THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED
16
+ HEREUNDER.
17
+
18
+ Statement of Purpose
19
+
20
+ The laws of most jurisdictions throughout the world automatically confer
21
+ exclusive Copyright and Related Rights (defined below) upon the creator
22
+ and subsequent owner(s) (each and all, an "owner") of an original work of
23
+ authorship and/or a database (each, a "Work").
24
+
25
+ Certain owners wish to permanently relinquish those rights to a Work for
26
+ the purpose of contributing to a commons of creative, cultural and
27
+ scientific works ("Commons") that the public can reliably and without fear
28
+ of later claims of infringement build upon, modify, incorporate in other
29
+ works, reuse and redistribute as freely as possible in any form whatsoever
30
+ and for any purposes, including without limitation commercial purposes.
31
+ These owners may contribute to the Commons to promote the ideal of a free
32
+ culture and the further production of creative, cultural and scientific
33
+ works, or to gain reputation or greater distribution for their Work in
34
+ part through the use and efforts of others.
35
+
36
+ For these and/or other purposes and motivations, and without any
37
+ expectation of additional consideration or compensation, the person
38
+ associating CC0 with a Work (the "Affirmer"), to the extent that he or she
39
+ is an owner of Copyright and Related Rights in the Work, voluntarily
40
+ elects to apply CC0 to the Work and publicly distribute the Work under its
41
+ terms, with knowledge of his or her Copyright and Related Rights in the
42
+ Work and the meaning and intended legal effect of CC0 on those rights.
43
+
44
+ 1. Copyright and Related Rights. A Work made available under CC0 may be
45
+ protected by copyright and related or neighboring rights ("Copyright and
46
+ Related Rights"). Copyright and Related Rights include, but are not
47
+ limited to, the following:
48
+
49
+ i. the right to reproduce, adapt, distribute, perform, display,
50
+ communicate, and translate a Work;
51
+ ii. moral rights retained by the original author(s) and/or performer(s);
52
+ iii. publicity and privacy rights pertaining to a person's image or
53
+ likeness depicted in a Work;
54
+ iv. rights protecting against unfair competition in regards to a Work,
55
+ subject to the limitations in paragraph 4(a), below;
56
+ v. rights protecting the extraction, dissemination, use and reuse of data
57
+ in a Work;
58
+ vi. database rights (such as those arising under Directive 96/9/EC of the
59
+ European Parliament and of the Council of 11 March 1996 on the legal
60
+ protection of databases, and under any national implementation
61
+ thereof, including any amended or successor version of such
62
+ directive); and
63
+ vii. other similar, equivalent or corresponding rights throughout the
64
+ world based on applicable law or treaty, and any national
65
+ implementations thereof.
66
+
67
+ 2. Waiver. To the greatest extent permitted by, but not in contravention
68
+ of, applicable law, Affirmer hereby overtly, fully, permanently,
69
+ irrevocably and unconditionally waives, abandons, and surrenders all of
70
+ Affirmer's Copyright and Related Rights and associated claims and causes
71
+ of action, whether now known or unknown (including existing as well as
72
+ future claims and causes of action), in the Work (i) in all territories
73
+ worldwide, (ii) for the maximum duration provided by applicable law or
74
+ treaty (including future time extensions), (iii) in any current or future
75
+ medium and for any number of copies, and (iv) for any purpose whatsoever,
76
+ including without limitation commercial, advertising or promotional
77
+ purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each
78
+ member of the public at large and to the detriment of Affirmer's heirs and
79
+ successors, fully intending that such Waiver shall not be subject to
80
+ revocation, rescission, cancellation, termination, or any other legal or
81
+ equitable action to disrupt the quiet enjoyment of the Work by the public
82
+ as contemplated by Affirmer's express Statement of Purpose.
83
+
84
+ 3. Public License Fallback. Should any part of the Waiver for any reason
85
+ be judged legally invalid or ineffective under applicable law, then the
86
+ Waiver shall be preserved to the maximum extent permitted taking into
87
+ account Affirmer's express Statement of Purpose. In addition, to the
88
+ extent the Waiver is so judged Affirmer hereby grants to each affected
89
+ person a royalty-free, non transferable, non sublicensable, non exclusive,
90
+ irrevocable and unconditional license to exercise Affirmer's Copyright and
91
+ Related Rights in the Work (i) in all territories worldwide, (ii) for the
92
+ maximum duration provided by applicable law or treaty (including future
93
+ time extensions), (iii) in any current or future medium and for any number
94
+ of copies, and (iv) for any purpose whatsoever, including without
95
+ limitation commercial, advertising or promotional purposes (the
96
+ "License"). The License shall be deemed effective as of the date CC0 was
97
+ applied by Affirmer to the Work. Should any part of the License for any
98
+ reason be judged legally invalid or ineffective under applicable law, such
99
+ partial invalidity or ineffectiveness shall not invalidate the remainder
100
+ of the License, and in such case Affirmer hereby affirms that he or she
101
+ will not (i) exercise any of his or her remaining Copyright and Related
102
+ Rights in the Work or (ii) assert any associated claims and causes of
103
+ action with respect to the Work, in either case contrary to Affirmer's
104
+ express Statement of Purpose.
105
+
106
+ 4. Limitations and Disclaimers.
107
+
108
+ a. No trademark or patent rights held by Affirmer are waived, abandoned,
109
+ surrendered, licensed or otherwise affected by this document.
110
+ b. Affirmer offers the Work as-is and makes no representations or
111
+ warranties of any kind concerning the Work, express, implied,
112
+ statutory or otherwise, including without limitation warranties of
113
+ title, merchantability, fitness for a particular purpose, non
114
+ infringement, or the absence of latent or other defects, accuracy, or
115
+ the present or absence of errors, whether or not discoverable, all to
116
+ the greatest extent permissible under applicable law.
117
+ c. Affirmer disclaims responsibility for clearing rights of other persons
118
+ that may apply to the Work or any use thereof, including without
119
+ limitation any person's Copyright and Related Rights in the Work.
120
+ Further, Affirmer disclaims responsibility for obtaining any necessary
121
+ consents, permissions or other rights required for any use of the
122
+ Work.
123
+ d. Affirmer understands and acknowledges that Creative Commons is not a
124
+ party to this document and has no duty or obligation with respect to
125
+ this CC0 or use of the Work.
126
+
127
+ Project-URL: Homepage, https://github.com/evalvitals/evalvitals
128
+ Project-URL: Documentation, https://evalvitals.github.io/evalvitals/
129
+ Project-URL: Repository, https://github.com/evalvitals/evalvitals
130
+ Project-URL: Issues, https://github.com/evalvitals/evalvitals/issues
131
+ Project-URL: Changelog, https://github.com/evalvitals/evalvitals/blob/main/CHANGELOG.md
132
+ Keywords: llm,vlm,interpretability,failure-analysis,explainability
133
+ Classifier: Development Status :: 3 - Alpha
134
+ Classifier: Intended Audience :: Science/Research
135
+ Classifier: License :: CC0 1.0 Universal (CC0 1.0) Public Domain Dedication
136
+ Classifier: Programming Language :: Python :: 3
137
+ Classifier: Programming Language :: Python :: 3.10
138
+ Classifier: Programming Language :: Python :: 3.11
139
+ Classifier: Programming Language :: Python :: 3.12
140
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
141
+ Requires-Python: >=3.10
142
+ Description-Content-Type: text/markdown
143
+ License-File: LICENSE
144
+ Requires-Dist: pyyaml>=6.0
145
+ Requires-Dist: numpy>=1.24
146
+ Provides-Extra: local
147
+ Requires-Dist: torch>=2.0.0; extra == "local"
148
+ Requires-Dist: transformers<5.0.0,>=4.51.0; extra == "local"
149
+ Requires-Dist: accelerate>=0.26.0; extra == "local"
150
+ Provides-Extra: api
151
+ Requires-Dist: openai>=1.0; extra == "api"
152
+ Provides-Extra: interp
153
+ Requires-Dist: captum>=0.7; extra == "interp"
154
+ Requires-Dist: inseq>=0.6; extra == "interp"
155
+ Requires-Dist: nnsight>=0.3; extra == "interp"
156
+ Provides-Extra: data
157
+ Requires-Dist: datasets>=2.0; extra == "data"
158
+ Requires-Dist: pillow>=9.0; extra == "data"
159
+ Provides-Extra: viz
160
+ Requires-Dist: matplotlib>=3.7; extra == "viz"
161
+ Provides-Extra: stats
162
+ Requires-Dist: statsmodels>=0.14; extra == "stats"
163
+ Requires-Dist: scikit-learn>=1.3; extra == "stats"
164
+ Provides-Extra: dashboard
165
+ Requires-Dist: streamlit>=1.30; extra == "dashboard"
166
+ Requires-Dist: pandas>=2.0; extra == "dashboard"
167
+ Provides-Extra: gemini
168
+ Requires-Dist: google-genai>=1.0; extra == "gemini"
169
+ Provides-Extra: all
170
+ Requires-Dist: torch>=2.0.0; extra == "all"
171
+ Requires-Dist: transformers<5.0.0,>=4.51.0; extra == "all"
172
+ Requires-Dist: accelerate>=0.26.0; extra == "all"
173
+ Requires-Dist: openai>=1.0; extra == "all"
174
+ Requires-Dist: captum>=0.7; extra == "all"
175
+ Requires-Dist: inseq>=0.6; extra == "all"
176
+ Requires-Dist: nnsight>=0.3; extra == "all"
177
+ Requires-Dist: matplotlib>=3.7; extra == "all"
178
+ Requires-Dist: statsmodels>=0.14; extra == "all"
179
+ Requires-Dist: scikit-learn>=1.3; extra == "all"
180
+ Requires-Dist: streamlit>=1.30; extra == "all"
181
+ Requires-Dist: pandas>=2.0; extra == "all"
182
+ Provides-Extra: dev
183
+ Requires-Dist: pytest>=8.0; extra == "dev"
184
+ Requires-Dist: pytest-cov>=4.0; extra == "dev"
185
+ Requires-Dist: ruff>=0.4; extra == "dev"
186
+ Requires-Dist: mypy>=1.8; extra == "dev"
187
+ Requires-Dist: jsonschema>=4.0; extra == "dev"
188
+ Dynamic: license-file
189
+
190
+ # EvalVitals
191
+
192
+ [![CI](https://github.com/evalvitals/evalvitals/actions/workflows/ci.yml/badge.svg)](https://github.com/evalvitals/evalvitals/actions/workflows/ci.yml)
193
+ [![PyPI](https://img.shields.io/pypi/v/evalvitals)](https://pypi.org/project/evalvitals/)
194
+ [![Python](https://img.shields.io/pypi/pyversions/evalvitals)](https://pypi.org/project/evalvitals/)
195
+ [![Docs](https://img.shields.io/badge/docs-mkdocs-blue)](https://evalvitals.github.io/evalvitals/)
196
+ [![License: CC0-1.0](https://img.shields.io/badge/license-CC0--1.0-green)](LICENSE)
197
+
198
+ EvalVitals is an sklearn-like toolkit for failure-case analysis in the era of
199
+ LLMs, VLMs, omni (text+image+audio+video) models, and agentic systems. Model
200
+ identity (`ModelSpec`) is separate from runtime (`Backend`); analyzers
201
+ (`Analyzer`) connect to models by capability matching (`Capability`), so the
202
+ same spec runs through a black-box API or a white-box local backend — only
203
+ the capability set changes.
204
+
205
+ | Contract | Role |
206
+ |---|---|
207
+ | `ModelSpec` | Model identity: family, HF repo, architecture traits, modalities. |
208
+ | `Backend` | Runtime: local HF internals, black-box API, or offline batch engines. |
209
+ | `Model` | A runnable object with `generate()` and `forward(capture=...) -> Trace`. |
210
+ | `Analyzer` | An sklearn-style estimator: `Analyzer(**params).run(model, data) -> Result`. |
211
+ | `Capability` | Vocabulary matching analyzers to compatible model runtimes. |
212
+ | `FailureCase` | Central data unit for prompts, labels, provenance, agent trajectories. |
213
+ | `Result` | Uniform output: human-readable summary + structured findings. |
214
+
215
+ ## What's Inside
216
+
217
+ EvalVitals covers three layers of the analysis workflow, usable independently
218
+ or chained into one automated loop:
219
+
220
+ 1. **Analyzer toolkit** — 26 registered analyzers (attention, uncertainty,
221
+ hallucination, Shapley attribution, logit lens, representation geometry,
222
+ agent-trajectory analysis) run against any model/backend pair through the
223
+ same `Analyzer(**params).run(model, data) -> Result` call shape. See the
224
+ [Demo](#demo) below and the [Analyzer Zoo](docs/analyzers.md).
225
+ 2. **Data analysis agent (M2/M3)** — `evalvitals explore` points a coding
226
+ agent at a raw results directory (any JSON/JSONL shape, no host-side
227
+ parsing) and gets back descriptive takeaways, charts, and 1-3 falsifiable
228
+ hypotheses — no code required. See
229
+ [Exploratory Analysis (M2/M3)](docs/m2_analysis.md).
230
+ 3. **Intervention (M4/M5)** — `HypothesisTester` verifies a hypothesis
231
+ statistically and against the stated experiment protocol; `FixAgent` then
232
+ proposes and validates candidate repairs (prompt → scaffold → internals →
233
+ parameter space) against the unmodified baseline with paired McNemar +
234
+ e-value. See [Intervention & Verification (M4/M5)](docs/intervention.md).
235
+
236
+ `VLDiagnoseLoop` chains all three (M1→M2→M3→M5, M4 post-loop) into one
237
+ automated failure-attribution pipeline — see [Quickstart](docs/quickstart.md).
238
+
239
+ ## Demo
240
+
241
+ Relative attention on a VLM — ["MLLMs Know Where to Look"](https://arxiv.org/abs/2502.17422) ([code](https://github.com/saccharomycetes/mllms_know)):
242
+
243
+ ```python
244
+ from PIL import Image
245
+ from evalvitals import compose, Capability
246
+ from evalvitals.analyzers.attention import RelativeAttentionAnalyzer
247
+ from evalvitals.core.case import Inputs
248
+
249
+ # Load Qwen2.5-VL with white-box attention capture
250
+ model = compose("qwen2.5-vl-7b-instruct", "hf_local", want={Capability.ATTENTION})
251
+
252
+ # Run relative attention: ratio of task-specific vs generic image attention
253
+ result = RelativeAttentionAnalyzer(layer=22, top_k=5).run(
254
+ model,
255
+ Inputs(prompt="What color is the car?", image=Image.open("scene.jpg")),
256
+ )
257
+
258
+ print(result.summary()) # agent-readable findings
259
+ result.plot() # (H, W) heatmap — requires evalvitals[viz]
260
+ ```
261
+
262
+ The same call shape works for any registered model/analyzer pair — a plain
263
+ text LLM, a config-driven YAML run, or an explicit backend — see
264
+ [Quickstart](docs/quickstart.md) for those and for the automated
265
+ failure-attribution loop (`VLDiagnoseLoop`, M1→M2→M3→M5) and no-code
266
+ exploratory analysis (`evalvitals explore`).
267
+
268
+ ## Install
269
+
270
+ ```bash
271
+ pip install -e .
272
+ pip install -e ".[viz]"
273
+ pip install -e ".[dev]"
274
+ ```
275
+
276
+ ## Documentation
277
+
278
+ - [Docs overview](docs/index.md)
279
+ - [Quickstart](docs/quickstart.md) — runnable examples for every entry point, the diagnosis loop, and submitting a run
280
+ - [Exploratory Analysis (M2/M3)](docs/m2_analysis.md) — standalone `evalvitals explore`
281
+ - [Intervention & Verification (M4/M5)](docs/intervention.md) — `HypothesisTester` verification, `FixAgent` tiered repair
282
+ - [Analyzer Zoo](docs/analyzers.md) — reference tables of analyzers and registered models
283
+ - [Architecture](docs/architecture.md) — package structure and design contracts
284
+ - [Extending EvalVitals](docs/extending.md) — add analyzers, specs, backends
285
+ - [Roadmap](docs/roadmap.md)
286
+
287
+ ## Examples
288
+
289
+ Each directory under `examples/` is a self-contained, runnable demo:
290
+
291
+ ```bash
292
+ cd examples/analyzer_demos/qwen_attention && docker compose up # attention analysis on a text LLM
293
+ cd examples/m2_statistics/deco_hallu_explore && docker compose up # M2/M3 explore, real M1 data
294
+ 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)
295
+ 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)
296
+ cd examples/diagnosis_loops/qwen_loop_agy && docker compose up # VLDiagnoseLoop M1→M5 (VLM)
297
+ ```
298
+
299
+ See [`examples/README.md`](examples/README.md) for the full list, grouped by
300
+ layer (single analyzers, standalone M2/M3, full diagnosis loop).
@@ -0,0 +1,111 @@
1
+ # EvalVitals
2
+
3
+ [![CI](https://github.com/evalvitals/evalvitals/actions/workflows/ci.yml/badge.svg)](https://github.com/evalvitals/evalvitals/actions/workflows/ci.yml)
4
+ [![PyPI](https://img.shields.io/pypi/v/evalvitals)](https://pypi.org/project/evalvitals/)
5
+ [![Python](https://img.shields.io/pypi/pyversions/evalvitals)](https://pypi.org/project/evalvitals/)
6
+ [![Docs](https://img.shields.io/badge/docs-mkdocs-blue)](https://evalvitals.github.io/evalvitals/)
7
+ [![License: CC0-1.0](https://img.shields.io/badge/license-CC0--1.0-green)](LICENSE)
8
+
9
+ EvalVitals is an sklearn-like toolkit for failure-case analysis in the era of
10
+ LLMs, VLMs, omni (text+image+audio+video) models, and agentic systems. Model
11
+ identity (`ModelSpec`) is separate from runtime (`Backend`); analyzers
12
+ (`Analyzer`) connect to models by capability matching (`Capability`), so the
13
+ same spec runs through a black-box API or a white-box local backend — only
14
+ the capability set changes.
15
+
16
+ | Contract | Role |
17
+ |---|---|
18
+ | `ModelSpec` | Model identity: family, HF repo, architecture traits, modalities. |
19
+ | `Backend` | Runtime: local HF internals, black-box API, or offline batch engines. |
20
+ | `Model` | A runnable object with `generate()` and `forward(capture=...) -> Trace`. |
21
+ | `Analyzer` | An sklearn-style estimator: `Analyzer(**params).run(model, data) -> Result`. |
22
+ | `Capability` | Vocabulary matching analyzers to compatible model runtimes. |
23
+ | `FailureCase` | Central data unit for prompts, labels, provenance, agent trajectories. |
24
+ | `Result` | Uniform output: human-readable summary + structured findings. |
25
+
26
+ ## What's Inside
27
+
28
+ EvalVitals covers three layers of the analysis workflow, usable independently
29
+ or chained into one automated loop:
30
+
31
+ 1. **Analyzer toolkit** — 26 registered analyzers (attention, uncertainty,
32
+ hallucination, Shapley attribution, logit lens, representation geometry,
33
+ agent-trajectory analysis) run against any model/backend pair through the
34
+ same `Analyzer(**params).run(model, data) -> Result` call shape. See the
35
+ [Demo](#demo) below and the [Analyzer Zoo](docs/analyzers.md).
36
+ 2. **Data analysis agent (M2/M3)** — `evalvitals explore` points a coding
37
+ agent at a raw results directory (any JSON/JSONL shape, no host-side
38
+ parsing) and gets back descriptive takeaways, charts, and 1-3 falsifiable
39
+ hypotheses — no code required. See
40
+ [Exploratory Analysis (M2/M3)](docs/m2_analysis.md).
41
+ 3. **Intervention (M4/M5)** — `HypothesisTester` verifies a hypothesis
42
+ statistically and against the stated experiment protocol; `FixAgent` then
43
+ proposes and validates candidate repairs (prompt → scaffold → internals →
44
+ parameter space) against the unmodified baseline with paired McNemar +
45
+ e-value. See [Intervention & Verification (M4/M5)](docs/intervention.md).
46
+
47
+ `VLDiagnoseLoop` chains all three (M1→M2→M3→M5, M4 post-loop) into one
48
+ automated failure-attribution pipeline — see [Quickstart](docs/quickstart.md).
49
+
50
+ ## Demo
51
+
52
+ Relative attention on a VLM — ["MLLMs Know Where to Look"](https://arxiv.org/abs/2502.17422) ([code](https://github.com/saccharomycetes/mllms_know)):
53
+
54
+ ```python
55
+ from PIL import Image
56
+ from evalvitals import compose, Capability
57
+ from evalvitals.analyzers.attention import RelativeAttentionAnalyzer
58
+ from evalvitals.core.case import Inputs
59
+
60
+ # Load Qwen2.5-VL with white-box attention capture
61
+ model = compose("qwen2.5-vl-7b-instruct", "hf_local", want={Capability.ATTENTION})
62
+
63
+ # Run relative attention: ratio of task-specific vs generic image attention
64
+ result = RelativeAttentionAnalyzer(layer=22, top_k=5).run(
65
+ model,
66
+ Inputs(prompt="What color is the car?", image=Image.open("scene.jpg")),
67
+ )
68
+
69
+ print(result.summary()) # agent-readable findings
70
+ result.plot() # (H, W) heatmap — requires evalvitals[viz]
71
+ ```
72
+
73
+ The same call shape works for any registered model/analyzer pair — a plain
74
+ text LLM, a config-driven YAML run, or an explicit backend — see
75
+ [Quickstart](docs/quickstart.md) for those and for the automated
76
+ failure-attribution loop (`VLDiagnoseLoop`, M1→M2→M3→M5) and no-code
77
+ exploratory analysis (`evalvitals explore`).
78
+
79
+ ## Install
80
+
81
+ ```bash
82
+ pip install -e .
83
+ pip install -e ".[viz]"
84
+ pip install -e ".[dev]"
85
+ ```
86
+
87
+ ## Documentation
88
+
89
+ - [Docs overview](docs/index.md)
90
+ - [Quickstart](docs/quickstart.md) — runnable examples for every entry point, the diagnosis loop, and submitting a run
91
+ - [Exploratory Analysis (M2/M3)](docs/m2_analysis.md) — standalone `evalvitals explore`
92
+ - [Intervention & Verification (M4/M5)](docs/intervention.md) — `HypothesisTester` verification, `FixAgent` tiered repair
93
+ - [Analyzer Zoo](docs/analyzers.md) — reference tables of analyzers and registered models
94
+ - [Architecture](docs/architecture.md) — package structure and design contracts
95
+ - [Extending EvalVitals](docs/extending.md) — add analyzers, specs, backends
96
+ - [Roadmap](docs/roadmap.md)
97
+
98
+ ## Examples
99
+
100
+ Each directory under `examples/` is a self-contained, runnable demo:
101
+
102
+ ```bash
103
+ cd examples/analyzer_demos/qwen_attention && docker compose up # attention analysis on a text LLM
104
+ cd examples/m2_statistics/deco_hallu_explore && docker compose up # M2/M3 explore, real M1 data
105
+ 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)
106
+ 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)
107
+ cd examples/diagnosis_loops/qwen_loop_agy && docker compose up # VLDiagnoseLoop M1→M5 (VLM)
108
+ ```
109
+
110
+ See [`examples/README.md`](examples/README.md) for the full list, grouped by
111
+ layer (single analyzers, standalone M2/M3, full diagnosis loop).
@@ -0,0 +1,112 @@
1
+ """EvalVitals — failure case analysis for LLMs and VLMs.
2
+
3
+ A model is built once from a **spec** (identity, in :mod:`evalvitals.specs`) and a
4
+ **backend** (runtime: ``hf_local`` / ``api`` / ``vllm_offline``); the backend
5
+ determines the capability set. Analyzers are sklearn-style estimators matched to
6
+ models by capability.
7
+
8
+ Equivalent ways to run an analysis:
9
+
10
+ 0. Bring your own model — wrap an already-loaded HF model + tokenizer::
11
+
12
+ import evalvitals
13
+ from transformers import AutoModelForCausalLM, AutoTokenizer
14
+ from evalvitals.analyzers.lens.logit_lens import LogitLensAnalyzer
15
+
16
+ m = AutoModelForCausalLM.from_pretrained("my-org/my-llama")
17
+ tok = AutoTokenizer.from_pretrained("my-org/my-llama")
18
+ model = evalvitals.wrap(m, tok) # captum-style on-ramp
19
+ result = LogitLensAnalyzer().run(model, "The capital of France is")
20
+
21
+ 1. Curated checkpoints — build a model from the registry by key::
22
+
23
+ import evalvitals
24
+ from evalvitals.analyzers.attention.summary import AttentionAnalyzer
25
+
26
+ model = evalvitals.load("qwen2.5-7b-instruct") # spec key
27
+ result = AttentionAnalyzer(top_k=5).run(model, "The capital of France is")
28
+ print(result.summary())
29
+
30
+ 2. Config-driven — declare model + analysis in YAML::
31
+
32
+ from evalvitals import load_config, run
33
+
34
+ config = load_config("configs/qwen_attention.yaml")
35
+ result = run(config, "The capital of France is")
36
+
37
+ 3. Hybrid convenience shim (auto-derived from capabilities)::
38
+
39
+ result = model.call_attention("The capital of France is")
40
+
41
+ 4. Explicit engine — pick the backend yourself::
42
+
43
+ from evalvitals.models import compose
44
+ model = compose("qwen2.5-7b-instruct", "hf_local", want={evalvitals.Capability.ATTENTION})
45
+ """
46
+
47
+ # Importing these populates the registry (models + analyzers self-register).
48
+ import evalvitals.analyzers as _analyzers # noqa: E402,F401
49
+ from evalvitals.config import AnalysisConfig, load_config
50
+ from evalvitals.core import (
51
+ Analyzer,
52
+ Capability,
53
+ CaseBatch,
54
+ FailureCase,
55
+ Model,
56
+ Result,
57
+ registry,
58
+ )
59
+ from evalvitals.core.tool import Tool, ToolCall
60
+ from evalvitals.models import Agent, RuntimeConfig, compose, load, load_model, wrap
61
+ from evalvitals.specs import get_spec, list_specs
62
+
63
+ __version__ = "0.1.0"
64
+ __all__ = [
65
+ "load",
66
+ "load_config",
67
+ "load_model",
68
+ "wrap",
69
+ "compose",
70
+ "RuntimeConfig",
71
+ "Agent",
72
+ "Tool",
73
+ "ToolCall",
74
+ "get_spec",
75
+ "list_specs",
76
+ "run",
77
+ "AnalysisConfig",
78
+ "Model",
79
+ "Analyzer",
80
+ "Result",
81
+ "FailureCase",
82
+ "CaseBatch",
83
+ "Capability",
84
+ "registry",
85
+ ]
86
+
87
+
88
+ def run(config: AnalysisConfig, data, **kwargs):
89
+ """Run the analysis declared by *config* on *data*.
90
+
91
+ Equivalent to::
92
+
93
+ analyzer = registry.analyzers.get(config.analysis)(**config.analysis_kwargs)
94
+ analyzer.run(load_model(config.model), data)
95
+
96
+ Args:
97
+ config: Loaded :class:`AnalysisConfig` (see :func:`load_config`).
98
+ data: ``str | FailureCase | CaseBatch | iterable`` to analyse.
99
+ **kwargs: Override or extend ``config.analysis_kwargs`` at call time.
100
+
101
+ Returns:
102
+ A :class:`~evalvitals.core.result.Result` subclass.
103
+ """
104
+ # Back-compat: tolerate a leading "call_" in the config (old style).
105
+ name = config.analysis
106
+ if name.startswith("call_"):
107
+ name = name[len("call_"):]
108
+
109
+ analyzer_cls = registry.analyzers.get(name)
110
+ analyzer = analyzer_cls(**{**config.analysis_kwargs, **kwargs})
111
+ model = load_model(config.model)
112
+ return analyzer.run(model, data)
@@ -0,0 +1,2 @@
1
+ """Bundled runtime assets for EvalVitals agents."""
2
+