auditkit 1.1.6__tar.gz → 1.1.8__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 (442) hide show
  1. auditkit-1.1.8/.github/CODEOWNERS +2 -0
  2. auditkit-1.1.8/.github/workflows/tests.yml +49 -0
  3. {auditkit-1.1.6 → auditkit-1.1.8}/CHANGELOG.md +27 -0
  4. {auditkit-1.1.6 → auditkit-1.1.8}/CITATION.cff +1 -1
  5. {auditkit-1.1.6 → auditkit-1.1.8}/PKG-INFO +2 -1
  6. {auditkit-1.1.6 → auditkit-1.1.8}/docs/GUIDE.md +1 -4
  7. {auditkit-1.1.6 → auditkit-1.1.8}/docs/known_issues.md +1 -2
  8. {auditkit-1.1.6 → auditkit-1.1.8}/docs/scenarios.md +2 -0
  9. {auditkit-1.1.6 → auditkit-1.1.8}/pyproject.toml +3 -2
  10. {auditkit-1.1.6 → auditkit-1.1.8}/src/auditkit/__init__.py +1 -1
  11. {auditkit-1.1.6 → auditkit-1.1.8}/src/auditkit/_bootstrap.py +10 -4
  12. {auditkit-1.1.6 → auditkit-1.1.8}/src/auditkit/api.py +11 -3
  13. {auditkit-1.1.6 → auditkit-1.1.8}/src/auditkit/diff.py +5 -4
  14. {auditkit-1.1.6 → auditkit-1.1.8}/src/auditkit/metric.py +38 -0
  15. {auditkit-1.1.6 → auditkit-1.1.8}/src/auditkit/model/__init__.py +80 -3
  16. {auditkit-1.1.6 → auditkit-1.1.8}/src/auditkit/model/hf_gen.py +3 -1
  17. {auditkit-1.1.6 → auditkit-1.1.8}/src/auditkit/redteam/__init__.py +1 -1
  18. {auditkit-1.1.6 → auditkit-1.1.8}/src/auditkit/redteam/runner.py +22 -6
  19. {auditkit-1.1.6 → auditkit-1.1.8}/src/auditkit/runner.py +22 -6
  20. {auditkit-1.1.6 → auditkit-1.1.8}/src/auditkit/scenario.py +2 -0
  21. {auditkit-1.1.6 → auditkit-1.1.8}/src/auditkit/scenarios/gsm8k.py +5 -1
  22. {auditkit-1.1.6 → auditkit-1.1.8}/src/auditkit/score.py +7 -0
  23. {auditkit-1.1.6 → auditkit-1.1.8}/src/auditkit/scorers.py +10 -0
  24. {auditkit-1.1.6 → auditkit-1.1.8}/tests/conftest.py +1 -0
  25. auditkit-1.1.8/tests/test_bootstrap_ties.py +65 -0
  26. auditkit-1.1.8/tests/test_callable_model_cache.py +126 -0
  27. auditkit-1.1.8/tests/test_function_scorer_identity.py +61 -0
  28. auditkit-1.1.8/tests/test_gsm8k_numeric.py +51 -0
  29. auditkit-1.1.8/tests/test_hf_gen_loglikelihood_float32.py +38 -0
  30. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_lexsi_relay.py +5 -1
  31. auditkit-1.1.8/tests/test_minimize_direction_correct.py +68 -0
  32. auditkit-1.1.8/tests/test_model_spec_label.py +56 -0
  33. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_redteam.py +30 -0
  34. {auditkit-1.1.6 → auditkit-1.1.8}/.gitattributes +0 -0
  35. {auditkit-1.1.6 → auditkit-1.1.8}/.github/workflows/check-release-version.yml +0 -0
  36. {auditkit-1.1.6 → auditkit-1.1.8}/.github/workflows/patch-release.yml +0 -0
  37. {auditkit-1.1.6 → auditkit-1.1.8}/.gitignore +0 -0
  38. {auditkit-1.1.6 → auditkit-1.1.8}/AGENTS.md +0 -0
  39. {auditkit-1.1.6 → auditkit-1.1.8}/LICENSE.md +0 -0
  40. {auditkit-1.1.6 → auditkit-1.1.8}/README.md +0 -0
  41. {auditkit-1.1.6 → auditkit-1.1.8}/docs/CNAME +0 -0
  42. {auditkit-1.1.6 → auditkit-1.1.8}/docs/HF_ENDPOINT.md +0 -0
  43. {auditkit-1.1.6 → auditkit-1.1.8}/docs/SGLANG.md +0 -0
  44. {auditkit-1.1.6 → auditkit-1.1.8}/docs/VLLM_KNOWN_ISSUES.md +0 -0
  45. {auditkit-1.1.6 → auditkit-1.1.8}/docs/about/glossary.md +0 -0
  46. {auditkit-1.1.6 → auditkit-1.1.8}/docs/about/platform-integration.md +0 -0
  47. {auditkit-1.1.6 → auditkit-1.1.8}/docs/agent_eval.md +0 -0
  48. {auditkit-1.1.6 → auditkit-1.1.8}/docs/agents_and_rag.md +0 -0
  49. {auditkit-1.1.6 → auditkit-1.1.8}/docs/annotators.md +0 -0
  50. {auditkit-1.1.6 → auditkit-1.1.8}/docs/api.md +0 -0
  51. {auditkit-1.1.6 → auditkit-1.1.8}/docs/architecture/data-model.md +0 -0
  52. {auditkit-1.1.6 → auditkit-1.1.8}/docs/architecture/system-design.md +0 -0
  53. {auditkit-1.1.6 → auditkit-1.1.8}/docs/assets/auditkit-logo-black.png +0 -0
  54. {auditkit-1.1.6 → auditkit-1.1.8}/docs/assets/auditkit-logo-dark.png +0 -0
  55. {auditkit-1.1.6 → auditkit-1.1.8}/docs/assets/auditkit-logo-light.png +0 -0
  56. {auditkit-1.1.6 → auditkit-1.1.8}/docs/assets/auditkit-logo-white.png +0 -0
  57. {auditkit-1.1.6 → auditkit-1.1.8}/docs/assets/extra.css +0 -0
  58. {auditkit-1.1.6 → auditkit-1.1.8}/docs/assets/extra.js +0 -0
  59. {auditkit-1.1.6 → auditkit-1.1.8}/docs/assets/favicon.png +0 -0
  60. {auditkit-1.1.6 → auditkit-1.1.8}/docs/assets/icon.png +0 -0
  61. {auditkit-1.1.6 → auditkit-1.1.8}/docs/assets/icon.svg +0 -0
  62. {auditkit-1.1.6 → auditkit-1.1.8}/docs/assets/logo.svg +0 -0
  63. {auditkit-1.1.6 → auditkit-1.1.8}/docs/best_practices/scorers.md +0 -0
  64. {auditkit-1.1.6 → auditkit-1.1.8}/docs/cli.md +0 -0
  65. {auditkit-1.1.6 → auditkit-1.1.8}/docs/community/changelog.md +0 -0
  66. {auditkit-1.1.6 → auditkit-1.1.8}/docs/community/contributing.md +0 -0
  67. {auditkit-1.1.6 → auditkit-1.1.8}/docs/community/faq.md +0 -0
  68. {auditkit-1.1.6 → auditkit-1.1.8}/docs/community/roadmap.md +0 -0
  69. {auditkit-1.1.6 → auditkit-1.1.8}/docs/configuration.md +0 -0
  70. {auditkit-1.1.6 → auditkit-1.1.8}/docs/cookbook/llm_judge.md +0 -0
  71. {auditkit-1.1.6 → auditkit-1.1.8}/docs/cookbook/rag_evaluation.md +0 -0
  72. {auditkit-1.1.6 → auditkit-1.1.8}/docs/development.md +0 -0
  73. {auditkit-1.1.6 → auditkit-1.1.8}/docs/encoder_judge.md +0 -0
  74. {auditkit-1.1.6 → auditkit-1.1.8}/docs/encoder_judge_prebuilts.md +0 -0
  75. {auditkit-1.1.6 → auditkit-1.1.8}/docs/examples/custom_scorer.md +0 -0
  76. {auditkit-1.1.6 → auditkit-1.1.8}/docs/examples/experiments.md +0 -0
  77. {auditkit-1.1.6 → auditkit-1.1.8}/docs/examples/many_datasets.md +0 -0
  78. {auditkit-1.1.6 → auditkit-1.1.8}/docs/examples/model_comparison.md +0 -0
  79. {auditkit-1.1.6 → auditkit-1.1.8}/docs/examples/quickstart.md +0 -0
  80. {auditkit-1.1.6 → auditkit-1.1.8}/docs/experiments.md +0 -0
  81. {auditkit-1.1.6 → auditkit-1.1.8}/docs/getting_started.md +0 -0
  82. {auditkit-1.1.6 → auditkit-1.1.8}/docs/guard_models.md +0 -0
  83. {auditkit-1.1.6 → auditkit-1.1.8}/docs/index.md +0 -0
  84. {auditkit-1.1.6 → auditkit-1.1.8}/docs/integrations.md +0 -0
  85. {auditkit-1.1.6 → auditkit-1.1.8}/docs/lexsi_integration.md +0 -0
  86. {auditkit-1.1.6 → auditkit-1.1.8}/docs/llm_judge_rendering.md +0 -0
  87. {auditkit-1.1.6 → auditkit-1.1.8}/docs/metrics.md +0 -0
  88. {auditkit-1.1.6 → auditkit-1.1.8}/docs/model_backends.md +0 -0
  89. {auditkit-1.1.6 → auditkit-1.1.8}/docs/rag_stress.md +0 -0
  90. {auditkit-1.1.6 → auditkit-1.1.8}/docs/reports.md +0 -0
  91. {auditkit-1.1.6 → auditkit-1.1.8}/docs/requirements.txt +0 -0
  92. {auditkit-1.1.6 → auditkit-1.1.8}/docs/scorers_reference.md +0 -0
  93. {auditkit-1.1.6 → auditkit-1.1.8}/examples/01_full_evaluation_pipeline.ipynb +0 -0
  94. {auditkit-1.1.6 → auditkit-1.1.8}/examples/02_generation_across_hf_families.ipynb +0 -0
  95. {auditkit-1.1.6 → auditkit-1.1.8}/examples/03_custom_annotators.ipynb +0 -0
  96. {auditkit-1.1.6 → auditkit-1.1.8}/examples/04_metrics_deep_dive.ipynb +0 -0
  97. {auditkit-1.1.6 → auditkit-1.1.8}/examples/05_data_types.ipynb +0 -0
  98. {auditkit-1.1.6 → auditkit-1.1.8}/examples/06_model_comparison.ipynb +0 -0
  99. {auditkit-1.1.6 → auditkit-1.1.8}/examples/07_annotators_across_models.ipynb +0 -0
  100. {auditkit-1.1.6 → auditkit-1.1.8}/examples/08_compare_result_deep_dive.ipynb +0 -0
  101. {auditkit-1.1.6 → auditkit-1.1.8}/examples/09_guard_judge_implementation_check.ipynb +0 -0
  102. {auditkit-1.1.6 → auditkit-1.1.8}/examples/10_guard_judge_legit_models.ipynb +0 -0
  103. {auditkit-1.1.6 → auditkit-1.1.8}/examples/11_encoder_judge_prebuilts.ipynb +0 -0
  104. {auditkit-1.1.6 → auditkit-1.1.8}/examples/12_performance_metrics_demo.ipynb +0 -0
  105. {auditkit-1.1.6 → auditkit-1.1.8}/examples/13_sglang_compatibility.ipynb +0 -0
  106. {auditkit-1.1.6 → auditkit-1.1.8}/examples/14_agent_and_rag_evals.ipynb +0 -0
  107. {auditkit-1.1.6 → auditkit-1.1.8}/examples/15_agentic_rag_metrics_walkthrough.ipynb +0 -0
  108. {auditkit-1.1.6 → auditkit-1.1.8}/examples/16_agentic_endpoints_live.ipynb +0 -0
  109. {auditkit-1.1.6 → auditkit-1.1.8}/examples/17_multi_route_references.ipynb +0 -0
  110. {auditkit-1.1.6 → auditkit-1.1.8}/examples/README.md +0 -0
  111. {auditkit-1.1.6 → auditkit-1.1.8}/examples/agent_eval_offline.py +0 -0
  112. {auditkit-1.1.6 → auditkit-1.1.8}/examples/applications/01_application_pruned_llama_boolq.ipynb +0 -0
  113. {auditkit-1.1.6 → auditkit-1.1.8}/examples/applications/02_application_healthcare_pubmedqa.ipynb +0 -0
  114. {auditkit-1.1.6 → auditkit-1.1.8}/examples/applications/03_application_finance_10k_qa.ipynb +0 -0
  115. {auditkit-1.1.6 → auditkit-1.1.8}/examples/applications/04_application_ecommerce_review_triage.ipynb +0 -0
  116. {auditkit-1.1.6 → auditkit-1.1.8}/examples/applications/05_application_education_arc_tutor.ipynb +0 -0
  117. {auditkit-1.1.6 → auditkit-1.1.8}/examples/applications/06_application_enterprise_search_rag.ipynb +0 -0
  118. {auditkit-1.1.6 → auditkit-1.1.8}/examples/applications/07_application_bert_nli_judge.ipynb +0 -0
  119. {auditkit-1.1.6 → auditkit-1.1.8}/examples/applications/README.md +0 -0
  120. {auditkit-1.1.6 → auditkit-1.1.8}/examples/auditkit.yaml +0 -0
  121. {auditkit-1.1.6 → auditkit-1.1.8}/examples/cohere/README.md +0 -0
  122. {auditkit-1.1.6 → auditkit-1.1.8}/examples/cohere/compare_models.ipynb +0 -0
  123. {auditkit-1.1.6 → auditkit-1.1.8}/examples/cohere/metrics_generation.ipynb +0 -0
  124. {auditkit-1.1.6 → auditkit-1.1.8}/examples/cohere/run_lmeval.ipynb +0 -0
  125. {auditkit-1.1.6 → auditkit-1.1.8}/examples/cohere/sglang_auditkit.ipynb +0 -0
  126. {auditkit-1.1.6 → auditkit-1.1.8}/examples/cohere/tgi_endpoint.ipynb +0 -0
  127. {auditkit-1.1.6 → auditkit-1.1.8}/examples/colab/01_cohere_and_hf_api_models.ipynb +0 -0
  128. {auditkit-1.1.6 → auditkit-1.1.8}/examples/colab/02_agentic_rag_real_agent.ipynb +0 -0
  129. {auditkit-1.1.6 → auditkit-1.1.8}/examples/colab/03_vllm_integration.ipynb +0 -0
  130. {auditkit-1.1.6 → auditkit-1.1.8}/examples/colab/04_cohere_hf_fixes_live.ipynb +0 -0
  131. {auditkit-1.1.6 → auditkit-1.1.8}/examples/colab/05_real_world_agentic_rag.ipynb +0 -0
  132. {auditkit-1.1.6 → auditkit-1.1.8}/examples/colab/06_cohere_all_backends.ipynb +0 -0
  133. {auditkit-1.1.6 → auditkit-1.1.8}/examples/colab/README.md +0 -0
  134. {auditkit-1.1.6 → auditkit-1.1.8}/examples/model_comparison_notebook.py +0 -0
  135. {auditkit-1.1.6 → auditkit-1.1.8}/examples/stress_tests/README.md +0 -0
  136. {auditkit-1.1.6 → auditkit-1.1.8}/examples/stress_tests/test_stress_gated_model.py +0 -0
  137. {auditkit-1.1.6 → auditkit-1.1.8}/examples/stress_tests/test_stress_open_model_load.py +0 -0
  138. {auditkit-1.1.6 → auditkit-1.1.8}/mkdocs.yml +0 -0
  139. {auditkit-1.1.6 → auditkit-1.1.8}/scripts/__init__.py +0 -0
  140. {auditkit-1.1.6 → auditkit-1.1.8}/scripts/release.py +0 -0
  141. {auditkit-1.1.6 → auditkit-1.1.8}/src/auditkit/README.md +0 -0
  142. {auditkit-1.1.6 → auditkit-1.1.8}/src/auditkit/__main__.py +0 -0
  143. {auditkit-1.1.6 → auditkit-1.1.8}/src/auditkit/_identity_guard.py +0 -0
  144. {auditkit-1.1.6 → auditkit-1.1.8}/src/auditkit/_text.py +0 -0
  145. {auditkit-1.1.6 → auditkit-1.1.8}/src/auditkit/adapter.py +0 -0
  146. {auditkit-1.1.6 → auditkit-1.1.8}/src/auditkit/agent_eval/README.md +0 -0
  147. {auditkit-1.1.6 → auditkit-1.1.8}/src/auditkit/agent_eval/__init__.py +0 -0
  148. {auditkit-1.1.6 → auditkit-1.1.8}/src/auditkit/agent_eval/importers.py +0 -0
  149. {auditkit-1.1.6 → auditkit-1.1.8}/src/auditkit/agent_eval/lexsi.py +0 -0
  150. {auditkit-1.1.6 → auditkit-1.1.8}/src/auditkit/agent_eval/outcome.py +0 -0
  151. {auditkit-1.1.6 → auditkit-1.1.8}/src/auditkit/agent_eval/reliability.py +0 -0
  152. {auditkit-1.1.6 → auditkit-1.1.8}/src/auditkit/agent_eval/report.py +0 -0
  153. {auditkit-1.1.6 → auditkit-1.1.8}/src/auditkit/agent_eval/runner.py +0 -0
  154. {auditkit-1.1.6 → auditkit-1.1.8}/src/auditkit/agent_eval/sidecar.py +0 -0
  155. {auditkit-1.1.6 → auditkit-1.1.8}/src/auditkit/agent_eval/types.py +0 -0
  156. {auditkit-1.1.6 → auditkit-1.1.8}/src/auditkit/annotator.py +0 -0
  157. {auditkit-1.1.6 → auditkit-1.1.8}/src/auditkit/assets/auditkit_logo.png +0 -0
  158. {auditkit-1.1.6 → auditkit-1.1.8}/src/auditkit/bfcl.py +0 -0
  159. {auditkit-1.1.6 → auditkit-1.1.8}/src/auditkit/cache.py +0 -0
  160. {auditkit-1.1.6 → auditkit-1.1.8}/src/auditkit/cli.py +0 -0
  161. {auditkit-1.1.6 → auditkit-1.1.8}/src/auditkit/comparison.py +0 -0
  162. {auditkit-1.1.6 → auditkit-1.1.8}/src/auditkit/compat.py +0 -0
  163. {auditkit-1.1.6 → auditkit-1.1.8}/src/auditkit/errors.py +0 -0
  164. {auditkit-1.1.6 → auditkit-1.1.8}/src/auditkit/evaluator.py +0 -0
  165. {auditkit-1.1.6 → auditkit-1.1.8}/src/auditkit/experiment.py +0 -0
  166. {auditkit-1.1.6 → auditkit-1.1.8}/src/auditkit/hf_publish.py +0 -0
  167. {auditkit-1.1.6 → auditkit-1.1.8}/src/auditkit/lexsi_login.py +0 -0
  168. {auditkit-1.1.6 → auditkit-1.1.8}/src/auditkit/lexsi_relay.py +0 -0
  169. {auditkit-1.1.6 → auditkit-1.1.8}/src/auditkit/lmeval_engine.py +0 -0
  170. {auditkit-1.1.6 → auditkit-1.1.8}/src/auditkit/loaders.py +0 -0
  171. {auditkit-1.1.6 → auditkit-1.1.8}/src/auditkit/logs.py +0 -0
  172. {auditkit-1.1.6 → auditkit-1.1.8}/src/auditkit/metrics/README.md +0 -0
  173. {auditkit-1.1.6 → auditkit-1.1.8}/src/auditkit/metrics/__init__.py +0 -0
  174. {auditkit-1.1.6 → auditkit-1.1.8}/src/auditkit/metrics/agent.py +0 -0
  175. {auditkit-1.1.6 → auditkit-1.1.8}/src/auditkit/metrics/code.py +0 -0
  176. {auditkit-1.1.6 → auditkit-1.1.8}/src/auditkit/metrics/embedding.py +0 -0
  177. {auditkit-1.1.6 → auditkit-1.1.8}/src/auditkit/metrics/encoder_judge.py +0 -0
  178. {auditkit-1.1.6 → auditkit-1.1.8}/src/auditkit/metrics/generation.py +0 -0
  179. {auditkit-1.1.6 → auditkit-1.1.8}/src/auditkit/metrics/guard.py +0 -0
  180. {auditkit-1.1.6 → auditkit-1.1.8}/src/auditkit/metrics/hallucination.py +0 -0
  181. {auditkit-1.1.6 → auditkit-1.1.8}/src/auditkit/metrics/judge.py +0 -0
  182. {auditkit-1.1.6 → auditkit-1.1.8}/src/auditkit/metrics/pairwise.py +0 -0
  183. {auditkit-1.1.6 → auditkit-1.1.8}/src/auditkit/metrics/perf.py +0 -0
  184. {auditkit-1.1.6 → auditkit-1.1.8}/src/auditkit/metrics/rag.py +0 -0
  185. {auditkit-1.1.6 → auditkit-1.1.8}/src/auditkit/metrics/rag_judge.py +0 -0
  186. {auditkit-1.1.6 → auditkit-1.1.8}/src/auditkit/metrics/rag_stress.py +0 -0
  187. {auditkit-1.1.6 → auditkit-1.1.8}/src/auditkit/metrics/rag_stress_ops.py +0 -0
  188. {auditkit-1.1.6 → auditkit-1.1.8}/src/auditkit/metrics/rag_stress_runner.py +0 -0
  189. {auditkit-1.1.6 → auditkit-1.1.8}/src/auditkit/metrics/retrieval.py +0 -0
  190. {auditkit-1.1.6 → auditkit-1.1.8}/src/auditkit/metrics/security.py +0 -0
  191. {auditkit-1.1.6 → auditkit-1.1.8}/src/auditkit/metrics/structured.py +0 -0
  192. {auditkit-1.1.6 → auditkit-1.1.8}/src/auditkit/metrics/toxicity.py +0 -0
  193. {auditkit-1.1.6 → auditkit-1.1.8}/src/auditkit/model/README.md +0 -0
  194. {auditkit-1.1.6 → auditkit-1.1.8}/src/auditkit/model/agent_endpoint.py +0 -0
  195. {auditkit-1.1.6 → auditkit-1.1.8}/src/auditkit/model/anthropic.py +0 -0
  196. {auditkit-1.1.6 → auditkit-1.1.8}/src/auditkit/model/api_gen.py +0 -0
  197. {auditkit-1.1.6 → auditkit-1.1.8}/src/auditkit/model/groq_gen.py +0 -0
  198. {auditkit-1.1.6 → auditkit-1.1.8}/src/auditkit/model/lexsi.py +0 -0
  199. {auditkit-1.1.6 → auditkit-1.1.8}/src/auditkit/model/litellm_gen.py +0 -0
  200. {auditkit-1.1.6 → auditkit-1.1.8}/src/auditkit/model/openai.py +0 -0
  201. {auditkit-1.1.6 → auditkit-1.1.8}/src/auditkit/model/openrouter_gen.py +0 -0
  202. {auditkit-1.1.6 → auditkit-1.1.8}/src/auditkit/model/vllm_gen.py +0 -0
  203. {auditkit-1.1.6 → auditkit-1.1.8}/src/auditkit/model_compare.py +0 -0
  204. {auditkit-1.1.6 → auditkit-1.1.8}/src/auditkit/provenance.py +0 -0
  205. {auditkit-1.1.6 → auditkit-1.1.8}/src/auditkit/redteam/README.md +0 -0
  206. {auditkit-1.1.6 → auditkit-1.1.8}/src/auditkit/redteam/detector.py +0 -0
  207. {auditkit-1.1.6 → auditkit-1.1.8}/src/auditkit/redteam/detectors/README.md +0 -0
  208. {auditkit-1.1.6 → auditkit-1.1.8}/src/auditkit/redteam/detectors/builtin.py +0 -0
  209. {auditkit-1.1.6 → auditkit-1.1.8}/src/auditkit/redteam/probe.py +0 -0
  210. {auditkit-1.1.6 → auditkit-1.1.8}/src/auditkit/redteam/probes/README.md +0 -0
  211. {auditkit-1.1.6 → auditkit-1.1.8}/src/auditkit/redteam/probes/builtin.py +0 -0
  212. {auditkit-1.1.6 → auditkit-1.1.8}/src/auditkit/registry.py +0 -0
  213. {auditkit-1.1.6 → auditkit-1.1.8}/src/auditkit/report.py +0 -0
  214. {auditkit-1.1.6 → auditkit-1.1.8}/src/auditkit/report_format.py +0 -0
  215. {auditkit-1.1.6 → auditkit-1.1.8}/src/auditkit/router.py +0 -0
  216. {auditkit-1.1.6 → auditkit-1.1.8}/src/auditkit/runspec.py +0 -0
  217. {auditkit-1.1.6 → auditkit-1.1.8}/src/auditkit/sample.py +0 -0
  218. {auditkit-1.1.6 → auditkit-1.1.8}/src/auditkit/scenarios/README.md +0 -0
  219. {auditkit-1.1.6 → auditkit-1.1.8}/src/auditkit/scenarios/__init__.py +0 -0
  220. {auditkit-1.1.6 → auditkit-1.1.8}/src/auditkit/scenarios/arc.py +0 -0
  221. {auditkit-1.1.6 → auditkit-1.1.8}/src/auditkit/scenarios/hellaswag.py +0 -0
  222. {auditkit-1.1.6 → auditkit-1.1.8}/src/auditkit/scenarios/humaneval.py +0 -0
  223. {auditkit-1.1.6 → auditkit-1.1.8}/src/auditkit/scenarios/mmlu.py +0 -0
  224. {auditkit-1.1.6 → auditkit-1.1.8}/src/auditkit/scenarios/truthfulqa.py +0 -0
  225. {auditkit-1.1.6 → auditkit-1.1.8}/src/auditkit/scoring.py +0 -0
  226. {auditkit-1.1.6 → auditkit-1.1.8}/src/auditkit/trace.py +0 -0
  227. {auditkit-1.1.6 → auditkit-1.1.8}/src/auditkit/types.py +0 -0
  228. {auditkit-1.1.6 → auditkit-1.1.8}/tests/README.md +0 -0
  229. {auditkit-1.1.6 → auditkit-1.1.8}/tests/__init__.py +0 -0
  230. {auditkit-1.1.6 → auditkit-1.1.8}/tests/agentic_suite/.gitignore +0 -0
  231. {auditkit-1.1.6 → auditkit-1.1.8}/tests/agentic_suite/FINDINGS.md +0 -0
  232. {auditkit-1.1.6 → auditkit-1.1.8}/tests/agentic_suite/README.md +0 -0
  233. {auditkit-1.1.6 → auditkit-1.1.8}/tests/agentic_suite/__init__.py +0 -0
  234. {auditkit-1.1.6 → auditkit-1.1.8}/tests/agentic_suite/catalog.py +0 -0
  235. {auditkit-1.1.6 → auditkit-1.1.8}/tests/agentic_suite/colab_model_matrix.ipynb +0 -0
  236. {auditkit-1.1.6 → auditkit-1.1.8}/tests/agentic_suite/colab_offline_suite.ipynb +0 -0
  237. {auditkit-1.1.6 → auditkit-1.1.8}/tests/agentic_suite/conftest.py +0 -0
  238. {auditkit-1.1.6 → auditkit-1.1.8}/tests/agentic_suite/make_metric_reports.py +0 -0
  239. {auditkit-1.1.6 → auditkit-1.1.8}/tests/agentic_suite/test_agentic_pipeline_all_metrics.py +0 -0
  240. {auditkit-1.1.6 → auditkit-1.1.8}/tests/agentic_suite/test_fingerprint_offline.py +0 -0
  241. {auditkit-1.1.6 → auditkit-1.1.8}/tests/agentic_suite/test_formats_offline.py +0 -0
  242. {auditkit-1.1.6 → auditkit-1.1.8}/tests/agentic_suite/test_live.py +0 -0
  243. {auditkit-1.1.6 → auditkit-1.1.8}/tests/agentic_suite/test_live_rag.py +0 -0
  244. {auditkit-1.1.6 → auditkit-1.1.8}/tests/agentic_suite/test_metrics_offline.py +0 -0
  245. {auditkit-1.1.6 → auditkit-1.1.8}/tests/agentic_suite/test_pipeline_offline.py +0 -0
  246. {auditkit-1.1.6 → auditkit-1.1.8}/tests/agentic_suite/test_rag_offline.py +0 -0
  247. {auditkit-1.1.6 → auditkit-1.1.8}/tests/agentic_suite/test_resolved_issues.py +0 -0
  248. {auditkit-1.1.6 → auditkit-1.1.8}/tests/fixtures/chat_templates/aya_expanse.jinja +0 -0
  249. {auditkit-1.1.6 → auditkit-1.1.8}/tests/fixtures/chat_templates/command_r7b_tool_use.jinja +0 -0
  250. {auditkit-1.1.6 → auditkit-1.1.8}/tests/fixtures/chat_templates/tiny_aya_default.jinja +0 -0
  251. {auditkit-1.1.6 → auditkit-1.1.8}/tests/fixtures/lexsi_real/agenttune/dataset_train_grpo.jsonl +0 -0
  252. {auditkit-1.1.6 → auditkit-1.1.8}/tests/fixtures/lexsi_real/agenttune/report_constructed.json +0 -0
  253. {auditkit-1.1.6 → auditkit-1.1.8}/tests/fixtures/lexsi_real/agenttune/trace_finder.jsonl +0 -0
  254. {auditkit-1.1.6 → auditkit-1.1.8}/tests/fixtures/lexsi_real/agenttune/trace_hotpotqa.jsonl +0 -0
  255. {auditkit-1.1.6 → auditkit-1.1.8}/tests/fixtures/lexsi_real/agenttune/trajectory_store_export.jsonl +0 -0
  256. {auditkit-1.1.6 → auditkit-1.1.8}/tests/fixtures/lexsi_real/aligntune/AuditReport.json +0 -0
  257. {auditkit-1.1.6 → auditkit-1.1.8}/tests/fixtures/lexsi_real/aligntune/RegressionReport.json +0 -0
  258. {auditkit-1.1.6 → auditkit-1.1.8}/tests/fixtures/lexsi_real/circuitkit/faithfulness_report.json +0 -0
  259. {auditkit-1.1.6 → auditkit-1.1.8}/tests/fixtures/lexsi_real/circuitkit/faithfulness_report_default.json +0 -0
  260. {auditkit-1.1.6 → auditkit-1.1.8}/tests/fixtures/lexsi_real/circuitkit/faithfulness_report_ib_fastpath.json +0 -0
  261. {auditkit-1.1.6 → auditkit-1.1.8}/tests/fixtures/lexsi_real/circuitkit/faithfulness_report_nonfinite.json +0 -0
  262. {auditkit-1.1.6 → auditkit-1.1.8}/tests/fixtures/lexsi_real/circuitkit/faithfulness_report_unknown_sentinels.json +0 -0
  263. {auditkit-1.1.6 → auditkit-1.1.8}/tests/fixtures/lexsi_real/curatorkit/checkpoint_TextCleaner.jsonl +0 -0
  264. {auditkit-1.1.6 → auditkit-1.1.8}/tests/fixtures/lexsi_real/curatorkit/data_sample.json +0 -0
  265. {auditkit-1.1.6 → auditkit-1.1.8}/tests/fixtures/lexsi_real/curatorkit/data_sample_pdf.json +0 -0
  266. {auditkit-1.1.6 → auditkit-1.1.8}/tests/fixtures/lexsi_real/curatorkit/manifest.json +0 -0
  267. {auditkit-1.1.6 → auditkit-1.1.8}/tests/fixtures/lexsi_real/curatorkit/manifest_pdf.json +0 -0
  268. {auditkit-1.1.6 → auditkit-1.1.8}/tests/fixtures/lexsi_real/curatorkit/rejected.jsonl +0 -0
  269. {auditkit-1.1.6 → auditkit-1.1.8}/tests/fixtures/lexsi_real/curatorkit/rejected_pdf.jsonl +0 -0
  270. {auditkit-1.1.6 → auditkit-1.1.8}/tests/fixtures/lexsi_real/curatorkit/sft_alpaca.jsonl +0 -0
  271. {auditkit-1.1.6 → auditkit-1.1.8}/tests/fixtures/lexsi_real/curatorkit/sft_sharegpt.jsonl +0 -0
  272. {auditkit-1.1.6 → auditkit-1.1.8}/tests/fixtures/lexsi_real/safetune/placeholder-model__base__placeholder_bench.jsonl +0 -0
  273. {auditkit-1.1.6 → auditkit-1.1.8}/tests/fixtures/lexsi_real/safetune/placeholder-model__base__placeholder_bench_scored.jsonl +0 -0
  274. {auditkit-1.1.6 → auditkit-1.1.8}/tests/fixtures/lexsi_real/safetune/safety_audit_event__post_allow_long_redacted.json +0 -0
  275. {auditkit-1.1.6 → auditkit-1.1.8}/tests/fixtures/lexsi_real/safetune/safety_audit_event__post_keyword_classifier_block.json +0 -0
  276. {auditkit-1.1.6 → auditkit-1.1.8}/tests/fixtures/lexsi_real/safetune/safety_audit_event__pre_allow.json +0 -0
  277. {auditkit-1.1.6 → auditkit-1.1.8}/tests/fixtures/lexsi_real/safetune/safety_audit_event__pre_tool_block.json +0 -0
  278. {auditkit-1.1.6 → auditkit-1.1.8}/tests/fixtures/sglang_0520/commandr_excerpt.py +0 -0
  279. {auditkit-1.1.6 → auditkit-1.1.8}/tests/fixtures/sglang_0520/transformers_backend_excerpt.py +0 -0
  280. {auditkit-1.1.6 → auditkit-1.1.8}/tests/fixtures/sglang_0520/unified_radix_cache_excerpt.py +0 -0
  281. {auditkit-1.1.6 → auditkit-1.1.8}/tests/integrations_suite/README.md +0 -0
  282. {auditkit-1.1.6 → auditkit-1.1.8}/tests/integrations_suite/__init__.py +0 -0
  283. {auditkit-1.1.6 → auditkit-1.1.8}/tests/integrations_suite/colab_cohere_models.ipynb +0 -0
  284. {auditkit-1.1.6 → auditkit-1.1.8}/tests/integrations_suite/colab_integrations.ipynb +0 -0
  285. {auditkit-1.1.6 → auditkit-1.1.8}/tests/integrations_suite/colab_sglang.ipynb +0 -0
  286. {auditkit-1.1.6 → auditkit-1.1.8}/tests/integrations_suite/colab_sglang_32b_north.ipynb +0 -0
  287. {auditkit-1.1.6 → auditkit-1.1.8}/tests/integrations_suite/colab_sglang_cohere_matrix.ipynb +0 -0
  288. {auditkit-1.1.6 → auditkit-1.1.8}/tests/integrations_suite/colab_vllm_32b.ipynb +0 -0
  289. {auditkit-1.1.6 → auditkit-1.1.8}/tests/integrations_suite/colab_vllm_cohere_matrix.ipynb +0 -0
  290. {auditkit-1.1.6 → auditkit-1.1.8}/tests/integrations_suite/conftest.py +0 -0
  291. {auditkit-1.1.6 → auditkit-1.1.8}/tests/integrations_suite/test_agenttune.py +0 -0
  292. {auditkit-1.1.6 → auditkit-1.1.8}/tests/integrations_suite/test_cohere.py +0 -0
  293. {auditkit-1.1.6 → auditkit-1.1.8}/tests/integrations_suite/test_hf.py +0 -0
  294. {auditkit-1.1.6 → auditkit-1.1.8}/tests/integrations_suite/test_live.py +0 -0
  295. {auditkit-1.1.6 → auditkit-1.1.8}/tests/integrations_suite/test_sglang.py +0 -0
  296. {auditkit-1.1.6 → auditkit-1.1.8}/tests/issues_suite/README.md +0 -0
  297. {auditkit-1.1.6 → auditkit-1.1.8}/tests/issues_suite/__init__.py +0 -0
  298. {auditkit-1.1.6 → auditkit-1.1.8}/tests/issues_suite/conftest.py +0 -0
  299. {auditkit-1.1.6 → auditkit-1.1.8}/tests/issues_suite/serve_model.py +0 -0
  300. {auditkit-1.1.6 → auditkit-1.1.8}/tests/issues_suite/test_issue43_specs.py +0 -0
  301. {auditkit-1.1.6 → auditkit-1.1.8}/tests/issues_suite/test_issue44_user_flows.py +0 -0
  302. {auditkit-1.1.6 → auditkit-1.1.8}/tests/issues_suite/test_issue45_bfcl.py +0 -0
  303. {auditkit-1.1.6 → auditkit-1.1.8}/tests/issues_suite/test_issue45_routes.py +0 -0
  304. {auditkit-1.1.6 → auditkit-1.1.8}/tests/issues_suite/test_live.py +0 -0
  305. {auditkit-1.1.6 → auditkit-1.1.8}/tests/issues_suite/test_vllm_cohere_templates.py +0 -0
  306. {auditkit-1.1.6 → auditkit-1.1.8}/tests/nonmetric_suite/README.md +0 -0
  307. {auditkit-1.1.6 → auditkit-1.1.8}/tests/nonmetric_suite/__init__.py +0 -0
  308. {auditkit-1.1.6 → auditkit-1.1.8}/tests/nonmetric_suite/conftest.py +0 -0
  309. {auditkit-1.1.6 → auditkit-1.1.8}/tests/nonmetric_suite/test_agent_eval_and_loaders.py +0 -0
  310. {auditkit-1.1.6 → auditkit-1.1.8}/tests/nonmetric_suite/test_mrm_evidence.py +0 -0
  311. {auditkit-1.1.6 → auditkit-1.1.8}/tests/nonmetric_suite/test_redteam_machinery.py +0 -0
  312. {auditkit-1.1.6 → auditkit-1.1.8}/tests/pipeline_suite/README.md +0 -0
  313. {auditkit-1.1.6 → auditkit-1.1.8}/tests/pipeline_suite/__init__.py +0 -0
  314. {auditkit-1.1.6 → auditkit-1.1.8}/tests/pipeline_suite/conftest.py +0 -0
  315. {auditkit-1.1.6 → auditkit-1.1.8}/tests/pipeline_suite/test_edge_agent_and_rag_judges.py +0 -0
  316. {auditkit-1.1.6 → auditkit-1.1.8}/tests/pipeline_suite/test_edge_mrm.py +0 -0
  317. {auditkit-1.1.6 → auditkit-1.1.8}/tests/pipeline_suite/test_edge_rag_stress.py +0 -0
  318. {auditkit-1.1.6 → auditkit-1.1.8}/tests/pipeline_suite/test_edge_redteam_judges.py +0 -0
  319. {auditkit-1.1.6 → auditkit-1.1.8}/tests/pipeline_suite/test_edge_uncertainty.py +0 -0
  320. {auditkit-1.1.6 → auditkit-1.1.8}/tests/pipeline_suite/test_pr1_additions.py +0 -0
  321. {auditkit-1.1.6 → auditkit-1.1.8}/tests/pipeline_suite/test_pr2_redteam.py +0 -0
  322. {auditkit-1.1.6 → auditkit-1.1.8}/tests/pipeline_suite/test_pr3_mrm.py +0 -0
  323. {auditkit-1.1.6 → auditkit-1.1.8}/tests/pipeline_suite/test_pr4_uncertainty.py +0 -0
  324. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_adapter.py +0 -0
  325. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_adapter_params.py +0 -0
  326. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_agent_endpoint.py +0 -0
  327. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_agent_eval_cli.py +0 -0
  328. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_agent_eval_disagreement.py +0 -0
  329. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_agent_eval_eventlog.py +0 -0
  330. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_agent_eval_harness.py +0 -0
  331. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_agent_eval_importers.py +0 -0
  332. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_agent_eval_outcome.py +0 -0
  333. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_agent_eval_reliability.py +0 -0
  334. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_agent_eval_runner.py +0 -0
  335. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_agent_eval_secrets.py +0 -0
  336. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_agent_eval_sidecar.py +0 -0
  337. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_agent_eval_types.py +0 -0
  338. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_agent_metrics.py +0 -0
  339. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_agent_reference_free.py +0 -0
  340. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_agenttune_fix_plan.py +0 -0
  341. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_agenttune_integration.py +0 -0
  342. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_annotator.py +0 -0
  343. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_api.py +0 -0
  344. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_api_backend.py +0 -0
  345. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_api_images.py +0 -0
  346. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_api_tool_calls.py +0 -0
  347. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_api_unverified_fields.py +0 -0
  348. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_apostrophe_fold.py +0 -0
  349. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_benchmark.py +0 -0
  350. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_chat_messages.py +0 -0
  351. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_chat_template_kwargs_everywhere.py +0 -0
  352. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_cli.py +0 -0
  353. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_cli_yaml_model.py +0 -0
  354. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_code_metrics.py +0 -0
  355. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_cohere_aya.py +0 -0
  356. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_cohere_hf_fix_plan.py +0 -0
  357. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_cohere_tool_calls.py +0 -0
  358. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_compare.py +0 -0
  359. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_comparison.py +0 -0
  360. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_compat.py +0 -0
  361. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_core_engine.py +0 -0
  362. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_custom_judge_pipeline.py +0 -0
  363. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_diff.py +0 -0
  364. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_embedding_metrics.py +0 -0
  365. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_encoder_judge.py +0 -0
  366. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_env_compat_fix_plan.py +0 -0
  367. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_errors.py +0 -0
  368. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_evaluate_many.py +0 -0
  369. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_eventlog_action_shapes.py +0 -0
  370. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_execute_concurrency.py +0 -0
  371. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_experiment.py +0 -0
  372. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_failed_as_zero.py +0 -0
  373. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_fingerprint_stability.py +0 -0
  374. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_generation_kwargs.py +0 -0
  375. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_generation_metrics.py +0 -0
  376. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_guard.py +0 -0
  377. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_hallucination_metrics.py +0 -0
  378. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_hf_device_map.py +0 -0
  379. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_hf_dtype_fallback.py +0 -0
  380. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_hf_gen_import_error.py +0 -0
  381. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_hf_gen_logits_sanitizer.py +0 -0
  382. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_hf_interop.py +0 -0
  383. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_hf_wire_format.py +0 -0
  384. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_integration.py +0 -0
  385. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_judge.py +0 -0
  386. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_judge_flow.py +0 -0
  387. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_judge_indic_choices.py +0 -0
  388. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_judge_number_parse.py +0 -0
  389. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_judge_option_labels.py +0 -0
  390. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_lexsi_compat.py +0 -0
  391. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_llm_judge.py +0 -0
  392. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_lmeval_engine.py +0 -0
  393. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_lmeval_real_pipeline.py +0 -0
  394. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_load_dataset.py +0 -0
  395. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_loaders.py +0 -0
  396. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_loaders_agent.py +0 -0
  397. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_mcq_gen_params.py +0 -0
  398. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_metric.py +0 -0
  399. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_metric_properties.py +0 -0
  400. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_metrics_via_pipeline.py +0 -0
  401. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_missing_is_not_zero.py +0 -0
  402. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_model.py +0 -0
  403. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_model_backends.py +0 -0
  404. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_multipath_references.py +0 -0
  405. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_paired_bootstrap.py +0 -0
  406. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_pairwise_metrics.py +0 -0
  407. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_pipeline_live_hf.py +0 -0
  408. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_practical.py +0 -0
  409. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_provenance.py +0 -0
  410. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_rag_judge.py +0 -0
  411. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_rag_metrics.py +0 -0
  412. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_rag_reference_free.py +0 -0
  413. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_rag_stress.py +0 -0
  414. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_rag_stress_ops.py +0 -0
  415. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_rag_stress_runner.py +0 -0
  416. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_reference_fingerprint.py +0 -0
  417. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_registry.py +0 -0
  418. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_release.py +0 -0
  419. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_retrieval_metrics.py +0 -0
  420. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_review27_followups.py +0 -0
  421. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_route_distribution.py +0 -0
  422. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_router.py +0 -0
  423. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_runner.py +0 -0
  424. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_sample.py +0 -0
  425. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_scenario_dataset_ids.py +0 -0
  426. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_scenarios.py +0 -0
  427. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_score.py +0 -0
  428. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_scorer_context_typeerror.py +0 -0
  429. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_scorer_order_cache.py +0 -0
  430. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_security_perf.py +0 -0
  431. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_structured_metrics.py +0 -0
  432. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_summary_failed_samples.py +0 -0
  433. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_template_kwargs_f1_fix_plan.py +0 -0
  434. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_token_usage_and_cost.py +0 -0
  435. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_toxicity_metrics.py +0 -0
  436. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_trace.py +0 -0
  437. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_track3_agenttune.py +0 -0
  438. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_types.py +0 -0
  439. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_unknown_architecture_message.py +0 -0
  440. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_unmeasured_not_zero.py +0 -0
  441. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_unscored_results.py +0 -0
  442. {auditkit-1.1.6 → auditkit-1.1.8}/tests/test_vllm_offline_engine.py +0 -0
@@ -0,0 +1,2 @@
1
+ # Every change is reviewed by the team lead. Add a line per folder to share that.
2
+ * @aryapratinavseth
@@ -0,0 +1,49 @@
1
+ name: Tests
2
+
3
+ on:
4
+ pull_request:
5
+ branches: [main]
6
+ push:
7
+ branches: [main]
8
+
9
+ concurrency:
10
+ group: tests-${{ github.ref }}
11
+ cancel-in-progress: true
12
+
13
+ permissions:
14
+ contents: read
15
+
16
+ jobs:
17
+ pytest:
18
+ name: pytest (Python ${{ matrix.python }})
19
+ runs-on: ubuntu-latest
20
+ timeout-minutes: 30
21
+ strategy:
22
+ fail-fast: false
23
+ matrix:
24
+ python: ["3.10", "3.12"]
25
+ steps:
26
+ - uses: actions/checkout@v4
27
+
28
+ - uses: actions/setup-python@v5
29
+ with:
30
+ python-version: ${{ matrix.python }}
31
+ cache: pip
32
+ cache-dependency-path: pyproject.toml
33
+
34
+ # Some tests load small Hugging Face models; cache them so shared runner IPs hit the rate limit less.
35
+ - uses: actions/cache@v4
36
+ with:
37
+ path: ~/.cache/huggingface
38
+ key: hf-hub-auditkit-v1
39
+
40
+ # The CPU torch wheel keeps the install small; the transformers extra is what the metric and backend tests need.
41
+ - name: Install
42
+ run: |
43
+ python -m pip install --upgrade pip
44
+ python -m pip install --extra-index-url https://download.pytorch.org/whl/cpu -e ".[dev,transformers]" pytest-rerunfailures
45
+
46
+ - name: Run tests
47
+ env:
48
+ HF_TOKEN: ${{ secrets.HF_TOKEN }}
49
+ run: python -m pytest --reruns 2 --reruns-delay 10 --only-rerun "OSError" --only-rerun "ConnectionError"
@@ -110,6 +110,33 @@ All notable changes to AuditKIT. The format follows [Keep a Changelog](https://k
110
110
 
111
111
  ### Fixed
112
112
 
113
+ - The built-in `gsm8k` scenario scored almost every answer 0: its target was the whole worked
114
+ solution and the default scorer was exact match, so "The answer is 72." scored 0. The target is now
115
+ the final number (the worked solution stays in `Sample.metadata["solution"]`), and `gsm8k` scores with
116
+ the new `numeric_match` metric (the number after `####`, else the last number in the reply; commas and
117
+ `$` ignored; `metadata["no_number"]` marks replies with no number). Scenarios can now name their own
118
+ default scorers (`Scenario.default_scorers`). **gsm8k results change**: earlier native gsm8k scores
119
+ are not comparable.
120
+ - **Results change for multi-probe red-team runs.** When no detectors are given, each probe is checked only with
121
+ its own default detectors. The runner used to gather the defaults of every probe and apply all of them to every
122
+ probe, so a model that correctly refused a jailbreak prompt was failed by `RefusalDetector` when the `refusal`
123
+ probe also ran (39 checks, 13 failed, against 21 checks and none failed for the two probes run alone). Detectors
124
+ passed explicitly still apply to every probe. `detectors_used` keeps a stable order; it came from a `set`.
125
+ - `RedTeamRunner.run` raises a `ValueError` when a probe has no prompts, naming the probe and the built-in probe
126
+ names. A bare `Probe("name")` sent nothing to the model and the summary still reported a 100% pass rate. The
127
+ example in the `auditkit.redteam` docstring used such a probe and now uses built-in ones.
128
+ - `evaluate()` and `generate()` take `cache=False` (native engine), which runs without the disk cache.
129
+ `CallableModel` warns when a function model reads state the run fingerprint cannot see, such as a model
130
+ object whose weights are edited in place, because such a model is otherwise served an earlier run's result.
131
+ - `RunResult.model_spec` is the model's name, not an object repr.
132
+ - `Prediction.correct` honours a lower-is-better metric's direction. For an ungated 0/1 score it was
133
+ `value == 1.0` whatever the direction, so every harmful answer on a `harmful` or `error` flag counted
134
+ as correct and `RunComparison.regressed()`, `improved()` and `RunDiff` returned each other's samples.
135
+ - A `FunctionScorer`'s identity covers its code and the values it closes over, not only its name. Editing
136
+ the function body under the same name no longer returns the previous run's cached scores.
137
+ - `paired_bootstrap` no longer lets float rounding decide ties between resampled and observed means on
138
+ discrete scores, and sums with `math.fsum`, so the p-value is the same on every Python version.
139
+ - `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
140
  - Broken relative link in `examples/applications/README.md`: `../examples/` resolved to
114
141
  `examples/examples/`; it now points at `../`.
115
142
  - `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.8
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.8
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).
@@ -15,6 +15,8 @@ Requires `pip install auditkit[interop]` (the `datasets` package).
15
15
  Each loads its namespaced Hub dataset (`cais/mmlu`, `openai/gsm8k`, `allenai/ai2_arc`, `Rowan/hellaswag`,
16
16
  `truthfulqa/truthful_qa`, `openai/openai_humaneval`). HumanEval's target is the reference solution, and
17
17
  AuditKIT has no code-execution metric, so it can't score pass@k; use `ak.run_lmeval("humaneval", ...)` for that.
18
+ GSM8K's target is the final number, and it is scored with `numeric_match` (the number after `####`,
19
+ else the last number in the reply) unless you pass `scorers=`.
18
20
 
19
21
  AuditKIT doesn't re-export these classes at the top-level `auditkit` package.
20
22
  Import them from their own module, or resolve by name via `SCENARIOS`.
@@ -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.8"
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.8"
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(
@@ -257,7 +264,7 @@ def evaluate(
257
264
  scenario = _to_scenario(dataset, dataset_config, dataset_split)
258
265
  resolved_model = AutoModel.resolve(model, **opts)
259
266
  samples = list(scenario.samples())
260
- metrics = _to_metrics(scorers, samples)
267
+ metrics = _to_metrics(scorers if scorers is not None else scenario.default_scorers, samples)
261
268
  cfg = config or RunConfig()
262
269
 
263
270
  spec = RunSpec(
@@ -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]:
@@ -88,6 +88,44 @@ class ExactMatch(Metric):
88
88
  return Score(name=self.name, value=1.0 if hit else 0.0, kind=self.kind)
89
89
 
90
90
 
91
+ _NUMBER_RE = re.compile(r"-?\d[\d,]*(?:\.\d+)?")
92
+
93
+
94
+ def _last_number(text: Any) -> Optional[float]:
95
+ """The answer number in a reply: the first one after the last ``####``
96
+ (GSM8K's answer marker) if present, else the last number in the text. Commas and ``$`` are
97
+ ignored. None when the text has no number."""
98
+ text = str(text).replace("$", "")
99
+ marked = "####" in text
100
+ found = _NUMBER_RE.findall(text.rsplit("####", 1)[1] if marked else text)
101
+ if not found:
102
+ return None
103
+ try:
104
+ return float(found[0 if marked else -1].replace(",", ""))
105
+ except ValueError:
106
+ return None
107
+
108
+
109
+ @METRICS.register("numeric_match")
110
+ class NumericMatch(Metric):
111
+ """1.0 iff the last number in the output equals the numeric target.
112
+
113
+ For math word problems (GSM8K), like lm-eval's flexible extract: the
114
+ reply may show its working, only the final number counts. A reply with no
115
+ number scores 0 and is marked ``metadata["no_number"] = True``.
116
+ """
117
+
118
+ name = "numeric_match"
119
+ direction = Direction.MAXIMIZE
120
+ required_fields = frozenset({"target"})
121
+
122
+ def score(self, sample: Sample, output: str, context: Any = None) -> Score:
123
+ want, got = _last_number(sample.target), _last_number(output)
124
+ hit = want is not None and got is not None and abs(want - got) < 1e-9
125
+ return Score(name=self.name, value=1.0 if hit else 0.0, kind=self.kind,
126
+ metadata={"no_number": got is None, "extracted": got})
127
+
128
+
91
129
  _ARTICLE_RE = re.compile(r"\b(a|an|the)\b", re.IGNORECASE)
92
130
  _PUNCT_RE = re.compile(r"[^\w\s]")
93
131
 
@@ -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
 
@@ -6,7 +6,7 @@ Usage::
6
6
  from auditkit.redteam import RedTeamRunner, Probe, Detector
7
7
 
8
8
  runner = RedTeamRunner(model="groq:llama-3.3-70b-versatile")
9
- result = runner.run(probes=[Probe("jailbreak_dan")])
9
+ result = runner.run(probes=["jailbreak", "prompt_injection"])
10
10
  print(result.summary())
11
11
  """
12
12
 
@@ -131,12 +131,27 @@ class RedTeamRunner:
131
131
  A RedTeamResult with per-probe results.
132
132
  """
133
133
  resolved_probes = self._resolve_probes(probes)
134
- resolved_detectors = self._resolve_detectors(detectors, resolved_probes)
134
+ # Explicit detectors apply to every probe. Otherwise each probe uses only its own
135
+ # default detectors, so a refusal on a jailbreak probe is not judged by RefusalDetector.
136
+ detectors_by_probe = {
137
+ id(probe): self._resolve_detectors(detectors, [probe]) for probe in resolved_probes
138
+ }
139
+ detectors_used: list[str] = []
140
+ for dets in detectors_by_probe.values():
141
+ for d in dets:
142
+ if d.name not in detectors_used:
143
+ detectors_used.append(d.name)
135
144
 
136
145
  results: list[ProbeResult] = []
137
146
 
138
147
  for probe in resolved_probes:
139
148
  prompts = probe.generate()
149
+ if not prompts:
150
+ raise ValueError(
151
+ f"Probe '{probe.name}' has no prompts, so nothing would be tested. "
152
+ f"Use a built-in probe name ({', '.join(_PROBE_REGISTRY)}) "
153
+ "or a Probe subclass that returns prompts."
154
+ )
140
155
  requests = [Request(prompt=p) for p in prompts]
141
156
  results_list = self._model.generate(requests)
142
157
 
@@ -144,7 +159,7 @@ class RedTeamRunner:
144
159
  output_str = result.text
145
160
  probe_results: list[ProbeResult] = []
146
161
 
147
- for detector in resolved_detectors:
162
+ for detector in detectors_by_probe[id(probe)]:
148
163
  det_result = detector.detect(prompt, output_str)
149
164
  pr = ProbeResult(
150
165
  probe_name=probe.name,
@@ -161,7 +176,7 @@ class RedTeamRunner:
161
176
  results=results,
162
177
  model_name=str(self._model),
163
178
  probes_used=[p.name for p in resolved_probes],
164
- detectors_used=[d.name for d in resolved_detectors],
179
+ detectors_used=detectors_used,
165
180
  )
166
181
 
167
182
  def _resolve_probes(self, probes: list[str | Probe] | None) -> list[Probe]:
@@ -197,10 +212,11 @@ class RedTeamRunner:
197
212
  raise TypeError(f"Expected Detector or str, got {type(d)}")
198
213
  return resolved
199
214
 
200
- used: set[str] = set()
215
+ used: list[str] = []
201
216
  for probe in probes:
202
217
  for det_name in _PROBE_DETECTOR_MAP.get(probe.name, []):
203
- used.add(det_name)
218
+ if det_name not in used:
219
+ used.append(det_name)
204
220
  if not used:
205
- used = {"keyword"}
221
+ used = ["keyword"]
206
222
  return [_DETECTOR_REGISTRY[name]() for name in used]
@@ -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