auditkit 1.1.6__tar.gz → 1.1.7__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 (439) hide show
  1. {auditkit-1.1.6 → auditkit-1.1.7}/CHANGELOG.md +12 -0
  2. {auditkit-1.1.6 → auditkit-1.1.7}/CITATION.cff +1 -1
  3. {auditkit-1.1.6 → auditkit-1.1.7}/PKG-INFO +2 -1
  4. {auditkit-1.1.6 → auditkit-1.1.7}/docs/GUIDE.md +1 -4
  5. {auditkit-1.1.6 → auditkit-1.1.7}/docs/known_issues.md +1 -2
  6. {auditkit-1.1.6 → auditkit-1.1.7}/pyproject.toml +3 -2
  7. {auditkit-1.1.6 → auditkit-1.1.7}/src/auditkit/__init__.py +1 -1
  8. {auditkit-1.1.6 → auditkit-1.1.7}/src/auditkit/_bootstrap.py +10 -4
  9. {auditkit-1.1.6 → auditkit-1.1.7}/src/auditkit/api.py +10 -2
  10. {auditkit-1.1.6 → auditkit-1.1.7}/src/auditkit/diff.py +5 -4
  11. {auditkit-1.1.6 → auditkit-1.1.7}/src/auditkit/model/__init__.py +80 -3
  12. {auditkit-1.1.6 → auditkit-1.1.7}/src/auditkit/model/hf_gen.py +3 -1
  13. {auditkit-1.1.6 → auditkit-1.1.7}/src/auditkit/runner.py +22 -6
  14. {auditkit-1.1.6 → auditkit-1.1.7}/src/auditkit/score.py +7 -0
  15. {auditkit-1.1.6 → auditkit-1.1.7}/src/auditkit/scorers.py +10 -0
  16. {auditkit-1.1.6 → auditkit-1.1.7}/tests/conftest.py +1 -0
  17. auditkit-1.1.7/tests/test_bootstrap_ties.py +65 -0
  18. auditkit-1.1.7/tests/test_callable_model_cache.py +126 -0
  19. auditkit-1.1.7/tests/test_function_scorer_identity.py +61 -0
  20. auditkit-1.1.7/tests/test_hf_gen_loglikelihood_float32.py +38 -0
  21. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_lexsi_relay.py +5 -1
  22. auditkit-1.1.7/tests/test_minimize_direction_correct.py +68 -0
  23. auditkit-1.1.7/tests/test_model_spec_label.py +56 -0
  24. {auditkit-1.1.6 → auditkit-1.1.7}/.gitattributes +0 -0
  25. {auditkit-1.1.6 → auditkit-1.1.7}/.github/workflows/check-release-version.yml +0 -0
  26. {auditkit-1.1.6 → auditkit-1.1.7}/.github/workflows/patch-release.yml +0 -0
  27. {auditkit-1.1.6 → auditkit-1.1.7}/.gitignore +0 -0
  28. {auditkit-1.1.6 → auditkit-1.1.7}/AGENTS.md +0 -0
  29. {auditkit-1.1.6 → auditkit-1.1.7}/LICENSE.md +0 -0
  30. {auditkit-1.1.6 → auditkit-1.1.7}/README.md +0 -0
  31. {auditkit-1.1.6 → auditkit-1.1.7}/docs/CNAME +0 -0
  32. {auditkit-1.1.6 → auditkit-1.1.7}/docs/HF_ENDPOINT.md +0 -0
  33. {auditkit-1.1.6 → auditkit-1.1.7}/docs/SGLANG.md +0 -0
  34. {auditkit-1.1.6 → auditkit-1.1.7}/docs/VLLM_KNOWN_ISSUES.md +0 -0
  35. {auditkit-1.1.6 → auditkit-1.1.7}/docs/about/glossary.md +0 -0
  36. {auditkit-1.1.6 → auditkit-1.1.7}/docs/about/platform-integration.md +0 -0
  37. {auditkit-1.1.6 → auditkit-1.1.7}/docs/agent_eval.md +0 -0
  38. {auditkit-1.1.6 → auditkit-1.1.7}/docs/agents_and_rag.md +0 -0
  39. {auditkit-1.1.6 → auditkit-1.1.7}/docs/annotators.md +0 -0
  40. {auditkit-1.1.6 → auditkit-1.1.7}/docs/api.md +0 -0
  41. {auditkit-1.1.6 → auditkit-1.1.7}/docs/architecture/data-model.md +0 -0
  42. {auditkit-1.1.6 → auditkit-1.1.7}/docs/architecture/system-design.md +0 -0
  43. {auditkit-1.1.6 → auditkit-1.1.7}/docs/assets/auditkit-logo-black.png +0 -0
  44. {auditkit-1.1.6 → auditkit-1.1.7}/docs/assets/auditkit-logo-dark.png +0 -0
  45. {auditkit-1.1.6 → auditkit-1.1.7}/docs/assets/auditkit-logo-light.png +0 -0
  46. {auditkit-1.1.6 → auditkit-1.1.7}/docs/assets/auditkit-logo-white.png +0 -0
  47. {auditkit-1.1.6 → auditkit-1.1.7}/docs/assets/extra.css +0 -0
  48. {auditkit-1.1.6 → auditkit-1.1.7}/docs/assets/extra.js +0 -0
  49. {auditkit-1.1.6 → auditkit-1.1.7}/docs/assets/favicon.png +0 -0
  50. {auditkit-1.1.6 → auditkit-1.1.7}/docs/assets/icon.png +0 -0
  51. {auditkit-1.1.6 → auditkit-1.1.7}/docs/assets/icon.svg +0 -0
  52. {auditkit-1.1.6 → auditkit-1.1.7}/docs/assets/logo.svg +0 -0
  53. {auditkit-1.1.6 → auditkit-1.1.7}/docs/best_practices/scorers.md +0 -0
  54. {auditkit-1.1.6 → auditkit-1.1.7}/docs/cli.md +0 -0
  55. {auditkit-1.1.6 → auditkit-1.1.7}/docs/community/changelog.md +0 -0
  56. {auditkit-1.1.6 → auditkit-1.1.7}/docs/community/contributing.md +0 -0
  57. {auditkit-1.1.6 → auditkit-1.1.7}/docs/community/faq.md +0 -0
  58. {auditkit-1.1.6 → auditkit-1.1.7}/docs/community/roadmap.md +0 -0
  59. {auditkit-1.1.6 → auditkit-1.1.7}/docs/configuration.md +0 -0
  60. {auditkit-1.1.6 → auditkit-1.1.7}/docs/cookbook/llm_judge.md +0 -0
  61. {auditkit-1.1.6 → auditkit-1.1.7}/docs/cookbook/rag_evaluation.md +0 -0
  62. {auditkit-1.1.6 → auditkit-1.1.7}/docs/development.md +0 -0
  63. {auditkit-1.1.6 → auditkit-1.1.7}/docs/encoder_judge.md +0 -0
  64. {auditkit-1.1.6 → auditkit-1.1.7}/docs/encoder_judge_prebuilts.md +0 -0
  65. {auditkit-1.1.6 → auditkit-1.1.7}/docs/examples/custom_scorer.md +0 -0
  66. {auditkit-1.1.6 → auditkit-1.1.7}/docs/examples/experiments.md +0 -0
  67. {auditkit-1.1.6 → auditkit-1.1.7}/docs/examples/many_datasets.md +0 -0
  68. {auditkit-1.1.6 → auditkit-1.1.7}/docs/examples/model_comparison.md +0 -0
  69. {auditkit-1.1.6 → auditkit-1.1.7}/docs/examples/quickstart.md +0 -0
  70. {auditkit-1.1.6 → auditkit-1.1.7}/docs/experiments.md +0 -0
  71. {auditkit-1.1.6 → auditkit-1.1.7}/docs/getting_started.md +0 -0
  72. {auditkit-1.1.6 → auditkit-1.1.7}/docs/guard_models.md +0 -0
  73. {auditkit-1.1.6 → auditkit-1.1.7}/docs/index.md +0 -0
  74. {auditkit-1.1.6 → auditkit-1.1.7}/docs/integrations.md +0 -0
  75. {auditkit-1.1.6 → auditkit-1.1.7}/docs/lexsi_integration.md +0 -0
  76. {auditkit-1.1.6 → auditkit-1.1.7}/docs/llm_judge_rendering.md +0 -0
  77. {auditkit-1.1.6 → auditkit-1.1.7}/docs/metrics.md +0 -0
  78. {auditkit-1.1.6 → auditkit-1.1.7}/docs/model_backends.md +0 -0
  79. {auditkit-1.1.6 → auditkit-1.1.7}/docs/rag_stress.md +0 -0
  80. {auditkit-1.1.6 → auditkit-1.1.7}/docs/reports.md +0 -0
  81. {auditkit-1.1.6 → auditkit-1.1.7}/docs/requirements.txt +0 -0
  82. {auditkit-1.1.6 → auditkit-1.1.7}/docs/scenarios.md +0 -0
  83. {auditkit-1.1.6 → auditkit-1.1.7}/docs/scorers_reference.md +0 -0
  84. {auditkit-1.1.6 → auditkit-1.1.7}/examples/01_full_evaluation_pipeline.ipynb +0 -0
  85. {auditkit-1.1.6 → auditkit-1.1.7}/examples/02_generation_across_hf_families.ipynb +0 -0
  86. {auditkit-1.1.6 → auditkit-1.1.7}/examples/03_custom_annotators.ipynb +0 -0
  87. {auditkit-1.1.6 → auditkit-1.1.7}/examples/04_metrics_deep_dive.ipynb +0 -0
  88. {auditkit-1.1.6 → auditkit-1.1.7}/examples/05_data_types.ipynb +0 -0
  89. {auditkit-1.1.6 → auditkit-1.1.7}/examples/06_model_comparison.ipynb +0 -0
  90. {auditkit-1.1.6 → auditkit-1.1.7}/examples/07_annotators_across_models.ipynb +0 -0
  91. {auditkit-1.1.6 → auditkit-1.1.7}/examples/08_compare_result_deep_dive.ipynb +0 -0
  92. {auditkit-1.1.6 → auditkit-1.1.7}/examples/09_guard_judge_implementation_check.ipynb +0 -0
  93. {auditkit-1.1.6 → auditkit-1.1.7}/examples/10_guard_judge_legit_models.ipynb +0 -0
  94. {auditkit-1.1.6 → auditkit-1.1.7}/examples/11_encoder_judge_prebuilts.ipynb +0 -0
  95. {auditkit-1.1.6 → auditkit-1.1.7}/examples/12_performance_metrics_demo.ipynb +0 -0
  96. {auditkit-1.1.6 → auditkit-1.1.7}/examples/13_sglang_compatibility.ipynb +0 -0
  97. {auditkit-1.1.6 → auditkit-1.1.7}/examples/14_agent_and_rag_evals.ipynb +0 -0
  98. {auditkit-1.1.6 → auditkit-1.1.7}/examples/15_agentic_rag_metrics_walkthrough.ipynb +0 -0
  99. {auditkit-1.1.6 → auditkit-1.1.7}/examples/16_agentic_endpoints_live.ipynb +0 -0
  100. {auditkit-1.1.6 → auditkit-1.1.7}/examples/17_multi_route_references.ipynb +0 -0
  101. {auditkit-1.1.6 → auditkit-1.1.7}/examples/README.md +0 -0
  102. {auditkit-1.1.6 → auditkit-1.1.7}/examples/agent_eval_offline.py +0 -0
  103. {auditkit-1.1.6 → auditkit-1.1.7}/examples/applications/01_application_pruned_llama_boolq.ipynb +0 -0
  104. {auditkit-1.1.6 → auditkit-1.1.7}/examples/applications/02_application_healthcare_pubmedqa.ipynb +0 -0
  105. {auditkit-1.1.6 → auditkit-1.1.7}/examples/applications/03_application_finance_10k_qa.ipynb +0 -0
  106. {auditkit-1.1.6 → auditkit-1.1.7}/examples/applications/04_application_ecommerce_review_triage.ipynb +0 -0
  107. {auditkit-1.1.6 → auditkit-1.1.7}/examples/applications/05_application_education_arc_tutor.ipynb +0 -0
  108. {auditkit-1.1.6 → auditkit-1.1.7}/examples/applications/06_application_enterprise_search_rag.ipynb +0 -0
  109. {auditkit-1.1.6 → auditkit-1.1.7}/examples/applications/07_application_bert_nli_judge.ipynb +0 -0
  110. {auditkit-1.1.6 → auditkit-1.1.7}/examples/applications/README.md +0 -0
  111. {auditkit-1.1.6 → auditkit-1.1.7}/examples/auditkit.yaml +0 -0
  112. {auditkit-1.1.6 → auditkit-1.1.7}/examples/cohere/README.md +0 -0
  113. {auditkit-1.1.6 → auditkit-1.1.7}/examples/cohere/compare_models.ipynb +0 -0
  114. {auditkit-1.1.6 → auditkit-1.1.7}/examples/cohere/metrics_generation.ipynb +0 -0
  115. {auditkit-1.1.6 → auditkit-1.1.7}/examples/cohere/run_lmeval.ipynb +0 -0
  116. {auditkit-1.1.6 → auditkit-1.1.7}/examples/cohere/sglang_auditkit.ipynb +0 -0
  117. {auditkit-1.1.6 → auditkit-1.1.7}/examples/cohere/tgi_endpoint.ipynb +0 -0
  118. {auditkit-1.1.6 → auditkit-1.1.7}/examples/colab/01_cohere_and_hf_api_models.ipynb +0 -0
  119. {auditkit-1.1.6 → auditkit-1.1.7}/examples/colab/02_agentic_rag_real_agent.ipynb +0 -0
  120. {auditkit-1.1.6 → auditkit-1.1.7}/examples/colab/03_vllm_integration.ipynb +0 -0
  121. {auditkit-1.1.6 → auditkit-1.1.7}/examples/colab/04_cohere_hf_fixes_live.ipynb +0 -0
  122. {auditkit-1.1.6 → auditkit-1.1.7}/examples/colab/05_real_world_agentic_rag.ipynb +0 -0
  123. {auditkit-1.1.6 → auditkit-1.1.7}/examples/colab/06_cohere_all_backends.ipynb +0 -0
  124. {auditkit-1.1.6 → auditkit-1.1.7}/examples/colab/README.md +0 -0
  125. {auditkit-1.1.6 → auditkit-1.1.7}/examples/model_comparison_notebook.py +0 -0
  126. {auditkit-1.1.6 → auditkit-1.1.7}/examples/stress_tests/README.md +0 -0
  127. {auditkit-1.1.6 → auditkit-1.1.7}/examples/stress_tests/test_stress_gated_model.py +0 -0
  128. {auditkit-1.1.6 → auditkit-1.1.7}/examples/stress_tests/test_stress_open_model_load.py +0 -0
  129. {auditkit-1.1.6 → auditkit-1.1.7}/mkdocs.yml +0 -0
  130. {auditkit-1.1.6 → auditkit-1.1.7}/scripts/__init__.py +0 -0
  131. {auditkit-1.1.6 → auditkit-1.1.7}/scripts/release.py +0 -0
  132. {auditkit-1.1.6 → auditkit-1.1.7}/src/auditkit/README.md +0 -0
  133. {auditkit-1.1.6 → auditkit-1.1.7}/src/auditkit/__main__.py +0 -0
  134. {auditkit-1.1.6 → auditkit-1.1.7}/src/auditkit/_identity_guard.py +0 -0
  135. {auditkit-1.1.6 → auditkit-1.1.7}/src/auditkit/_text.py +0 -0
  136. {auditkit-1.1.6 → auditkit-1.1.7}/src/auditkit/adapter.py +0 -0
  137. {auditkit-1.1.6 → auditkit-1.1.7}/src/auditkit/agent_eval/README.md +0 -0
  138. {auditkit-1.1.6 → auditkit-1.1.7}/src/auditkit/agent_eval/__init__.py +0 -0
  139. {auditkit-1.1.6 → auditkit-1.1.7}/src/auditkit/agent_eval/importers.py +0 -0
  140. {auditkit-1.1.6 → auditkit-1.1.7}/src/auditkit/agent_eval/lexsi.py +0 -0
  141. {auditkit-1.1.6 → auditkit-1.1.7}/src/auditkit/agent_eval/outcome.py +0 -0
  142. {auditkit-1.1.6 → auditkit-1.1.7}/src/auditkit/agent_eval/reliability.py +0 -0
  143. {auditkit-1.1.6 → auditkit-1.1.7}/src/auditkit/agent_eval/report.py +0 -0
  144. {auditkit-1.1.6 → auditkit-1.1.7}/src/auditkit/agent_eval/runner.py +0 -0
  145. {auditkit-1.1.6 → auditkit-1.1.7}/src/auditkit/agent_eval/sidecar.py +0 -0
  146. {auditkit-1.1.6 → auditkit-1.1.7}/src/auditkit/agent_eval/types.py +0 -0
  147. {auditkit-1.1.6 → auditkit-1.1.7}/src/auditkit/annotator.py +0 -0
  148. {auditkit-1.1.6 → auditkit-1.1.7}/src/auditkit/assets/auditkit_logo.png +0 -0
  149. {auditkit-1.1.6 → auditkit-1.1.7}/src/auditkit/bfcl.py +0 -0
  150. {auditkit-1.1.6 → auditkit-1.1.7}/src/auditkit/cache.py +0 -0
  151. {auditkit-1.1.6 → auditkit-1.1.7}/src/auditkit/cli.py +0 -0
  152. {auditkit-1.1.6 → auditkit-1.1.7}/src/auditkit/comparison.py +0 -0
  153. {auditkit-1.1.6 → auditkit-1.1.7}/src/auditkit/compat.py +0 -0
  154. {auditkit-1.1.6 → auditkit-1.1.7}/src/auditkit/errors.py +0 -0
  155. {auditkit-1.1.6 → auditkit-1.1.7}/src/auditkit/evaluator.py +0 -0
  156. {auditkit-1.1.6 → auditkit-1.1.7}/src/auditkit/experiment.py +0 -0
  157. {auditkit-1.1.6 → auditkit-1.1.7}/src/auditkit/hf_publish.py +0 -0
  158. {auditkit-1.1.6 → auditkit-1.1.7}/src/auditkit/lexsi_login.py +0 -0
  159. {auditkit-1.1.6 → auditkit-1.1.7}/src/auditkit/lexsi_relay.py +0 -0
  160. {auditkit-1.1.6 → auditkit-1.1.7}/src/auditkit/lmeval_engine.py +0 -0
  161. {auditkit-1.1.6 → auditkit-1.1.7}/src/auditkit/loaders.py +0 -0
  162. {auditkit-1.1.6 → auditkit-1.1.7}/src/auditkit/logs.py +0 -0
  163. {auditkit-1.1.6 → auditkit-1.1.7}/src/auditkit/metric.py +0 -0
  164. {auditkit-1.1.6 → auditkit-1.1.7}/src/auditkit/metrics/README.md +0 -0
  165. {auditkit-1.1.6 → auditkit-1.1.7}/src/auditkit/metrics/__init__.py +0 -0
  166. {auditkit-1.1.6 → auditkit-1.1.7}/src/auditkit/metrics/agent.py +0 -0
  167. {auditkit-1.1.6 → auditkit-1.1.7}/src/auditkit/metrics/code.py +0 -0
  168. {auditkit-1.1.6 → auditkit-1.1.7}/src/auditkit/metrics/embedding.py +0 -0
  169. {auditkit-1.1.6 → auditkit-1.1.7}/src/auditkit/metrics/encoder_judge.py +0 -0
  170. {auditkit-1.1.6 → auditkit-1.1.7}/src/auditkit/metrics/generation.py +0 -0
  171. {auditkit-1.1.6 → auditkit-1.1.7}/src/auditkit/metrics/guard.py +0 -0
  172. {auditkit-1.1.6 → auditkit-1.1.7}/src/auditkit/metrics/hallucination.py +0 -0
  173. {auditkit-1.1.6 → auditkit-1.1.7}/src/auditkit/metrics/judge.py +0 -0
  174. {auditkit-1.1.6 → auditkit-1.1.7}/src/auditkit/metrics/pairwise.py +0 -0
  175. {auditkit-1.1.6 → auditkit-1.1.7}/src/auditkit/metrics/perf.py +0 -0
  176. {auditkit-1.1.6 → auditkit-1.1.7}/src/auditkit/metrics/rag.py +0 -0
  177. {auditkit-1.1.6 → auditkit-1.1.7}/src/auditkit/metrics/rag_judge.py +0 -0
  178. {auditkit-1.1.6 → auditkit-1.1.7}/src/auditkit/metrics/rag_stress.py +0 -0
  179. {auditkit-1.1.6 → auditkit-1.1.7}/src/auditkit/metrics/rag_stress_ops.py +0 -0
  180. {auditkit-1.1.6 → auditkit-1.1.7}/src/auditkit/metrics/rag_stress_runner.py +0 -0
  181. {auditkit-1.1.6 → auditkit-1.1.7}/src/auditkit/metrics/retrieval.py +0 -0
  182. {auditkit-1.1.6 → auditkit-1.1.7}/src/auditkit/metrics/security.py +0 -0
  183. {auditkit-1.1.6 → auditkit-1.1.7}/src/auditkit/metrics/structured.py +0 -0
  184. {auditkit-1.1.6 → auditkit-1.1.7}/src/auditkit/metrics/toxicity.py +0 -0
  185. {auditkit-1.1.6 → auditkit-1.1.7}/src/auditkit/model/README.md +0 -0
  186. {auditkit-1.1.6 → auditkit-1.1.7}/src/auditkit/model/agent_endpoint.py +0 -0
  187. {auditkit-1.1.6 → auditkit-1.1.7}/src/auditkit/model/anthropic.py +0 -0
  188. {auditkit-1.1.6 → auditkit-1.1.7}/src/auditkit/model/api_gen.py +0 -0
  189. {auditkit-1.1.6 → auditkit-1.1.7}/src/auditkit/model/groq_gen.py +0 -0
  190. {auditkit-1.1.6 → auditkit-1.1.7}/src/auditkit/model/lexsi.py +0 -0
  191. {auditkit-1.1.6 → auditkit-1.1.7}/src/auditkit/model/litellm_gen.py +0 -0
  192. {auditkit-1.1.6 → auditkit-1.1.7}/src/auditkit/model/openai.py +0 -0
  193. {auditkit-1.1.6 → auditkit-1.1.7}/src/auditkit/model/openrouter_gen.py +0 -0
  194. {auditkit-1.1.6 → auditkit-1.1.7}/src/auditkit/model/vllm_gen.py +0 -0
  195. {auditkit-1.1.6 → auditkit-1.1.7}/src/auditkit/model_compare.py +0 -0
  196. {auditkit-1.1.6 → auditkit-1.1.7}/src/auditkit/provenance.py +0 -0
  197. {auditkit-1.1.6 → auditkit-1.1.7}/src/auditkit/redteam/README.md +0 -0
  198. {auditkit-1.1.6 → auditkit-1.1.7}/src/auditkit/redteam/__init__.py +0 -0
  199. {auditkit-1.1.6 → auditkit-1.1.7}/src/auditkit/redteam/detector.py +0 -0
  200. {auditkit-1.1.6 → auditkit-1.1.7}/src/auditkit/redteam/detectors/README.md +0 -0
  201. {auditkit-1.1.6 → auditkit-1.1.7}/src/auditkit/redteam/detectors/builtin.py +0 -0
  202. {auditkit-1.1.6 → auditkit-1.1.7}/src/auditkit/redteam/probe.py +0 -0
  203. {auditkit-1.1.6 → auditkit-1.1.7}/src/auditkit/redteam/probes/README.md +0 -0
  204. {auditkit-1.1.6 → auditkit-1.1.7}/src/auditkit/redteam/probes/builtin.py +0 -0
  205. {auditkit-1.1.6 → auditkit-1.1.7}/src/auditkit/redteam/runner.py +0 -0
  206. {auditkit-1.1.6 → auditkit-1.1.7}/src/auditkit/registry.py +0 -0
  207. {auditkit-1.1.6 → auditkit-1.1.7}/src/auditkit/report.py +0 -0
  208. {auditkit-1.1.6 → auditkit-1.1.7}/src/auditkit/report_format.py +0 -0
  209. {auditkit-1.1.6 → auditkit-1.1.7}/src/auditkit/router.py +0 -0
  210. {auditkit-1.1.6 → auditkit-1.1.7}/src/auditkit/runspec.py +0 -0
  211. {auditkit-1.1.6 → auditkit-1.1.7}/src/auditkit/sample.py +0 -0
  212. {auditkit-1.1.6 → auditkit-1.1.7}/src/auditkit/scenario.py +0 -0
  213. {auditkit-1.1.6 → auditkit-1.1.7}/src/auditkit/scenarios/README.md +0 -0
  214. {auditkit-1.1.6 → auditkit-1.1.7}/src/auditkit/scenarios/__init__.py +0 -0
  215. {auditkit-1.1.6 → auditkit-1.1.7}/src/auditkit/scenarios/arc.py +0 -0
  216. {auditkit-1.1.6 → auditkit-1.1.7}/src/auditkit/scenarios/gsm8k.py +0 -0
  217. {auditkit-1.1.6 → auditkit-1.1.7}/src/auditkit/scenarios/hellaswag.py +0 -0
  218. {auditkit-1.1.6 → auditkit-1.1.7}/src/auditkit/scenarios/humaneval.py +0 -0
  219. {auditkit-1.1.6 → auditkit-1.1.7}/src/auditkit/scenarios/mmlu.py +0 -0
  220. {auditkit-1.1.6 → auditkit-1.1.7}/src/auditkit/scenarios/truthfulqa.py +0 -0
  221. {auditkit-1.1.6 → auditkit-1.1.7}/src/auditkit/scoring.py +0 -0
  222. {auditkit-1.1.6 → auditkit-1.1.7}/src/auditkit/trace.py +0 -0
  223. {auditkit-1.1.6 → auditkit-1.1.7}/src/auditkit/types.py +0 -0
  224. {auditkit-1.1.6 → auditkit-1.1.7}/tests/README.md +0 -0
  225. {auditkit-1.1.6 → auditkit-1.1.7}/tests/__init__.py +0 -0
  226. {auditkit-1.1.6 → auditkit-1.1.7}/tests/agentic_suite/.gitignore +0 -0
  227. {auditkit-1.1.6 → auditkit-1.1.7}/tests/agentic_suite/FINDINGS.md +0 -0
  228. {auditkit-1.1.6 → auditkit-1.1.7}/tests/agentic_suite/README.md +0 -0
  229. {auditkit-1.1.6 → auditkit-1.1.7}/tests/agentic_suite/__init__.py +0 -0
  230. {auditkit-1.1.6 → auditkit-1.1.7}/tests/agentic_suite/catalog.py +0 -0
  231. {auditkit-1.1.6 → auditkit-1.1.7}/tests/agentic_suite/colab_model_matrix.ipynb +0 -0
  232. {auditkit-1.1.6 → auditkit-1.1.7}/tests/agentic_suite/colab_offline_suite.ipynb +0 -0
  233. {auditkit-1.1.6 → auditkit-1.1.7}/tests/agentic_suite/conftest.py +0 -0
  234. {auditkit-1.1.6 → auditkit-1.1.7}/tests/agentic_suite/make_metric_reports.py +0 -0
  235. {auditkit-1.1.6 → auditkit-1.1.7}/tests/agentic_suite/test_agentic_pipeline_all_metrics.py +0 -0
  236. {auditkit-1.1.6 → auditkit-1.1.7}/tests/agentic_suite/test_fingerprint_offline.py +0 -0
  237. {auditkit-1.1.6 → auditkit-1.1.7}/tests/agentic_suite/test_formats_offline.py +0 -0
  238. {auditkit-1.1.6 → auditkit-1.1.7}/tests/agentic_suite/test_live.py +0 -0
  239. {auditkit-1.1.6 → auditkit-1.1.7}/tests/agentic_suite/test_live_rag.py +0 -0
  240. {auditkit-1.1.6 → auditkit-1.1.7}/tests/agentic_suite/test_metrics_offline.py +0 -0
  241. {auditkit-1.1.6 → auditkit-1.1.7}/tests/agentic_suite/test_pipeline_offline.py +0 -0
  242. {auditkit-1.1.6 → auditkit-1.1.7}/tests/agentic_suite/test_rag_offline.py +0 -0
  243. {auditkit-1.1.6 → auditkit-1.1.7}/tests/agentic_suite/test_resolved_issues.py +0 -0
  244. {auditkit-1.1.6 → auditkit-1.1.7}/tests/fixtures/chat_templates/aya_expanse.jinja +0 -0
  245. {auditkit-1.1.6 → auditkit-1.1.7}/tests/fixtures/chat_templates/command_r7b_tool_use.jinja +0 -0
  246. {auditkit-1.1.6 → auditkit-1.1.7}/tests/fixtures/chat_templates/tiny_aya_default.jinja +0 -0
  247. {auditkit-1.1.6 → auditkit-1.1.7}/tests/fixtures/lexsi_real/agenttune/dataset_train_grpo.jsonl +0 -0
  248. {auditkit-1.1.6 → auditkit-1.1.7}/tests/fixtures/lexsi_real/agenttune/report_constructed.json +0 -0
  249. {auditkit-1.1.6 → auditkit-1.1.7}/tests/fixtures/lexsi_real/agenttune/trace_finder.jsonl +0 -0
  250. {auditkit-1.1.6 → auditkit-1.1.7}/tests/fixtures/lexsi_real/agenttune/trace_hotpotqa.jsonl +0 -0
  251. {auditkit-1.1.6 → auditkit-1.1.7}/tests/fixtures/lexsi_real/agenttune/trajectory_store_export.jsonl +0 -0
  252. {auditkit-1.1.6 → auditkit-1.1.7}/tests/fixtures/lexsi_real/aligntune/AuditReport.json +0 -0
  253. {auditkit-1.1.6 → auditkit-1.1.7}/tests/fixtures/lexsi_real/aligntune/RegressionReport.json +0 -0
  254. {auditkit-1.1.6 → auditkit-1.1.7}/tests/fixtures/lexsi_real/circuitkit/faithfulness_report.json +0 -0
  255. {auditkit-1.1.6 → auditkit-1.1.7}/tests/fixtures/lexsi_real/circuitkit/faithfulness_report_default.json +0 -0
  256. {auditkit-1.1.6 → auditkit-1.1.7}/tests/fixtures/lexsi_real/circuitkit/faithfulness_report_ib_fastpath.json +0 -0
  257. {auditkit-1.1.6 → auditkit-1.1.7}/tests/fixtures/lexsi_real/circuitkit/faithfulness_report_nonfinite.json +0 -0
  258. {auditkit-1.1.6 → auditkit-1.1.7}/tests/fixtures/lexsi_real/circuitkit/faithfulness_report_unknown_sentinels.json +0 -0
  259. {auditkit-1.1.6 → auditkit-1.1.7}/tests/fixtures/lexsi_real/curatorkit/checkpoint_TextCleaner.jsonl +0 -0
  260. {auditkit-1.1.6 → auditkit-1.1.7}/tests/fixtures/lexsi_real/curatorkit/data_sample.json +0 -0
  261. {auditkit-1.1.6 → auditkit-1.1.7}/tests/fixtures/lexsi_real/curatorkit/data_sample_pdf.json +0 -0
  262. {auditkit-1.1.6 → auditkit-1.1.7}/tests/fixtures/lexsi_real/curatorkit/manifest.json +0 -0
  263. {auditkit-1.1.6 → auditkit-1.1.7}/tests/fixtures/lexsi_real/curatorkit/manifest_pdf.json +0 -0
  264. {auditkit-1.1.6 → auditkit-1.1.7}/tests/fixtures/lexsi_real/curatorkit/rejected.jsonl +0 -0
  265. {auditkit-1.1.6 → auditkit-1.1.7}/tests/fixtures/lexsi_real/curatorkit/rejected_pdf.jsonl +0 -0
  266. {auditkit-1.1.6 → auditkit-1.1.7}/tests/fixtures/lexsi_real/curatorkit/sft_alpaca.jsonl +0 -0
  267. {auditkit-1.1.6 → auditkit-1.1.7}/tests/fixtures/lexsi_real/curatorkit/sft_sharegpt.jsonl +0 -0
  268. {auditkit-1.1.6 → auditkit-1.1.7}/tests/fixtures/lexsi_real/safetune/placeholder-model__base__placeholder_bench.jsonl +0 -0
  269. {auditkit-1.1.6 → auditkit-1.1.7}/tests/fixtures/lexsi_real/safetune/placeholder-model__base__placeholder_bench_scored.jsonl +0 -0
  270. {auditkit-1.1.6 → auditkit-1.1.7}/tests/fixtures/lexsi_real/safetune/safety_audit_event__post_allow_long_redacted.json +0 -0
  271. {auditkit-1.1.6 → auditkit-1.1.7}/tests/fixtures/lexsi_real/safetune/safety_audit_event__post_keyword_classifier_block.json +0 -0
  272. {auditkit-1.1.6 → auditkit-1.1.7}/tests/fixtures/lexsi_real/safetune/safety_audit_event__pre_allow.json +0 -0
  273. {auditkit-1.1.6 → auditkit-1.1.7}/tests/fixtures/lexsi_real/safetune/safety_audit_event__pre_tool_block.json +0 -0
  274. {auditkit-1.1.6 → auditkit-1.1.7}/tests/fixtures/sglang_0520/commandr_excerpt.py +0 -0
  275. {auditkit-1.1.6 → auditkit-1.1.7}/tests/fixtures/sglang_0520/transformers_backend_excerpt.py +0 -0
  276. {auditkit-1.1.6 → auditkit-1.1.7}/tests/fixtures/sglang_0520/unified_radix_cache_excerpt.py +0 -0
  277. {auditkit-1.1.6 → auditkit-1.1.7}/tests/integrations_suite/README.md +0 -0
  278. {auditkit-1.1.6 → auditkit-1.1.7}/tests/integrations_suite/__init__.py +0 -0
  279. {auditkit-1.1.6 → auditkit-1.1.7}/tests/integrations_suite/colab_cohere_models.ipynb +0 -0
  280. {auditkit-1.1.6 → auditkit-1.1.7}/tests/integrations_suite/colab_integrations.ipynb +0 -0
  281. {auditkit-1.1.6 → auditkit-1.1.7}/tests/integrations_suite/colab_sglang.ipynb +0 -0
  282. {auditkit-1.1.6 → auditkit-1.1.7}/tests/integrations_suite/colab_sglang_32b_north.ipynb +0 -0
  283. {auditkit-1.1.6 → auditkit-1.1.7}/tests/integrations_suite/colab_sglang_cohere_matrix.ipynb +0 -0
  284. {auditkit-1.1.6 → auditkit-1.1.7}/tests/integrations_suite/colab_vllm_32b.ipynb +0 -0
  285. {auditkit-1.1.6 → auditkit-1.1.7}/tests/integrations_suite/colab_vllm_cohere_matrix.ipynb +0 -0
  286. {auditkit-1.1.6 → auditkit-1.1.7}/tests/integrations_suite/conftest.py +0 -0
  287. {auditkit-1.1.6 → auditkit-1.1.7}/tests/integrations_suite/test_agenttune.py +0 -0
  288. {auditkit-1.1.6 → auditkit-1.1.7}/tests/integrations_suite/test_cohere.py +0 -0
  289. {auditkit-1.1.6 → auditkit-1.1.7}/tests/integrations_suite/test_hf.py +0 -0
  290. {auditkit-1.1.6 → auditkit-1.1.7}/tests/integrations_suite/test_live.py +0 -0
  291. {auditkit-1.1.6 → auditkit-1.1.7}/tests/integrations_suite/test_sglang.py +0 -0
  292. {auditkit-1.1.6 → auditkit-1.1.7}/tests/issues_suite/README.md +0 -0
  293. {auditkit-1.1.6 → auditkit-1.1.7}/tests/issues_suite/__init__.py +0 -0
  294. {auditkit-1.1.6 → auditkit-1.1.7}/tests/issues_suite/conftest.py +0 -0
  295. {auditkit-1.1.6 → auditkit-1.1.7}/tests/issues_suite/serve_model.py +0 -0
  296. {auditkit-1.1.6 → auditkit-1.1.7}/tests/issues_suite/test_issue43_specs.py +0 -0
  297. {auditkit-1.1.6 → auditkit-1.1.7}/tests/issues_suite/test_issue44_user_flows.py +0 -0
  298. {auditkit-1.1.6 → auditkit-1.1.7}/tests/issues_suite/test_issue45_bfcl.py +0 -0
  299. {auditkit-1.1.6 → auditkit-1.1.7}/tests/issues_suite/test_issue45_routes.py +0 -0
  300. {auditkit-1.1.6 → auditkit-1.1.7}/tests/issues_suite/test_live.py +0 -0
  301. {auditkit-1.1.6 → auditkit-1.1.7}/tests/issues_suite/test_vllm_cohere_templates.py +0 -0
  302. {auditkit-1.1.6 → auditkit-1.1.7}/tests/nonmetric_suite/README.md +0 -0
  303. {auditkit-1.1.6 → auditkit-1.1.7}/tests/nonmetric_suite/__init__.py +0 -0
  304. {auditkit-1.1.6 → auditkit-1.1.7}/tests/nonmetric_suite/conftest.py +0 -0
  305. {auditkit-1.1.6 → auditkit-1.1.7}/tests/nonmetric_suite/test_agent_eval_and_loaders.py +0 -0
  306. {auditkit-1.1.6 → auditkit-1.1.7}/tests/nonmetric_suite/test_mrm_evidence.py +0 -0
  307. {auditkit-1.1.6 → auditkit-1.1.7}/tests/nonmetric_suite/test_redteam_machinery.py +0 -0
  308. {auditkit-1.1.6 → auditkit-1.1.7}/tests/pipeline_suite/README.md +0 -0
  309. {auditkit-1.1.6 → auditkit-1.1.7}/tests/pipeline_suite/__init__.py +0 -0
  310. {auditkit-1.1.6 → auditkit-1.1.7}/tests/pipeline_suite/conftest.py +0 -0
  311. {auditkit-1.1.6 → auditkit-1.1.7}/tests/pipeline_suite/test_edge_agent_and_rag_judges.py +0 -0
  312. {auditkit-1.1.6 → auditkit-1.1.7}/tests/pipeline_suite/test_edge_mrm.py +0 -0
  313. {auditkit-1.1.6 → auditkit-1.1.7}/tests/pipeline_suite/test_edge_rag_stress.py +0 -0
  314. {auditkit-1.1.6 → auditkit-1.1.7}/tests/pipeline_suite/test_edge_redteam_judges.py +0 -0
  315. {auditkit-1.1.6 → auditkit-1.1.7}/tests/pipeline_suite/test_edge_uncertainty.py +0 -0
  316. {auditkit-1.1.6 → auditkit-1.1.7}/tests/pipeline_suite/test_pr1_additions.py +0 -0
  317. {auditkit-1.1.6 → auditkit-1.1.7}/tests/pipeline_suite/test_pr2_redteam.py +0 -0
  318. {auditkit-1.1.6 → auditkit-1.1.7}/tests/pipeline_suite/test_pr3_mrm.py +0 -0
  319. {auditkit-1.1.6 → auditkit-1.1.7}/tests/pipeline_suite/test_pr4_uncertainty.py +0 -0
  320. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_adapter.py +0 -0
  321. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_adapter_params.py +0 -0
  322. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_agent_endpoint.py +0 -0
  323. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_agent_eval_cli.py +0 -0
  324. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_agent_eval_disagreement.py +0 -0
  325. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_agent_eval_eventlog.py +0 -0
  326. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_agent_eval_harness.py +0 -0
  327. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_agent_eval_importers.py +0 -0
  328. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_agent_eval_outcome.py +0 -0
  329. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_agent_eval_reliability.py +0 -0
  330. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_agent_eval_runner.py +0 -0
  331. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_agent_eval_secrets.py +0 -0
  332. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_agent_eval_sidecar.py +0 -0
  333. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_agent_eval_types.py +0 -0
  334. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_agent_metrics.py +0 -0
  335. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_agent_reference_free.py +0 -0
  336. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_agenttune_fix_plan.py +0 -0
  337. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_agenttune_integration.py +0 -0
  338. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_annotator.py +0 -0
  339. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_api.py +0 -0
  340. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_api_backend.py +0 -0
  341. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_api_images.py +0 -0
  342. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_api_tool_calls.py +0 -0
  343. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_api_unverified_fields.py +0 -0
  344. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_apostrophe_fold.py +0 -0
  345. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_benchmark.py +0 -0
  346. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_chat_messages.py +0 -0
  347. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_chat_template_kwargs_everywhere.py +0 -0
  348. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_cli.py +0 -0
  349. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_cli_yaml_model.py +0 -0
  350. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_code_metrics.py +0 -0
  351. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_cohere_aya.py +0 -0
  352. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_cohere_hf_fix_plan.py +0 -0
  353. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_cohere_tool_calls.py +0 -0
  354. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_compare.py +0 -0
  355. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_comparison.py +0 -0
  356. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_compat.py +0 -0
  357. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_core_engine.py +0 -0
  358. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_custom_judge_pipeline.py +0 -0
  359. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_diff.py +0 -0
  360. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_embedding_metrics.py +0 -0
  361. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_encoder_judge.py +0 -0
  362. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_env_compat_fix_plan.py +0 -0
  363. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_errors.py +0 -0
  364. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_evaluate_many.py +0 -0
  365. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_eventlog_action_shapes.py +0 -0
  366. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_execute_concurrency.py +0 -0
  367. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_experiment.py +0 -0
  368. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_failed_as_zero.py +0 -0
  369. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_fingerprint_stability.py +0 -0
  370. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_generation_kwargs.py +0 -0
  371. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_generation_metrics.py +0 -0
  372. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_guard.py +0 -0
  373. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_hallucination_metrics.py +0 -0
  374. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_hf_device_map.py +0 -0
  375. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_hf_dtype_fallback.py +0 -0
  376. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_hf_gen_import_error.py +0 -0
  377. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_hf_gen_logits_sanitizer.py +0 -0
  378. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_hf_interop.py +0 -0
  379. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_hf_wire_format.py +0 -0
  380. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_integration.py +0 -0
  381. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_judge.py +0 -0
  382. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_judge_flow.py +0 -0
  383. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_judge_indic_choices.py +0 -0
  384. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_judge_number_parse.py +0 -0
  385. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_judge_option_labels.py +0 -0
  386. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_lexsi_compat.py +0 -0
  387. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_llm_judge.py +0 -0
  388. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_lmeval_engine.py +0 -0
  389. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_lmeval_real_pipeline.py +0 -0
  390. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_load_dataset.py +0 -0
  391. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_loaders.py +0 -0
  392. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_loaders_agent.py +0 -0
  393. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_mcq_gen_params.py +0 -0
  394. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_metric.py +0 -0
  395. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_metric_properties.py +0 -0
  396. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_metrics_via_pipeline.py +0 -0
  397. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_missing_is_not_zero.py +0 -0
  398. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_model.py +0 -0
  399. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_model_backends.py +0 -0
  400. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_multipath_references.py +0 -0
  401. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_paired_bootstrap.py +0 -0
  402. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_pairwise_metrics.py +0 -0
  403. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_pipeline_live_hf.py +0 -0
  404. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_practical.py +0 -0
  405. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_provenance.py +0 -0
  406. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_rag_judge.py +0 -0
  407. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_rag_metrics.py +0 -0
  408. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_rag_reference_free.py +0 -0
  409. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_rag_stress.py +0 -0
  410. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_rag_stress_ops.py +0 -0
  411. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_rag_stress_runner.py +0 -0
  412. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_redteam.py +0 -0
  413. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_reference_fingerprint.py +0 -0
  414. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_registry.py +0 -0
  415. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_release.py +0 -0
  416. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_retrieval_metrics.py +0 -0
  417. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_review27_followups.py +0 -0
  418. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_route_distribution.py +0 -0
  419. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_router.py +0 -0
  420. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_runner.py +0 -0
  421. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_sample.py +0 -0
  422. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_scenario_dataset_ids.py +0 -0
  423. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_scenarios.py +0 -0
  424. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_score.py +0 -0
  425. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_scorer_context_typeerror.py +0 -0
  426. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_scorer_order_cache.py +0 -0
  427. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_security_perf.py +0 -0
  428. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_structured_metrics.py +0 -0
  429. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_summary_failed_samples.py +0 -0
  430. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_template_kwargs_f1_fix_plan.py +0 -0
  431. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_token_usage_and_cost.py +0 -0
  432. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_toxicity_metrics.py +0 -0
  433. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_trace.py +0 -0
  434. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_track3_agenttune.py +0 -0
  435. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_types.py +0 -0
  436. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_unknown_architecture_message.py +0 -0
  437. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_unmeasured_not_zero.py +0 -0
  438. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_unscored_results.py +0 -0
  439. {auditkit-1.1.6 → auditkit-1.1.7}/tests/test_vllm_offline_engine.py +0 -0
@@ -110,6 +110,18 @@ All notable changes to AuditKIT. The format follows [Keep a Changelog](https://k
110
110
 
111
111
  ### Fixed
112
112
 
113
+ - `evaluate()` and `generate()` take `cache=False` (native engine), which runs without the disk cache.
114
+ `CallableModel` warns when a function model reads state the run fingerprint cannot see, such as a model
115
+ object whose weights are edited in place, because such a model is otherwise served an earlier run's result.
116
+ - `RunResult.model_spec` is the model's name, not an object repr.
117
+ - `Prediction.correct` honours a lower-is-better metric's direction. For an ungated 0/1 score it was
118
+ `value == 1.0` whatever the direction, so every harmful answer on a `harmful` or `error` flag counted
119
+ as correct and `RunComparison.regressed()`, `improved()` and `RunDiff` returned each other's samples.
120
+ - A `FunctionScorer`'s identity covers its code and the values it closes over, not only its name. Editing
121
+ the function body under the same name no longer returns the previous run's cached scores.
122
+ - `paired_bootstrap` no longer lets float rounding decide ties between resampled and observed means on
123
+ discrete scores, and sums with `math.fsum`, so the p-value is the same on every Python version.
124
+ - `hf:` `loglikelihood` takes its softmax in float32. On a bf16 or fp16 model the log-probabilities were rounded by several hundredths, enough to flip near ties in multiple-choice scoring.
113
125
  - Broken relative link in `examples/applications/README.md`: `../examples/` resolved to
114
126
  `examples/examples/`; it now points at `../`.
115
127
  - `auditkit eval --config FILE` accepts `model:` from the config file. `--model` was
@@ -8,7 +8,7 @@ abstract: |
8
8
  type: software
9
9
  message: "If you use this software, please cite it."
10
10
 
11
- version: 1.1.6
11
+ version: 1.1.7
12
12
 
13
13
  authors:
14
14
  - family-names: "Arora"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: auditkit
3
- Version: 1.1.6
3
+ Version: 1.1.7
4
4
  Summary: Evaluate any model on any dataset and any task — standalone, no platform required
5
5
  Project-URL: Homepage, https://auditkit.lexsi.ai/
6
6
  Project-URL: Documentation, https://auditkit.lexsi.ai/
@@ -149,6 +149,7 @@ Requires-Dist: pytest; extra == 'dev'
149
149
  Requires-Dist: pytest-asyncio; extra == 'dev'
150
150
  Requires-Dist: pytest-mock; extra == 'dev'
151
151
  Requires-Dist: pyyaml; extra == 'dev'
152
+ Requires-Dist: requests; extra == 'dev'
152
153
  Provides-Extra: interop
153
154
  Requires-Dist: datasets; extra == 'interop'
154
155
  Requires-Dist: gitpython; extra == 'interop'
@@ -220,7 +220,7 @@ Every run returns a **`RunResult`**:
220
220
  | `stats` | `{metric_name: Stat}` — full distribution |
221
221
  | `predictions` | `list[Prediction]` — the per-sample answer browser |
222
222
  | `config` | the `RunConfig` used |
223
- | `model_spec` | the model (see serialization caveat below) |
223
+ | `model_spec` | the model as a string: its spec (`"hf:gpt2"`), or name plus checkpoint for a directly built backend |
224
224
  | `errors` / `failed_count` | per-sample/metric errors (never abort the run) |
225
225
  | `unscored` | per metric, results left out of the aggregate because they aren't measurements (`unknown` / `not_tested` counts) |
226
226
  | `experiment_name` / `tags` | optional tracking metadata |
@@ -236,8 +236,6 @@ Useful `RunResult` methods:
236
236
  - `cost(pricing)` → dollar cost; `pricing = {"input_per_1m": ..., "output_per_1m": ...}`. Returns `None` if no token usage; **raises `KeyError`** if a pricing key is missing (only reachable when there *is* usage). No bundled price table by design.
237
237
  - `save(path, fmt="json"|"csv")` / `RunResult.load(path)` / `to_dict()` / `from_dict()`.
238
238
 
239
- > **`model_spec` doesn't serialize cleanly.** `to_dict()` stores the live `Model` object, so `save()`/cache writes render it as an unusable repr string like `"<auditkit.model.groq_gen.GroqModel object at 0x…>"`. Everything else (`config`, `headline`, `predictions`, `perf`, `token_usage`) round-trips fine. This also affects cached runs.
240
-
241
239
  `ak.Result` is a public alias of `RunResult`.
242
240
 
243
241
  ---
@@ -1007,7 +1005,6 @@ The six registries: `SCENARIOS`, `ADAPTERS`, `MODELS`, `METRICS`, `ANNOTATORS`,
1007
1005
  A single list of everything flagged inline above. None of these break the *correctness of a score* unless noted. Most are about coverage, ergonomics, or reporting.
1008
1006
 
1009
1007
  **Confirmed bugs / rough edges**
1010
- - **`model_spec` doesn't serialize**: `save()`/cache store an unusable object-repr string for the model; everything else round-trips.
1011
1008
  - **String scorers only work zero-config**: parameterized metrics (`contains`, `regex`, `keyword_detector`, `g_eval`, …) must be passed as instances.
1012
1009
  - **Native built-in scenarios** have no few-shot prompting or code execution (HumanEval can't be scored for pass@k); `ak.run_lmeval()` covers both.
1013
1010
  - **Latency is call-level**: at `concurrency=1`, latency percentiles are a single sample (n=1). Per-request latency from `groq:`/`api:` is computed but unused.
@@ -10,7 +10,6 @@ Open problems and limitations in the current code. The
10
10
  | Issue | Where | Detail |
11
11
  |---|---|---|
12
12
  | No annotator integration for 3 metrics | `metrics/pairwise.py` | `win_rate`, `elo_score`, `preference_accuracy` all read fixed top-level `context` keys (`candidates`, `pairwise_results`, `preference_data`) that an `Annotator`'s output never populates. `extract_with=` has no effect on any of these — see [Annotators](annotators.md). |
13
- | `RunResult.model_spec` doesn't serialize cleanly | `src/auditkit/report.py` | `RunResult.to_dict()` stores the live `Model` instance, not the original spec string — `json.dump(..., default=str)` produces an object-repr string (e.g. `"<auditkit.model.groq_gen.GroqModel object at 0x...>"`). Everything else on `RunResult` round-trips through save/load. |
14
13
  | `num_completions`/`best_of` don't affect the score; `RunConfig.extra` is unused | `src/auditkit/runner.py` | Both reach backends that support them, but scoring only reads `completions[0]`, so extra completions change cost, not the score. `RunConfig.extra` is hashed into the fingerprint but nothing reads it. |
15
14
  | Two percentile formulas | `score.py`, `metrics/perf.py` | `Stat.percentile()` interpolates linearly; `LatencyStats` (used for `RunResult.perf["latency_ms"]`) uses index truncation, so their p95/p99 differ on the same data (e.g. `[10, 20, 30, 40, 100]`: 88 vs 40). At the default `concurrency=1` a run has one timed call, so it only shows at `concurrency>1`. |
16
15
  | `Throughput` overcounts elapsed time under concurrency | `metrics/perf.py` | Requests and tokens per second divide by the **sum** of per-call durations, not wall-clock time, so with `concurrency>1` they understate real throughput. |
@@ -25,5 +24,5 @@ Open problems and limitations in the current code. The
25
24
  - **`HFGenModel.loglikelihood()`** does one forward pass per request, not batched across a request list.
26
25
  - **`representation_skew`** measures demographic-*representation* balance, not bias. By design it can't see meaning — a sentence mentioning men and women equally scores `0.0` even if blatantly sexist — and it's a per-sample signal best read in aggregate over a run. For biased *content*, use `bias_judge` (LLM-as-judge); for whether the model *treats groups differently*, run a counterfactual benchmark (BBQ / CrowS-Pairs via `run_lmeval`).
27
26
  - **`win_rate`/`elo_score`/`preference_accuracy`** silently fall back to a crude token-overlap proxy score whenever the caller doesn't manually populate the relevant `context` key (`candidates`/`pairwise_results`/`preference_data`) — easy to use without realizing you're getting the degraded fallback.
28
- - **Bootstrap significance is a conservative heuristic.** `paired_bootstrap` (used by `RunComparison.significance`, `CompareResult.significance`, `Experiment.significance`) resamples the per-sample diffs and compares each resample's mean magnitude to the observed mean — so a large but *low-variance* difference (e.g. every sample flips the same way) reports `significant=False`. Treat it as a rough guard, not a rigorous test.
27
+ - **Bootstrap significance has limited resolution.** `paired_bootstrap` (used by `RunComparison.significance`, `CompareResult.significance`, `Experiment.significance`) is a paired bootstrap centred under the null (fixed in #20; a large, consistent difference now reports `significant=True`). With the default 1,000 resamples the smallest p it can report is about 0.001, and a p near a cut-off moves by a few thousandths with the resampling draws (seed, sample order). For 0/1 scores near a threshold, confirm with an exact paired test (sign / McNemar).
29
28
  - **Model comparison scores each run independently, then diffs.** Pairwise-preference judging (`metrics/pairwise.py`) isn't wired into `RunComparison`. `RunComparison.tradeoff()` adds latency and size ratios from each run's measured `RunResult.perf` and `RunResult.model_size` when both sides have them (`RunConfig.track_performance`, on by default).
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "auditkit"
7
- version = "1.1.6"
7
+ version = "1.1.7"
8
8
  description = "Evaluate any model on any dataset and any task — standalone, no platform required"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"
@@ -59,7 +59,8 @@ bert-score = ["bert-score", "torch>=2.4"]
59
59
  relay = ["flask", "werkzeug", "requests"] # LexsiCompletionsRelay (lexsi_relay.py)
60
60
  lexsi-sdk = ["lexsi-sdk"] # lexsi_login()/run_benchmark(lexsi_org=...) (lexsi_login.py) -- the only place it's imported
61
61
  # pyyaml: tests/test_cli_yaml_model.py exercises `eval --config`, which needs it.
62
- dev = ["pytest", "pytest-asyncio", "pytest-mock", "pyyaml", "jsonschema>=4.18"]
62
+ # requests: the api:/groq:/lexsi: and SGLang-server tests drive real HTTP backends.
63
+ dev = ["pytest", "pytest-asyncio", "pytest-mock", "pyyaml", "jsonschema>=4.18", "requests"]
63
64
  all = [
64
65
  "auditkit[openai,anthropic,transformers,lmeval,vision,interop,mlflow,requests,jsonschema,vllm,litellm,bert-score,relay,lexsi-sdk,dev]",
65
66
  ]
@@ -7,7 +7,7 @@ from importlib import metadata as _metadata
7
7
  try:
8
8
  __version__ = _metadata.version("auditkit")
9
9
  except _metadata.PackageNotFoundError: # a source checkout that was never installed
10
- __version__ = "1.1.6"
10
+ __version__ = "1.1.7"
11
11
 
12
12
  from .api import run_lmeval, compare, evaluate, evaluate_many, generate, scorer
13
13
  from .lexsi_login import lexsi_login
@@ -11,6 +11,7 @@ here align **by sample_id** via :func:`score_pairs`.
11
11
 
12
12
  from __future__ import annotations
13
13
 
14
+ import math
14
15
  import random
15
16
  from typing import Any, Optional
16
17
 
@@ -63,17 +64,22 @@ def paired_bootstrap(
63
64
  if n < 2:
64
65
  return {"error": "need at least 2 aligned sample pairs", "n": n}
65
66
  diffs = [c - b for b, c in pairs]
66
- mean_baseline = sum(b for b, _ in pairs) / n
67
- mean_candidate = sum(c for _, c in pairs) / n
68
- observed = sum(diffs) / n
67
+ # math.fsum is correctly rounded on every Python; the built-in float sum() changed in 3.12.
68
+ mean_baseline = math.fsum(b for b, _ in pairs) / n
69
+ mean_candidate = math.fsum(c for _, c in pairs) / n
70
+ observed = math.fsum(diffs) / n
69
71
  rng = random.Random(seed)
70
72
  # Null hypothesis: no difference. Centre the differences on zero before resampling; resampling the raw
71
73
  # differences centres the resampled means on `observed`, which puts p near 0.5 whatever the effect.
72
74
  centred = [d - observed for d in diffs]
75
+ # Discrete scores (0/1 flags, exact match) make resampled means that tie the observed one
76
+ # exactly; centring leaves rounding error in each value, so an exact >= would decide those ties
77
+ # by float noise. A tie counts as "at least as extreme", as in exact arithmetic.
78
+ threshold = abs(observed) - 1e-9 * max(1.0, abs(observed))
73
79
  count = 0
74
80
  for _ in range(n_resamples):
75
81
  resample = [rng.choice(centred) for _ in range(n)]
76
- if abs(sum(resample) / n) >= abs(observed):
82
+ if abs(math.fsum(resample) / n) >= threshold:
77
83
  count += 1
78
84
  p = (count + 1) / (n_resamples + 1)
79
85
  return {
@@ -190,6 +190,7 @@ def evaluate(
190
190
  tags: list[str] | None = None,
191
191
  dataset_config: str | None = None,
192
192
  dataset_split: str | None = None,
193
+ cache: bool = True,
193
194
  **opts: Any,
194
195
  ) -> RunResult:
195
196
  """Evaluate a model on a dataset and return a :class:`RunResult`.
@@ -240,11 +241,17 @@ def evaluate(
240
241
  For a folder or Hub id *dataset*: the config name (HF
241
242
  ``load_dataset(path, name)``) and split (default: the first of test /
242
243
  validation / train present).
244
+ cache
245
+ ``False`` runs without the disk cache: no earlier result is replayed and
246
+ none is stored (native engine). Use it when the model depends on state the
247
+ fingerprint cannot see, such as a function over weights edited in place.
243
248
  **opts
244
249
  Extra keyword args passed to the model constructor (native) or to
245
250
  lm-eval's ``model_args`` (``engine="lmeval"``: ``base_url``, ``dtype``, …).
246
251
  """
247
252
  if engine == "lmeval":
253
+ if not cache:
254
+ raise ValueError("cache=False is supported by the native engine only")
248
255
  from .lmeval_engine import run_benchmark
249
256
 
250
257
  result = run_benchmark(
@@ -270,7 +277,7 @@ def evaluate(
270
277
  config=cfg,
271
278
  )
272
279
 
273
- result = Runner().run(spec, verbose=verbose)
280
+ result = Runner().run(spec, verbose=verbose, cache=cache)
274
281
  return _record_experiment(result, experiment_name, tags)
275
282
 
276
283
 
@@ -334,6 +341,7 @@ def generate(
334
341
  adapter: Union[Adapter, str, None] = None,
335
342
  config: Optional[RunConfig] = None,
336
343
  verbose: bool = False,
344
+ cache: bool = True,
337
345
  **opts: Any,
338
346
  ) -> list[Sample]:
339
347
  """Generate answers for a dataset and return samples with ``actual_output`` set.
@@ -358,7 +366,7 @@ def generate(
358
366
  metrics=[],
359
367
  config=config or RunConfig(),
360
368
  )
361
- result = Runner().run(spec, verbose=verbose)
369
+ result = Runner().run(spec, verbose=verbose, cache=cache) # cache: as in evaluate()
362
370
  # Persist the structured trace too (native tool_calls/messages/retrieved
363
371
  # contexts an api:/agent: backend produced) into actual_trace, so a later
364
372
  # precomputed evaluate() scores the run's tool calls / contexts instead of
@@ -4,7 +4,7 @@ from enum import Enum
4
4
  from typing import Iterable, Optional
5
5
 
6
6
  from .report import RunResult, Prediction
7
- from .score import _measured_value
7
+ from .score import _measured_value, correct_value
8
8
  from .types import Direction
9
9
 
10
10
 
@@ -165,12 +165,13 @@ class RunDiff:
165
165
  # bool(value) was wrong for any thresholded/continuous score
166
166
  # (e.g. value=0.6, threshold=0.7, passed=False -- bool(0.6)
167
167
  # is truthy, silently reporting a failing sample as correct).
168
- # Falls back to the same value==1.0 convention Runner.score_one()
169
- # itself uses for Prediction.correct when there's no threshold.
168
+ # Falls back to the same convention Runner.score_one()
169
+ # itself uses for Prediction.correct when there's no threshold
170
+ # (1.0 is correct, or 0.0 for a lower-is-better metric).
170
171
  passed = score_doc.get("passed")
171
172
  if passed is not None:
172
173
  return bool(passed)
173
- return score_doc.get("value") == 1.0
174
+ return score_doc.get("value") == correct_value(score_doc.get("direction"))
174
175
  return None
175
176
 
176
177
  def sample_diff(self, metric_name: str = "") -> list[dict]:
@@ -12,8 +12,10 @@ greys out for chat-only APIs.
12
12
 
13
13
  from __future__ import annotations
14
14
 
15
+ import functools
15
16
  import hashlib
16
17
  import importlib
18
+ import warnings
17
19
  from abc import ABC, abstractmethod
18
20
  from dataclasses import dataclass, field
19
21
  from typing import Any, Callable, Optional
@@ -443,9 +445,11 @@ def _stable_capture_repr(value: Any) -> Optional[str]:
443
445
  objects are either irrelevant runtime state a closure happens to capture (a
444
446
  call-log accumulator, an HTTP client, a logger) or carry an address-based
445
447
  repr, and folding those in would make the fingerprint change between two
446
- logically-identical runs and defeat the disk cache. Skipping can only cause a
447
- cache *miss* (when a model is identified solely by such a value), never a
448
- wrong cache *hit*.
448
+ logically-identical runs and defeat the disk cache. The cost: a change in
449
+ skipped state is invisible to the fingerprint, so two runs that differ only
450
+ there are served the same cached result (a wrong *hit*, e.g. a model object
451
+ whose weights were edited in place). :class:`CallableModel` warns when a
452
+ function depends on such state; ``evaluate(..., cache=False)`` opts out.
449
453
  """
450
454
  if value is None or isinstance(value, (str, bytes, bool, int, float, complex)):
451
455
  return repr(value)
@@ -506,6 +510,77 @@ def _default_callable_name(fn: Callable[..., Any]) -> str:
506
510
  return f"callable:{qualname}:{code_hash}"
507
511
 
508
512
 
513
+ _HIDDEN_STATE_WARNED: set[str] = set()
514
+
515
+
516
+ def _hidden_state(fn: Callable[..., Any]) -> list[str]:
517
+ """What *fn* reads that its default name (and so the run fingerprint) cannot see.
518
+
519
+ Objects a function closes over, the object a bound method belongs to, and module-level
520
+ objects its code names. Modules, functions, classes and immutable scalars are visible or
521
+ stable and are not listed. Best effort: state reached through a called function is not followed.
522
+ """
523
+ import inspect
524
+ import types
525
+
526
+ import collections.abc
527
+ import logging
528
+ import threading
529
+
530
+ # Plain containers are mostly call logs and canned replies; loggers, locks and iterators are
531
+ # plumbing. The case worth a warning is an object that computes the answer (a model, a
532
+ # pipeline, a client) and can change behind the function's back.
533
+ plumbing = (types.ModuleType, types.FunctionType, types.BuiltinFunctionType, types.MethodType,
534
+ type, functools.partial, list, dict, set, frozenset, tuple, bytearray,
535
+ collections.abc.Iterator, logging.Logger, type(threading.Lock()), type(threading.RLock()))
536
+
537
+ def opaque(value: Any) -> bool:
538
+ if _stable_capture_repr(value) is not None:
539
+ return False
540
+ return not isinstance(value, plumbing)
541
+
542
+ found: list[str] = []
543
+ owner = getattr(fn, "__self__", None)
544
+ if owner is not None and not isinstance(owner, types.ModuleType):
545
+ found.append(f"bound object {type(owner).__name__}")
546
+ target = getattr(fn, "__func__", fn)
547
+ if not inspect.isfunction(target):
548
+ return found + ([f"callable object {type(fn).__name__}"] if not found else [])
549
+ code = target.__code__
550
+ for name, cell in zip(code.co_freevars, target.__closure__ or ()):
551
+ try:
552
+ if opaque(cell.cell_contents):
553
+ found.append(f"captured {name!r}")
554
+ except ValueError: # empty cell
555
+ continue
556
+ # Globals named by the function and by code nested in it: comprehensions (a nested code
557
+ # object before Python 3.12), generator expressions and inner lambdas.
558
+ names, stack = [], [code]
559
+ while stack:
560
+ c = stack.pop()
561
+ names += [n for n in c.co_names if n not in names]
562
+ stack += [k for k in c.co_consts if isinstance(k, types.CodeType)]
563
+ g = target.__globals__
564
+ for name in names:
565
+ if name in g and opaque(g[name]):
566
+ found.append(f"global {name!r}")
567
+ return found
568
+
569
+
570
+ def _warn_hidden_state(fn: Callable[..., Any]) -> None:
571
+ hidden = _hidden_state(fn)
572
+ key = getattr(fn, "__qualname__", None) or type(fn).__qualname__
573
+ if not hidden or key in _HIDDEN_STATE_WARNED:
574
+ return
575
+ _HIDDEN_STATE_WARNED.add(key)
576
+ warnings.warn(
577
+ f"model function {key!r} reads state the run fingerprint cannot see ({', '.join(hidden[:3])}). "
578
+ f"If that state changes between runs (for example weights edited in place), evaluate() and "
579
+ f"generate() return the earlier run's cached result. Name the state with "
580
+ f"CallableModel(fn, name=...), or pass cache=False.",
581
+ UserWarning, stacklevel=4)
582
+
583
+
509
584
  class CallableModel(Model):
510
585
  """Wrap any ``list[str] -> list[str]`` function as a model.
511
586
 
@@ -518,6 +593,8 @@ class CallableModel(Model):
518
593
  def __init__(self, fn: Callable[[list[str]], list[str]], name: Optional[str] = None) -> None:
519
594
  self._fn = fn
520
595
  self.name = name if name is not None else _default_callable_name(fn)
596
+ if name is None:
597
+ _warn_hidden_state(fn)
521
598
 
522
599
  def generate(self, requests: list[Request]) -> list[Result_]:
523
600
  outputs = self._fn([_prompt_text(r.prompt) for r in requests])
@@ -537,7 +537,9 @@ class HFGenModel(Model):
537
537
  logits = model(input_ids=input_ids).logits[0] # [seq_len, vocab]
538
538
  # log_probs[j] is the model's distribution for the token at
539
539
  # position j+1, predicted from positions [0..j].
540
- log_probs = torch.log_softmax(logits[:-1], dim=-1)
540
+ # float32: a bf16/fp16 softmax over a large vocabulary rounds the
541
+ # log-probabilities by several hundredths and can flip near ties.
542
+ log_probs = torch.log_softmax(logits[:-1].float(), dim=-1)
541
543
  target_ids = torch.tensor(full_ids[1:], device=device)
542
544
  token_log_probs = log_probs.gather(1, target_ids.unsqueeze(-1)).squeeze(-1)
543
545
 
@@ -32,7 +32,7 @@ from .report import Prediction, RunResult
32
32
  from .runspec import RunConfig, RunSpec
33
33
  from .sample import Sample
34
34
  from .scenario import Scenario
35
- from .score import Direction, Score, Stat
35
+ from .score import Direction, Score, Stat, correct_value
36
36
  from .types import Capability
37
37
 
38
38
  logger = logging.getLogger(__name__)
@@ -73,6 +73,19 @@ def _run_notes(model: Any) -> dict[str, Any]:
73
73
  return {}
74
74
 
75
75
 
76
+ def _model_label(model: Any) -> str:
77
+ """The model as a plain string for ``RunResult.model_spec``: its name (``"hf:gpt2"``,
78
+ ``"precomputed"``), with the checkpoint added when the name does not carry it (``HFGenModel(model=
79
+ "gpt2")`` is named ``"hf"``). Never ``str(model)``, which is an object repr with a memory address."""
80
+ name = getattr(model, "name", None)
81
+ if not isinstance(name, str) or not name:
82
+ return type(model).__name__
83
+ checkpoint = getattr(model, "_model_name", None)
84
+ if isinstance(checkpoint, str) and checkpoint and checkpoint not in name:
85
+ return f"{name}:{checkpoint}"
86
+ return name
87
+
88
+
76
89
  def _token_count(value: Any) -> int:
77
90
  """A backend-reported token count as an int; a string ("5") is parsed and
78
91
  anything non-numeric or non-finite (NaN/Infinity) counts as 0, so neither
@@ -484,7 +497,7 @@ class Runner:
484
497
  elif primary.passed is not None:
485
498
  correct = primary.passed
486
499
  else:
487
- correct = primary.value == 1.0
500
+ correct = primary.value == correct_value(primary.direction) # a lower-is-better flag is correct at 0
488
501
 
489
502
  prediction = Prediction(
490
503
  run_id=run_id,
@@ -572,7 +585,8 @@ class Runner:
572
585
  bucket[status] += 1
573
586
  return out
574
587
 
575
- def run(self, spec: RunSpec, *, verbose: bool = False) -> RunResult:
588
+ def run(self, spec: RunSpec, *, verbose: bool = False, cache: bool = True) -> RunResult:
589
+ """Run *spec*. ``cache=False`` neither reads nor writes the disk cache."""
576
590
  fingerprint = spec.fingerprint()
577
591
  config = spec.config
578
592
 
@@ -583,8 +597,9 @@ class Runner:
583
597
  if isinstance(model_ref, str):
584
598
  inputs.append(input_ref("model", model_ref))
585
599
 
600
+ use_cache = cache
586
601
  cache = DiskCache()
587
- cached = cache.get(fingerprint)
602
+ cached = cache.get(fingerprint) if use_cache else None
588
603
  if cached is not None:
589
604
  cached.metadata = {**cached.metadata, "inputs": inputs} # lineage of THIS call
590
605
  return cached
@@ -899,7 +914,7 @@ class Runner:
899
914
  predictions=predictions,
900
915
  headline=headline,
901
916
  config=spec.config,
902
- model_spec=str(spec.model) if spec.model else None,
917
+ model_spec=_model_label(spec.model) if spec.model else None,
903
918
  errors=errors,
904
919
  unscored=unscored,
905
920
  # a sample whose metric crashed is a failed sample, not a silent skip
@@ -910,5 +925,6 @@ class Runner:
910
925
  perf=perf,
911
926
  metadata={"inputs": inputs, **notes},
912
927
  )
913
- cache.set(fingerprint, result)
928
+ if use_cache:
929
+ cache.set(fingerprint, result)
914
930
  return result
@@ -49,6 +49,13 @@ class Score:
49
49
  return self.value >= self.threshold
50
50
 
51
51
 
52
+ def correct_value(direction: Any) -> float:
53
+ """The value that counts as a correct answer for an ungated 0/1 score: ``1.0``, or ``0.0``
54
+ when lower is better (a ``harmful`` or ``error`` flag scores 1.0 on the wrong answers)."""
55
+ minimize = direction == Direction.MINIMIZE or direction == Direction.MINIMIZE.value
56
+ return 0.0 if minimize else 1.0
57
+
58
+
52
59
  def _measured_value(doc: dict[str, Any]) -> Optional[float]:
53
60
  """Value of a stored per-score dict (``Prediction.metadata["scores"]``), or ``None``
54
61
  when it is not a number or is flagged ``unknown`` (a placeholder, not a measurement;
@@ -99,6 +99,16 @@ class ScorerMetric(Metric):
99
99
  def applicable(self, sample: Sample) -> bool:
100
100
  return True
101
101
 
102
+ def identity(self) -> dict:
103
+ """Name, direction and a fingerprint of the scorer's code and captured values.
104
+
105
+ The name alone is not enough: editing the function body (or a value it closes
106
+ over) under the same name must not be served the old run's cached scores.
107
+ """
108
+ from .model import _default_callable_name
109
+ return {"name": self.name, "direction": self.direction.value,
110
+ "scorer": _default_callable_name(self._scorer.fn)}
111
+
102
112
 
103
113
  ScorerType = Union[FunctionScorer, Callable[[Sample, str], Union[float, Score]]]
104
114
 
@@ -46,6 +46,7 @@ def fake_upstream():
46
46
  real loopback HTTP instead of mocking requests.post."""
47
47
  pytest.importorskip("flask", reason="the relay tests need the [relay] extra (flask)")
48
48
  pytest.importorskip("werkzeug", reason="the relay tests need the [relay] extra (werkzeug)")
49
+ pytest.importorskip("requests", reason="the relay tests need the [relay] extra (requests)")
49
50
  from flask import Flask, jsonify
50
51
  from flask import request as flask_request
51
52
  from werkzeug.serving import make_server
@@ -0,0 +1,65 @@
1
+ """paired_bootstrap gives the exact-arithmetic p-value on discrete scores, on every Python version.
2
+
3
+ 0/1 scores make resampled means that tie the observed mean exactly. The old code compared float
4
+ means with ``>=`` after built-in ``sum()``, so float rounding decided those ties: the p-value
5
+ changed with the Python version (float ``sum()`` became compensated in 3.12) and differed from
6
+ exact arithmetic. Seen live: one 100-pair comparison gave 0.008991 on 3.11 and 0.010989 on 3.12.
7
+ """
8
+ from __future__ import annotations
9
+
10
+ import random
11
+ from fractions import Fraction
12
+
13
+ import pytest
14
+
15
+ import auditkit._bootstrap as boot
16
+
17
+
18
+ def exact_p(pairs, n_resamples=1000, seed=42):
19
+ """Reference: the same resampling draws, in exact rational arithmetic."""
20
+ n = len(pairs)
21
+ diffs = [Fraction(c) - Fraction(b) for b, c in pairs]
22
+ observed = sum(diffs) / n
23
+ centred = [d - observed for d in diffs]
24
+ rng = random.Random(seed)
25
+ count = sum(abs(sum(rng.choice(centred) for _ in range(n)) / n) >= abs(observed)
26
+ for _ in range(n_resamples))
27
+ return round((count + 1) / (n_resamples + 1), 6)
28
+
29
+
30
+ def flags(improved, worsened, n, seed):
31
+ """Paired 0/1 scores: `improved` pairs go 1 -> 0, `worsened` go 0 -> 1, the rest stay 0."""
32
+ pairs = [(1.0, 0.0)] * improved + [(0.0, 1.0)] * worsened + [(0.0, 0.0)] * (n - improved - worsened)
33
+ random.Random(seed).shuffle(pairs)
34
+ return pairs
35
+
36
+
37
+ # (improved, worsened, n, shuffle seed): cases where the old code's p depended on float summation
38
+ CASES = [(22, 7, 100, 1), (14, 7, 100, 2), (9, 2, 40, 0), (6, 1, 30, 0), (12, 4, 60, 0)]
39
+
40
+
41
+ def _naive_sum(xs, start=0.0): # float sum() before Python 3.12
42
+ for x in xs:
43
+ start += x
44
+ return start
45
+
46
+
47
+ @pytest.mark.parametrize("case", CASES)
48
+ def test_matches_exact_arithmetic(case):
49
+ pairs = flags(*case)
50
+ assert boot.paired_bootstrap(pairs)["p_value"] == exact_p(pairs)
51
+
52
+
53
+ @pytest.mark.parametrize("case", CASES)
54
+ def test_independent_of_builtin_sum(case, monkeypatch):
55
+ pairs = flags(*case)
56
+ p_default = boot.paired_bootstrap(pairs)["p_value"]
57
+ monkeypatch.setattr(boot, "sum", _naive_sum, raising=False)
58
+ assert boot.paired_bootstrap(pairs)["p_value"] == p_default
59
+
60
+
61
+ def test_continuous_scores_unchanged_in_spirit():
62
+ rng = random.Random(0)
63
+ pairs = [(rng.random(), rng.random() + 0.3) for _ in range(50)]
64
+ r = boot.paired_bootstrap(pairs)
65
+ assert r["significant"] and r["p_value"] == pytest.approx(1 / 1001)