mlspec 0.12.6__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 (268) hide show
  1. mlspec-0.12.6/LICENSE +92 -0
  2. mlspec-0.12.6/LICENSE-COMMERCIAL +39 -0
  3. mlspec-0.12.6/PKG-INFO +439 -0
  4. mlspec-0.12.6/README.md +324 -0
  5. mlspec-0.12.6/pyproject.toml +153 -0
  6. mlspec-0.12.6/rust/Cargo.lock +639 -0
  7. mlspec-0.12.6/rust/Cargo.toml +27 -0
  8. mlspec-0.12.6/rust/benches/drift.rs +47 -0
  9. mlspec-0.12.6/rust/src/lib.rs +1033 -0
  10. mlspec-0.12.6/src/mltk/__init__.py +56 -0
  11. mlspec-0.12.6/src/mltk/_rust.py +422 -0
  12. mlspec-0.12.6/src/mltk/chat/__init__.py +6 -0
  13. mlspec-0.12.6/src/mltk/chat/engine.py +365 -0
  14. mlspec-0.12.6/src/mltk/chat/repl.py +46 -0
  15. mlspec-0.12.6/src/mltk/cli/__init__.py +1 -0
  16. mlspec-0.12.6/src/mltk/cli/_discovery.py +191 -0
  17. mlspec-0.12.6/src/mltk/cli/app.py +1249 -0
  18. mlspec-0.12.6/src/mltk/cli/container.py +216 -0
  19. mlspec-0.12.6/src/mltk/cli/security_scan.py +592 -0
  20. mlspec-0.12.6/src/mltk/compliance/__init__.py +55 -0
  21. mlspec-0.12.6/src/mltk/compliance/custom.py +372 -0
  22. mlspec-0.12.6/src/mltk/compliance/eu_ai_act.py +318 -0
  23. mlspec-0.12.6/src/mltk/compliance/fda.py +94 -0
  24. mlspec-0.12.6/src/mltk/compliance/generator.py +134 -0
  25. mlspec-0.12.6/src/mltk/compliance/hipaa.py +299 -0
  26. mlspec-0.12.6/src/mltk/compliance/iso_42001.py +267 -0
  27. mlspec-0.12.6/src/mltk/compliance/nist_ai_rmf.py +358 -0
  28. mlspec-0.12.6/src/mltk/compliance/owasp_llm.py +367 -0
  29. mlspec-0.12.6/src/mltk/compliance/pdf_export.py +72 -0
  30. mlspec-0.12.6/src/mltk/compliance/sr_11_7.py +357 -0
  31. mlspec-0.12.6/src/mltk/compliance/templates/eu_ai_act.html.j2 +218 -0
  32. mlspec-0.12.6/src/mltk/container/__init__.py +32 -0
  33. mlspec-0.12.6/src/mltk/container/_binary.py +52 -0
  34. mlspec-0.12.6/src/mltk/container/assertions.py +176 -0
  35. mlspec-0.12.6/src/mltk/container/scanner.py +272 -0
  36. mlspec-0.12.6/src/mltk/container/trivy_adapter.py +309 -0
  37. mlspec-0.12.6/src/mltk/contracts/__init__.py +13 -0
  38. mlspec-0.12.6/src/mltk/contracts/generator.py +102 -0
  39. mlspec-0.12.6/src/mltk/contracts/schema.py +111 -0
  40. mlspec-0.12.6/src/mltk/contracts/validator.py +134 -0
  41. mlspec-0.12.6/src/mltk/core/__init__.py +28 -0
  42. mlspec-0.12.6/src/mltk/core/assertion.py +80 -0
  43. mlspec-0.12.6/src/mltk/core/config.py +255 -0
  44. mlspec-0.12.6/src/mltk/core/plugin.py +110 -0
  45. mlspec-0.12.6/src/mltk/core/polars_bridge.py +102 -0
  46. mlspec-0.12.6/src/mltk/core/result.py +195 -0
  47. mlspec-0.12.6/src/mltk/core/suite.py +450 -0
  48. mlspec-0.12.6/src/mltk/data/__init__.py +83 -0
  49. mlspec-0.12.6/src/mltk/data/distribution.py +169 -0
  50. mlspec-0.12.6/src/mltk/data/drift.py +651 -0
  51. mlspec-0.12.6/src/mltk/data/embedding_drift.py +128 -0
  52. mlspec-0.12.6/src/mltk/data/freshness.py +128 -0
  53. mlspec-0.12.6/src/mltk/data/labels.py +136 -0
  54. mlspec-0.12.6/src/mltk/data/lineage.py +148 -0
  55. mlspec-0.12.6/src/mltk/data/pii.py +730 -0
  56. mlspec-0.12.6/src/mltk/data/pii_ner.py +561 -0
  57. mlspec-0.12.6/src/mltk/data/preset.py +214 -0
  58. mlspec-0.12.6/src/mltk/data/schema.py +169 -0
  59. mlspec-0.12.6/src/mltk/data/statistics.py +281 -0
  60. mlspec-0.12.6/src/mltk/data/synthetic.py +545 -0
  61. mlspec-0.12.6/src/mltk/data/validation.py +307 -0
  62. mlspec-0.12.6/src/mltk/doctor.py +369 -0
  63. mlspec-0.12.6/src/mltk/domains/__init__.py +1 -0
  64. mlspec-0.12.6/src/mltk/domains/codegen.py +566 -0
  65. mlspec-0.12.6/src/mltk/domains/cv/__init__.py +20 -0
  66. mlspec-0.12.6/src/mltk/domains/cv/classification.py +66 -0
  67. mlspec-0.12.6/src/mltk/domains/cv/detection.py +221 -0
  68. mlspec-0.12.6/src/mltk/domains/cv/face.py +74 -0
  69. mlspec-0.12.6/src/mltk/domains/cv/tracking.py +348 -0
  70. mlspec-0.12.6/src/mltk/domains/cv/video.py +113 -0
  71. mlspec-0.12.6/src/mltk/domains/healthcare.py +636 -0
  72. mlspec-0.12.6/src/mltk/domains/llm/__init__.py +174 -0
  73. mlspec-0.12.6/src/mltk/domains/llm/_backends.py +183 -0
  74. mlspec-0.12.6/src/mltk/domains/llm/_utils.py +35 -0
  75. mlspec-0.12.6/src/mltk/domains/llm/agentic.py +748 -0
  76. mlspec-0.12.6/src/mltk/domains/llm/behavioral/__init__.py +42 -0
  77. mlspec-0.12.6/src/mltk/domains/llm/behavioral/invariance.py +543 -0
  78. mlspec-0.12.6/src/mltk/domains/llm/behavioral/paraphrase.py +345 -0
  79. mlspec-0.12.6/src/mltk/domains/llm/behavioral/retrieval.py +151 -0
  80. mlspec-0.12.6/src/mltk/domains/llm/behavioral/semantic.py +348 -0
  81. mlspec-0.12.6/src/mltk/domains/llm/behavioral/stability.py +254 -0
  82. mlspec-0.12.6/src/mltk/domains/llm/bertscore.py +161 -0
  83. mlspec-0.12.6/src/mltk/domains/llm/coherence.py +99 -0
  84. mlspec-0.12.6/src/mltk/domains/llm/conversation.py +271 -0
  85. mlspec-0.12.6/src/mltk/domains/llm/judge.py +496 -0
  86. mlspec-0.12.6/src/mltk/domains/llm/judge_defaults.py +262 -0
  87. mlspec-0.12.6/src/mltk/domains/llm/latency.py +116 -0
  88. mlspec-0.12.6/src/mltk/domains/llm/long_context.py +398 -0
  89. mlspec-0.12.6/src/mltk/domains/llm/mcp.py +756 -0
  90. mlspec-0.12.6/src/mltk/domains/llm/multi_agent.py +244 -0
  91. mlspec-0.12.6/src/mltk/domains/llm/rag.py +521 -0
  92. mlspec-0.12.6/src/mltk/domains/llm/ragas.py +156 -0
  93. mlspec-0.12.6/src/mltk/domains/llm/red_team/__init__.py +57 -0
  94. mlspec-0.12.6/src/mltk/domains/llm/red_team/_grading.py +493 -0
  95. mlspec-0.12.6/src/mltk/domains/llm/red_team/assertions.py +584 -0
  96. mlspec-0.12.6/src/mltk/domains/llm/red_team/catalog.py +431 -0
  97. mlspec-0.12.6/src/mltk/domains/llm/red_team/mutations.py +204 -0
  98. mlspec-0.12.6/src/mltk/domains/llm/red_team/session.py +364 -0
  99. mlspec-0.12.6/src/mltk/domains/llm/retrieval.py +417 -0
  100. mlspec-0.12.6/src/mltk/domains/llm/safety.py +913 -0
  101. mlspec-0.12.6/src/mltk/domains/llm/similarity.py +111 -0
  102. mlspec-0.12.6/src/mltk/domains/llm/span.py +221 -0
  103. mlspec-0.12.6/src/mltk/domains/llm/span_eval.py +388 -0
  104. mlspec-0.12.6/src/mltk/domains/llm/summarization.py +236 -0
  105. mlspec-0.12.6/src/mltk/domains/llm/synthetic/__init__.py +19 -0
  106. mlspec-0.12.6/src/mltk/domains/llm/synthetic/_quality.py +217 -0
  107. mlspec-0.12.6/src/mltk/domains/llm/synthetic/_splitter.py +183 -0
  108. mlspec-0.12.6/src/mltk/domains/llm/synthetic/_templates.py +509 -0
  109. mlspec-0.12.6/src/mltk/domains/llm/synthetic/generator.py +1195 -0
  110. mlspec-0.12.6/src/mltk/domains/llm/text_quality.py +195 -0
  111. mlspec-0.12.6/src/mltk/domains/llm/trace.py +156 -0
  112. mlspec-0.12.6/src/mltk/domains/multimodal/__init__.py +65 -0
  113. mlspec-0.12.6/src/mltk/domains/multimodal/_image.py +176 -0
  114. mlspec-0.12.6/src/mltk/domains/multimodal/alignment.py +486 -0
  115. mlspec-0.12.6/src/mltk/domains/multimodal/hallucination.py +252 -0
  116. mlspec-0.12.6/src/mltk/domains/multimodal/metrics.py +441 -0
  117. mlspec-0.12.6/src/mltk/domains/multimodal/vlm.py +459 -0
  118. mlspec-0.12.6/src/mltk/domains/nlp/__init__.py +18 -0
  119. mlspec-0.12.6/src/mltk/domains/nlp/generation.py +113 -0
  120. mlspec-0.12.6/src/mltk/domains/nlp/ner.py +58 -0
  121. mlspec-0.12.6/src/mltk/domains/nlp/robustness.py +459 -0
  122. mlspec-0.12.6/src/mltk/domains/nlp/security.py +405 -0
  123. mlspec-0.12.6/src/mltk/domains/nlp/sentiment.py +168 -0
  124. mlspec-0.12.6/src/mltk/domains/recommendation.py +484 -0
  125. mlspec-0.12.6/src/mltk/domains/rl.py +207 -0
  126. mlspec-0.12.6/src/mltk/domains/speech/__init__.py +11 -0
  127. mlspec-0.12.6/src/mltk/domains/speech/performance.py +121 -0
  128. mlspec-0.12.6/src/mltk/domains/speech/recognition.py +98 -0
  129. mlspec-0.12.6/src/mltk/domains/tabular/__init__.py +10 -0
  130. mlspec-0.12.6/src/mltk/domains/tabular/features.py +119 -0
  131. mlspec-0.12.6/src/mltk/domains/tabular/quality.py +36 -0
  132. mlspec-0.12.6/src/mltk/eval/__init__.py +149 -0
  133. mlspec-0.12.6/src/mltk/eval/_types.py +182 -0
  134. mlspec-0.12.6/src/mltk/eval/dataset.py +1267 -0
  135. mlspec-0.12.6/src/mltk/eval/scorers.py +446 -0
  136. mlspec-0.12.6/src/mltk/eval/solvers.py +460 -0
  137. mlspec-0.12.6/src/mltk/eval/task.py +603 -0
  138. mlspec-0.12.6/src/mltk/experiment/__init__.py +42 -0
  139. mlspec-0.12.6/src/mltk/experiment/hypothesis.py +82 -0
  140. mlspec-0.12.6/src/mltk/experiment/ranking.py +108 -0
  141. mlspec-0.12.6/src/mltk/experiment/result.py +67 -0
  142. mlspec-0.12.6/src/mltk/experiment/runner.py +386 -0
  143. mlspec-0.12.6/src/mltk/experiment/sandbox.py +308 -0
  144. mlspec-0.12.6/src/mltk/experiment/worktree.py +351 -0
  145. mlspec-0.12.6/src/mltk/inference/__init__.py +12 -0
  146. mlspec-0.12.6/src/mltk/inference/contract.py +140 -0
  147. mlspec-0.12.6/src/mltk/inference/latency.py +148 -0
  148. mlspec-0.12.6/src/mltk/inference/throughput.py +96 -0
  149. mlspec-0.12.6/src/mltk/integrations/__init__.py +67 -0
  150. mlspec-0.12.6/src/mltk/integrations/adapter.py +63 -0
  151. mlspec-0.12.6/src/mltk/integrations/asana_adapter.py +94 -0
  152. mlspec-0.12.6/src/mltk/integrations/dedup.py +94 -0
  153. mlspec-0.12.6/src/mltk/integrations/dvc.py +354 -0
  154. mlspec-0.12.6/src/mltk/integrations/github_adapter.py +245 -0
  155. mlspec-0.12.6/src/mltk/integrations/github_app.py +604 -0
  156. mlspec-0.12.6/src/mltk/integrations/grafana.py +374 -0
  157. mlspec-0.12.6/src/mltk/integrations/issue_linker.py +131 -0
  158. mlspec-0.12.6/src/mltk/integrations/jira_adapter.py +170 -0
  159. mlspec-0.12.6/src/mltk/integrations/kubeflow.py +289 -0
  160. mlspec-0.12.6/src/mltk/integrations/langfuse.py +230 -0
  161. mlspec-0.12.6/src/mltk/integrations/linear_adapter.py +115 -0
  162. mlspec-0.12.6/src/mltk/integrations/mlflow_logger.py +177 -0
  163. mlspec-0.12.6/src/mltk/integrations/otel.py +378 -0
  164. mlspec-0.12.6/src/mltk/integrations/phoenix.py +275 -0
  165. mlspec-0.12.6/src/mltk/integrations/pr_generator.py +204 -0
  166. mlspec-0.12.6/src/mltk/integrations/sagemaker_pipeline.py +341 -0
  167. mlspec-0.12.6/src/mltk/integrations/slack.py +142 -0
  168. mlspec-0.12.6/src/mltk/integrations/templates.py +93 -0
  169. mlspec-0.12.6/src/mltk/integrations/trace_quality.py +206 -0
  170. mlspec-0.12.6/src/mltk/integrations/wandb_adapter.py +236 -0
  171. mlspec-0.12.6/src/mltk/jupyter.py +17 -0
  172. mlspec-0.12.6/src/mltk/mcp/__init__.py +6 -0
  173. mlspec-0.12.6/src/mltk/mcp/__main__.py +6 -0
  174. mlspec-0.12.6/src/mltk/mcp/server.py +1390 -0
  175. mlspec-0.12.6/src/mltk/model/__init__.py +42 -0
  176. mlspec-0.12.6/src/mltk/model/ab_test.py +123 -0
  177. mlspec-0.12.6/src/mltk/model/adversarial.py +102 -0
  178. mlspec-0.12.6/src/mltk/model/attribution.py +240 -0
  179. mlspec-0.12.6/src/mltk/model/bias.py +622 -0
  180. mlspec-0.12.6/src/mltk/model/causal.py +437 -0
  181. mlspec-0.12.6/src/mltk/model/conformal.py +479 -0
  182. mlspec-0.12.6/src/mltk/model/counterfactual.py +177 -0
  183. mlspec-0.12.6/src/mltk/model/metrics.py +153 -0
  184. mlspec-0.12.6/src/mltk/model/overfitting.py +126 -0
  185. mlspec-0.12.6/src/mltk/model/regression.py +169 -0
  186. mlspec-0.12.6/src/mltk/model/slicing.py +371 -0
  187. mlspec-0.12.6/src/mltk/monitor/__init__.py +69 -0
  188. mlspec-0.12.6/src/mltk/monitor/anomaly.py +307 -0
  189. mlspec-0.12.6/src/mltk/monitor/aws.py +242 -0
  190. mlspec-0.12.6/src/mltk/monitor/azure.py +258 -0
  191. mlspec-0.12.6/src/mltk/monitor/concept_drift.py +335 -0
  192. mlspec-0.12.6/src/mltk/monitor/drift_monitor.py +226 -0
  193. mlspec-0.12.6/src/mltk/monitor/gcp.py +228 -0
  194. mlspec-0.12.6/src/mltk/monitor/gpu.py +176 -0
  195. mlspec-0.12.6/src/mltk/monitor/prometheus.py +299 -0
  196. mlspec-0.12.6/src/mltk/monitor/streaming_drift.py +449 -0
  197. mlspec-0.12.6/src/mltk/pipeline/__init__.py +7 -0
  198. mlspec-0.12.6/src/mltk/pipeline/e2e.py +72 -0
  199. mlspec-0.12.6/src/mltk/pipeline/onnx.py +125 -0
  200. mlspec-0.12.6/src/mltk/pipeline/reproducibility.py +156 -0
  201. mlspec-0.12.6/src/mltk/py.typed +0 -0
  202. mlspec-0.12.6/src/mltk/pytest_plugin/__init__.py +1 -0
  203. mlspec-0.12.6/src/mltk/pytest_plugin/plugin.py +443 -0
  204. mlspec-0.12.6/src/mltk/registry/__init__.py +25 -0
  205. mlspec-0.12.6/src/mltk/registry/collection.py +162 -0
  206. mlspec-0.12.6/src/mltk/registry/manifest.py +60 -0
  207. mlspec-0.12.6/src/mltk/report/__init__.py +19 -0
  208. mlspec-0.12.6/src/mltk/report/_helpers.py +36 -0
  209. mlspec-0.12.6/src/mltk/report/bias_report.py +229 -0
  210. mlspec-0.12.6/src/mltk/report/generator.py +122 -0
  211. mlspec-0.12.6/src/mltk/report/junit.py +133 -0
  212. mlspec-0.12.6/src/mltk/report/model_card.py +308 -0
  213. mlspec-0.12.6/src/mltk/report/score.py +117 -0
  214. mlspec-0.12.6/src/mltk/report/summarizer.py +114 -0
  215. mlspec-0.12.6/src/mltk/report/templates/report.html.j2 +196 -0
  216. mlspec-0.12.6/src/mltk/report/visual_diff.py +382 -0
  217. mlspec-0.12.6/src/mltk/scan/__init__.py +179 -0
  218. mlspec-0.12.6/src/mltk/scan/codegen.py +352 -0
  219. mlspec-0.12.6/src/mltk/scan/config.py +188 -0
  220. mlspec-0.12.6/src/mltk/scan/console.py +423 -0
  221. mlspec-0.12.6/src/mltk/scan/detect.py +285 -0
  222. mlspec-0.12.6/src/mltk/scan/engine.py +938 -0
  223. mlspec-0.12.6/src/mltk/scan/finding.py +150 -0
  224. mlspec-0.12.6/src/mltk/scan/loader.py +419 -0
  225. mlspec-0.12.6/src/mltk/scan/scanners/__init__.py +83 -0
  226. mlspec-0.12.6/src/mltk/scan/scanners/base.py +116 -0
  227. mlspec-0.12.6/src/mltk/scan/scanners/bias.py +351 -0
  228. mlspec-0.12.6/src/mltk/scan/scanners/calibration.py +228 -0
  229. mlspec-0.12.6/src/mltk/scan/scanners/data.py +361 -0
  230. mlspec-0.12.6/src/mltk/scan/scanners/drift.py +242 -0
  231. mlspec-0.12.6/src/mltk/scan/scanners/leakage.py +404 -0
  232. mlspec-0.12.6/src/mltk/scan/scanners/overfit.py +231 -0
  233. mlspec-0.12.6/src/mltk/scan/scanners/robustness.py +224 -0
  234. mlspec-0.12.6/src/mltk/scan/scanners/slice.py +386 -0
  235. mlspec-0.12.6/src/mltk/server/__init__.py +4 -0
  236. mlspec-0.12.6/src/mltk/server/app.py +69 -0
  237. mlspec-0.12.6/src/mltk/server/audit_log.py +333 -0
  238. mlspec-0.12.6/src/mltk/server/auth.py +34 -0
  239. mlspec-0.12.6/src/mltk/server/comparison.py +63 -0
  240. mlspec-0.12.6/src/mltk/server/dashboard.html +612 -0
  241. mlspec-0.12.6/src/mltk/server/github_ci.py +220 -0
  242. mlspec-0.12.6/src/mltk/server/logging_config.py +41 -0
  243. mlspec-0.12.6/src/mltk/server/metrics.py +129 -0
  244. mlspec-0.12.6/src/mltk/server/portal.py +361 -0
  245. mlspec-0.12.6/src/mltk/server/rbac.py +235 -0
  246. mlspec-0.12.6/src/mltk/server/routes.py +262 -0
  247. mlspec-0.12.6/src/mltk/server/scheduler.py +327 -0
  248. mlspec-0.12.6/src/mltk/server/static.py +16 -0
  249. mlspec-0.12.6/src/mltk/server/storage.py +441 -0
  250. mlspec-0.12.6/src/mltk/server/webhooks.py +149 -0
  251. mlspec-0.12.6/src/mltk/testdefs/__init__.py +57 -0
  252. mlspec-0.12.6/src/mltk/testdefs/runner.py +1524 -0
  253. mlspec-0.12.6/src/mltk/testdefs/schema.py +566 -0
  254. mlspec-0.12.6/src/mltk/testing/__init__.py +26 -0
  255. mlspec-0.12.6/src/mltk/testing/flaky.py +72 -0
  256. mlspec-0.12.6/src/mltk/testing/golden.py +166 -0
  257. mlspec-0.12.6/src/mltk/testing/impact.py +365 -0
  258. mlspec-0.12.6/src/mltk/testing/retry.py +174 -0
  259. mlspec-0.12.6/src/mltk/testing/selection.py +149 -0
  260. mlspec-0.12.6/src/mltk/training/__init__.py +75 -0
  261. mlspec-0.12.6/src/mltk/training/augmentation.py +191 -0
  262. mlspec-0.12.6/src/mltk/training/checkpoint.py +210 -0
  263. mlspec-0.12.6/src/mltk/training/distributed.py +433 -0
  264. mlspec-0.12.6/src/mltk/training/gradient.py +218 -0
  265. mlspec-0.12.6/src/mltk/training/leakage.py +150 -0
  266. mlspec-0.12.6/src/mltk/training/memory.py +153 -0
  267. mlspec-0.12.6/src/mltk/training/numerical.py +265 -0
  268. mlspec-0.12.6/src/mltk/training/skew.py +84 -0
mlspec-0.12.6/LICENSE ADDED
@@ -0,0 +1,92 @@
1
+ Copyright (c) 2026 Lior Cohen
2
+
3
+ Elastic License 2.0
4
+
5
+ URL: https://www.elastic.co/licensing/elastic-license
6
+
7
+ ## Acceptance
8
+
9
+ By using the software, you agree to all of the terms and conditions below.
10
+
11
+ ## Copyright License
12
+
13
+ The licensor grants you a non-exclusive, royalty-free, worldwide,
14
+ non-sublicensable, non-transferable license to use, copy, distribute, make
15
+ available, and prepare derivative works of the software, in each case subject
16
+ to the limitations and conditions below.
17
+
18
+ ## Limitations
19
+
20
+ You may not provide the software to third parties as a hosted or managed
21
+ service, where the service provides users with access to any substantial set
22
+ of the features or functionality of the software.
23
+
24
+ You may not move, change, disable, or circumvent the license key functionality
25
+ in the software, and you may not remove or obscure any functionality in the
26
+ software that is protected by the license key.
27
+
28
+ You may not alter, remove, or obscure any licensing, copyright, or other
29
+ notices of the licensor in the software. Any use of the licensor's trademarks
30
+ is subject to applicable law.
31
+
32
+ ## Patents
33
+
34
+ The licensor grants you a license, under any patent claims the licensor can
35
+ license, or becomes able to license, to make, have made, use, practice, offer
36
+ for sale, import and otherwise transfer the software. This license does not
37
+ cover any patent claims that you cause to be infringed by modifications or
38
+ additions to the software. If you or your company make any written claim that
39
+ the software infringes or contributes to infringement of any patent, your
40
+ patent license for the software ends immediately.
41
+
42
+ ## Notices
43
+
44
+ You must ensure that anyone who gets a copy of any part of the software from
45
+ you also gets a copy of these terms.
46
+
47
+ If you modify the software, you must include in any modified copies of the
48
+ software a prominent notice stating that you have modified the software.
49
+
50
+ ## No Other Rights
51
+
52
+ These terms do not imply any licenses other than those expressly granted in
53
+ these terms.
54
+
55
+ ## Termination
56
+
57
+ If you use the software in violation of these terms, such use is not licensed,
58
+ and your licenses will automatically terminate. If the licensor provides you
59
+ with a notice of your violation, and you cease all violation of this license
60
+ no later than 30 days after you receive that notice, your licenses will be
61
+ reinstated retroactively. However, if you violate these terms after such
62
+ reinstatement, any additional violation of these terms will cause your licenses
63
+ to terminate automatically and permanently.
64
+
65
+ ## No Liability
66
+
67
+ *As far as the law allows, the software comes as is, without any warranty or
68
+ condition, and the licensor will not be liable to you for any damages arising
69
+ out of these terms or the use or nature of the software, under any kind of
70
+ legal theory, including tort (including negligence), contract, warranty,
71
+ statutory, or otherwise.*
72
+
73
+ ## Definitions
74
+
75
+ The **licensor** is the entity offering these terms, and the **software** is
76
+ the software the licensor makes available under these terms, including any
77
+ portion of it.
78
+
79
+ **you** refers to the individual or entity agreeing to these terms.
80
+
81
+ **your company** is any legal entity, sole proprietorship, or other kind of
82
+ organization that you work for, plus all organizations that have control over,
83
+ are under the control of, or are under common control with that organization.
84
+ **control** means ownership of substantially all the assets of an entity, or
85
+ the power to direct its management and policies by vote, majority ownership,
86
+ or otherwise. Control can be direct or indirect.
87
+
88
+ **your licenses** are all the licenses granted to you for the software under
89
+ these terms.
90
+
91
+ **use** includes copying, distributing, making available, modifying, and
92
+ preparing derivative works.
@@ -0,0 +1,39 @@
1
+ # Commercial License — mltk
2
+
3
+ mltk is licensed under the [Elastic License 2.0](LICENSE) (ELv2), which
4
+ permits free use for internal, non-commercial, and evaluation purposes.
5
+
6
+ ## When to get in touch
7
+
8
+ The ELv2 community license covers most uses. You should reach out about a
9
+ commercial license when your use case resembles any of the following:
10
+
11
+ - **Managed / hosted service**: You offer mltk (or a product substantially
12
+ built on mltk) as a service to third parties — e.g. an MLOps platform,
13
+ a testing-as-a-service product, or a SaaS tool where mltk functionality
14
+ is accessible to your customers. This is the primary restriction in ELv2.
15
+
16
+ - **Bundled commercial product**: You embed or redistribute mltk as part of
17
+ a product you sell or license to third parties.
18
+
19
+ - **Commercial training or consulting**: You deliver paid engagements where
20
+ mltk is a central deliverable.
21
+
22
+ If you're unsure, reach out — we're happy to clarify before you deploy.
23
+
24
+ Internal use within your company — including running mltk against your own
25
+ models, pipelines, and datasets, regardless of company size or revenue — is
26
+ free under ELv2 with no conversation required.
27
+
28
+ ## How to obtain a commercial license
29
+
30
+ Contact: **lior1cc@gmail.com**
31
+
32
+ Please include a brief description of your use case. Commercial licenses are
33
+ negotiated individually and may be structured as a flat fee, revenue share,
34
+ or other arrangement depending on the use case.
35
+
36
+ ## Questions
37
+
38
+ If you are unsure whether your use case requires a commercial license, reach
39
+ out before deploying. We are happy to clarify.
mlspec-0.12.6/PKG-INFO ADDED
@@ -0,0 +1,439 @@
1
+ Metadata-Version: 2.4
2
+ Name: mlspec
3
+ Version: 0.12.6
4
+ Classifier: Development Status :: 3 - Alpha
5
+ Classifier: Intended Audience :: Developers
6
+ Classifier: Intended Audience :: Science/Research
7
+ Classifier: License :: Other/Proprietary License
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: Programming Language :: Python :: 3.10
10
+ Classifier: Programming Language :: Python :: 3.11
11
+ Classifier: Programming Language :: Python :: 3.12
12
+ Classifier: Programming Language :: Python :: 3.13
13
+ Classifier: Programming Language :: Rust
14
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
15
+ Classifier: Topic :: Software Development :: Testing
16
+ Classifier: Framework :: Pytest
17
+ Requires-Dist: numpy>=1.24
18
+ Requires-Dist: pandas>=2.0
19
+ Requires-Dist: mlspec[scipy,sklearn,cli,report,cv,nlp,speech,contracts,integrations,pdf,llm,embedding,nli,ner,mcp,multimodal,clip,classifier,torch,mlflow,otel,server,aws,gcp,azure,container,metrics] ; extra == 'all'
20
+ Requires-Dist: boto3>=1.28 ; extra == 'aws'
21
+ Requires-Dist: azure-ai-ml>=1.12 ; extra == 'azure'
22
+ Requires-Dist: transformers>=4.40 ; extra == 'classifier'
23
+ Requires-Dist: torch>=2.0 ; extra == 'classifier'
24
+ Requires-Dist: typer>=0.9 ; extra == 'cli'
25
+ Requires-Dist: rich>=13 ; extra == 'cli'
26
+ Requires-Dist: open-clip-torch>=2.24 ; extra == 'clip'
27
+ Requires-Dist: pillow>=9.0 ; extra == 'clip'
28
+ Requires-Dist: trivy-py>=0.70 ; extra == 'container'
29
+ Requires-Dist: pyyaml>=6.0 ; extra == 'contracts'
30
+ Requires-Dist: opencv-python>=4.8 ; extra == 'cv'
31
+ Requires-Dist: pytest>=8.0 ; extra == 'dev'
32
+ Requires-Dist: pytest-cov>=4.0 ; extra == 'dev'
33
+ Requires-Dist: pytest-xdist>=3.5 ; extra == 'dev'
34
+ Requires-Dist: pytest-randomly>=3.15 ; extra == 'dev'
35
+ Requires-Dist: hypothesis>=6.100 ; extra == 'dev'
36
+ Requires-Dist: syrupy>=4.0 ; extra == 'dev'
37
+ Requires-Dist: ruff>=0.3 ; extra == 'dev'
38
+ Requires-Dist: mypy>=1.8 ; extra == 'dev'
39
+ Requires-Dist: pre-commit>=3.5 ; extra == 'dev'
40
+ Requires-Dist: mkdocs-material>=9.5 ; extra == 'docs'
41
+ Requires-Dist: mkdocstrings[python]>=0.24 ; extra == 'docs'
42
+ Requires-Dist: sentence-transformers>=2.0 ; extra == 'embedding'
43
+ Requires-Dist: google-cloud-aiplatform>=1.40 ; extra == 'gcp'
44
+ Requires-Dist: jira>=3.0 ; extra == 'integrations'
45
+ Requires-Dist: langfuse>=2.0 ; extra == 'langfuse'
46
+ Requires-Dist: jsonschema>=4.0 ; extra == 'mcp'
47
+ Requires-Dist: prometheus-client>=0.20 ; extra == 'metrics'
48
+ Requires-Dist: mlflow>=2.0 ; extra == 'mlflow'
49
+ Requires-Dist: pillow>=9.0 ; extra == 'multimodal'
50
+ Requires-Dist: scikit-image>=0.20 ; extra == 'multimodal'
51
+ Requires-Dist: presidio-analyzer>=2.2 ; extra == 'ner'
52
+ Requires-Dist: spacy>=3.4.4 ; extra == 'ner'
53
+ Requires-Dist: sentence-transformers>=2.0 ; extra == 'nli'
54
+ Requires-Dist: nltk>=3.8 ; extra == 'nlp'
55
+ Requires-Dist: rouge-score>=0.1 ; extra == 'nlp'
56
+ Requires-Dist: opentelemetry-api>=1.20 ; extra == 'otel'
57
+ Requires-Dist: opentelemetry-sdk>=1.20 ; extra == 'otel'
58
+ Requires-Dist: opentelemetry-exporter-otlp>=1.20 ; extra == 'otel'
59
+ Requires-Dist: weasyprint>=60 ; extra == 'pdf'
60
+ Requires-Dist: arize-phoenix>=4.0 ; extra == 'phoenix'
61
+ Requires-Dist: opentelemetry-api>=1.20 ; extra == 'phoenix'
62
+ Requires-Dist: opentelemetry-sdk>=1.20 ; extra == 'phoenix'
63
+ Requires-Dist: plotly>=5.18 ; extra == 'report'
64
+ Requires-Dist: jinja2>=3.1 ; extra == 'report'
65
+ Requires-Dist: scipy>=1.11 ; extra == 'scipy'
66
+ Requires-Dist: fastapi>=0.110 ; extra == 'server'
67
+ Requires-Dist: uvicorn>=0.27 ; extra == 'server'
68
+ Requires-Dist: scikit-learn>=1.3 ; extra == 'sklearn'
69
+ Requires-Dist: jiwer>=3.0 ; extra == 'speech'
70
+ Requires-Dist: torch>=2.0 ; extra == 'torch'
71
+ Provides-Extra: all
72
+ Provides-Extra: aws
73
+ Provides-Extra: azure
74
+ Provides-Extra: classifier
75
+ Provides-Extra: cli
76
+ Provides-Extra: clip
77
+ Provides-Extra: container
78
+ Provides-Extra: contracts
79
+ Provides-Extra: cv
80
+ Provides-Extra: dev
81
+ Provides-Extra: docs
82
+ Provides-Extra: embedding
83
+ Provides-Extra: gcp
84
+ Provides-Extra: integrations
85
+ Provides-Extra: langfuse
86
+ Provides-Extra: llm
87
+ Provides-Extra: mcp
88
+ Provides-Extra: metrics
89
+ Provides-Extra: mlflow
90
+ Provides-Extra: multimodal
91
+ Provides-Extra: ner
92
+ Provides-Extra: nli
93
+ Provides-Extra: nlp
94
+ Provides-Extra: otel
95
+ Provides-Extra: pdf
96
+ Provides-Extra: phoenix
97
+ Provides-Extra: report
98
+ Provides-Extra: scipy
99
+ Provides-Extra: server
100
+ Provides-Extra: sklearn
101
+ Provides-Extra: speech
102
+ Provides-Extra: torch
103
+ License-File: LICENSE
104
+ License-File: LICENSE-COMMERCIAL
105
+ Summary: pytest for ML — unified testing across the entire ML lifecycle
106
+ Keywords: ml,testing,pytest,data-quality,drift-detection,mlops
107
+ Author: Lior Cohen
108
+ Requires-Python: >=3.10
109
+ Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
110
+ Project-URL: Documentation, https://liorrr.github.io/mltk
111
+ Project-URL: Homepage, https://github.com/Liorrr/mltk
112
+ Project-URL: Issues, https://github.com/Liorrr/mltk/issues
113
+ Project-URL: Repository, https://github.com/Liorrr/mltk
114
+
115
+ # mltk - ML Test Kit
116
+
117
+ **pytest for ML** -- unified testing across the entire ML lifecycle.
118
+
119
+ [![License](https://img.shields.io/badge/license-Elastic%202.0-blue.svg)](LICENSE)
120
+ [![Python](https://img.shields.io/badge/python-3.10%2B-blue.svg)](https://python.org)
121
+ [![Tests](https://img.shields.io/badge/tests-4291%2B%20passed-green.svg)]()
122
+ [![Rust](https://img.shields.io/badge/rust-accelerated-orange.svg)]()
123
+
124
+ <!-- TEMP-PYPI-CLAIM: remove this block once mltk PyPI name is resolved -->
125
+ > **Installation note (temporary):** `pip install mltk` is not yet available — the PyPI name is pending a transfer claim. Until resolved, install directly from GitHub:
126
+ > ```bash
127
+ > pip install git+https://github.com/Liorrr/mltk
128
+ > ```
129
+ > All imports (`import mltk`), CLI commands (`mltk scan`), and functionality are identical.
130
+ <!-- END TEMP-PYPI-CLAIM -->
131
+
132
+ ## Install
133
+
134
+ **Homebrew (macOS/Linux):**
135
+ ```bash
136
+ brew tap Liorrr/mltk
137
+ brew install mltk
138
+ ```
139
+
140
+ **pip:**
141
+ ```bash
142
+ pip install mlspec # PyPI name — 'mltk' pending transfer
143
+ ```
144
+
145
+ ## Why mltk?
146
+
147
+ ML systems fail silently. A model can train on corrupt data, produce confident predictions from stale features, and pass every unit test while being completely wrong in production. Traditional testing does not catch these failures.
148
+
149
+ **mltk** gives you **232 assertions** covering the entire ML lifecycle -- data quality, model validation, drift detection, fairness testing, inference benchmarking, training bug detection, LLM evaluation, behavioral consistency, NER-based PII detection, red team security, multimodal evaluation, observability, and production monitoring. One toolkit, one `pip install`, native pytest integration. No more gluing together 5 different tools.
150
+
151
+ ## Quick Start
152
+
153
+ ```python
154
+ import pandas as pd
155
+ import pytest
156
+ from mltk.data import (
157
+ assert_schema, assert_no_nulls, assert_no_pii,
158
+ )
159
+ from mltk.model import (
160
+ assert_metric, assert_no_regression, assert_no_bias,
161
+ )
162
+ from mltk.inference import assert_latency, assert_throughput
163
+
164
+ @pytest.mark.ml_data
165
+ def test_training_data():
166
+ df = pd.read_csv("data/training.csv")
167
+ assert_schema(
168
+ df,
169
+ {"id": "int64", "text": "object", "label": "int64"},
170
+ )
171
+ assert_no_nulls(df, columns=["label"])
172
+ assert_no_pii(df, columns=["text"])
173
+
174
+ @pytest.mark.ml_model
175
+ def test_model_quality(y_true, y_pred):
176
+ assert_metric(
177
+ y_true, y_pred, metric="f1", threshold=0.85,
178
+ )
179
+ assert_no_regression(
180
+ y_true, y_pred, baseline=0.90, tolerance=0.02,
181
+ )
182
+ assert_no_bias(
183
+ y_true, y_pred,
184
+ sensitive_feature=gender,
185
+ method="demographic_parity",
186
+ )
187
+
188
+ @pytest.mark.ml_inference
189
+ def test_inference_performance():
190
+ assert_latency(model.predict, X_test, p95=50.0)
191
+ assert_throughput(model.predict, X_single, min_rps=100)
192
+ ```
193
+
194
+ Run with HTML report:
195
+ ```bash
196
+ pytest --mltk-report
197
+ ```
198
+
199
+ ## What's Included (v0.12.4)
200
+
201
+ **Behavioral consistency testing** — 7 assertions (paraphrase invariance, format invariance, output stability, semantic equivalence, directional expectation, retrieval consistency, ParaphraseGenerator) that catch models memorizing phrasing instead of learning concepts. Multi-method evaluation: lexical (token F1), embedding, NLI, LLM-as-Judge. No other ML testing tool ships these as pytest assertions.
202
+
203
+ **NER PII detection** — `assert_no_pii(method="ner"|"gliner"|"hybrid")` adds Named Entity Recognition to PII scanning. Presidio + spaCy catches names, organizations, and locations that regex cannot find. GLiNER provides zero-shot detection for domain-specific entities (healthcare MRN, legal case numbers). Hybrid mode runs regex + NER with intelligent deduplication. Install with `pip install mltk[ner]`.
204
+
205
+ **YAML test definitions** — write ML tests in YAML, no Python required. Run with `mltk test tests.yaml`. Supports 11 data assertions with `env:VAR_NAME` data source for CI/CD.
206
+
207
+ **EU AI Act compliance reports** — `mltk compliance results.json` auto-maps test results to EU AI Act articles, classifies risk level (unacceptable/high/limited/minimal), and generates an HTML evidence table with gap analysis.
208
+
209
+ **`mltk doctor`** — 9 diagnostic checks that inspect your Python version, dependencies, config, Rust extension, and pytest plugin, with actionable fix hints for each failure.
210
+
211
+ **Data contracts** — define column types, ranges, and uniqueness rules in YAML. Use `mltk contract generate-tests` to auto-generate a pytest file from the contract — zero boilerplate.
212
+
213
+ **LLM evaluation** — `assert_semantic_similarity`, `assert_no_toxicity`, `assert_no_hallucination`, `assert_ttft`, `assert_itl`, RAG evaluation (faithfulness, context precision/recall, RAGAS composite), agentic testing (task completion, tool selection), multi-turn conversation, coherence, BERTScore, and text quality assertions for GenAI systems.
214
+
215
+ **Training bug detection** — catch data leakage (P0), gradient failures (P1), numerical instability, plus P2 bugs: augmentation corruption, checkpoint integrity, distributed training sync, memory leaks, and training-serving skew detection.
216
+
217
+ **Server platform** — `mltk server` starts a self-hosted result-tracking server with REST API, live dashboard, API key auth, webhooks, run comparison, and GitHub CI integration (PR comments + check runs).
218
+
219
+ **Cloud monitoring** — AWS SageMaker/CloudWatch, GCP Vertex AI, Azure ML, and Prometheus/Triton adapters for production endpoint health, latency, and error rate assertions.
220
+
221
+ **FDA audit trail** — `mltk fda-audit` generates a device-grade audit trail from test results for regulatory submissions.
222
+
223
+ **Compliance PDF** — `mltk compliance-pdf` exports any HTML compliance report (EU AI Act, OWASP) to PDF for auditors.
224
+
225
+ **Model Card Generator** — `mltk model-card results.json` generates a Google-format Model Card in Markdown from test results.
226
+
227
+ **Chat interface** — `mltk chat` provides interactive Q&A about test results with no LLM or external API required.
228
+
229
+ **Environment variable config** — all config keys available as `MLTK_*` env vars, highest priority in the cascade. Works out of the box in CI/CD pipelines.
230
+
231
+ **JSON export** — `--mltk-export-json` flag exports full test results to JSON for downstream tooling.
232
+
233
+ ## Feature Matrix (232 assertions)
234
+
235
+ | Module | Assertions | Purpose |
236
+ |--------|-----------|---------|
237
+ | **Data Schema** | `assert_schema`, `assert_no_nulls`, `assert_dtypes` | Validate DataFrame structure |
238
+ | **Data Distribution** | `assert_range`, `assert_unique`, `assert_no_outliers` | Verify statistical properties |
239
+ | **Data Statistics** | `assert_column_mean`, `assert_column_median`, `assert_column_stdev`, `assert_quantiles` | Statistical bounds checking |
240
+ | **Data Validation** | `assert_datetime_format`, `assert_values_in_set`, `assert_no_conflicting_labels`, `assert_feature_label_correlation_stable` | Value-level data checks |
241
+ | **Data Drift** | `assert_no_drift` (KS, PSI, KL, Chi2) | Detect distribution shifts |
242
+ | **Data Drift (Advanced)** | `assert_no_embedding_drift` + 7 methods (KS, PSI, KL, Chi2, JS, Wasserstein, auto) | Embedding + tabular drift |
243
+ | **Data PII** | `assert_no_pii`, `scan_pii` (40+ regex patterns + Presidio NER + GLiNER zero-shot + hybrid) | Find leaked personal data |
244
+ | **Data Freshness** | `assert_freshness`, `assert_row_count` | Verify data recency and size |
245
+ | **Data Labels** | `assert_label_balance`, `assert_label_coverage` | Validate label quality |
246
+ | **Data Contracts** | `validate_data`, `generate_tests_from_contract` | YAML → auto-test generation |
247
+ | **Data Quality Preset** | `assert_data_quality`, `data_quality_report` | One-call full data audit |
248
+ | **Data Lineage** | `assert_lineage_complete` | Track data provenance |
249
+ | **Model Metrics** | `assert_metric` (9 metrics: accuracy, F1, AUC, MSE, R2...) | Quality gates |
250
+ | **Model Regression** | `assert_no_regression`, `save_baseline` | Catch silent degradation |
251
+ | **Model Slicing** | `assert_slice_performance`, `assert_calibration` | Subgroup fairness + ECE |
252
+ | **Model Bias** | `assert_no_bias` (5 methods) | EU AI Act / four-fifths rule |
253
+ | **Model Adversarial** | `assert_robust` | Perturbation stability |
254
+ | **Model Overfitting** | `assert_no_overfitting`, `assert_label_drift` | Training vs. validation gaps |
255
+ | **Training Bugs (P0)** | `assert_no_train_test_overlap`, `assert_temporal_split`, `assert_no_target_leakage` | Data leakage |
256
+ | **Training Bugs (P1)** | `assert_gradient_flow`, `assert_no_vanishing_gradient`, `assert_no_exploding_gradient`, `assert_loss_finite` | Gradient health |
257
+ | **Training Numerical** | `assert_no_nan_inf`, `assert_loss_decreasing`, `assert_no_loss_divergence`, `assert_softmax_valid` | Numerical stability |
258
+ | **Training Bugs (P2)** | `assert_augmentation_preserves_signal`, `assert_no_augmentation_on_test`, `assert_checkpoint_complete`, `assert_resume_loss_continuous`, `assert_effective_batch_size`, `assert_gradient_sync`, `assert_loss_is_detached`, `assert_no_memory_leak` | Augmentation, checkpoint, distributed, memory |
259
+ | **Training Skew** | `assert_no_training_serving_skew` | Training-serving distribution mismatch |
260
+ | **Inference** | `assert_latency`, `assert_cold_start`, `assert_throughput`, `assert_api_contract` | Performance SLAs |
261
+ | **Pipeline** | `assert_reproducible`, `assert_checksum`, `assert_pipeline` | Determinism + E2E |
262
+ | **Monitor** | `assert_no_degradation`, `assert_sla`, `assert_no_output_drift` | Production health |
263
+ | **Cloud Monitor** | AWS (`assert_endpoint_healthy/latency/error_rate`), GCP (`assert_endpoint_healthy`, `assert_prediction_latency`), Azure (`assert_endpoint_healthy/latency`), Prometheus/Triton | Multi-cloud monitoring |
264
+ | **LLM Evaluation** | `assert_semantic_similarity`, `assert_no_toxicity`, `assert_no_hallucination`, `assert_ttft`, `assert_itl` | GenAI testing |
265
+ | **LLM RAG** | `assert_faithfulness`, `assert_context_relevancy`, `assert_context_precision`, `assert_context_recall`, `assert_answer_relevancy`, `assert_ragas_score` | RAG pipeline evaluation (RAGAS) |
266
+ | **LLM Agentic** | `assert_task_completion`, `assert_tool_selection`, `assert_tool_call_correctness` | Agent/tool-use testing |
267
+ | **LLM Text Quality** | `assert_text_length`, `assert_output_format`, `assert_readability` | Output quality gates |
268
+ | **LLM Multi-turn** | `assert_knowledge_retention`, `assert_turn_relevancy`, `assert_conversation_completeness` | Conversation evaluation |
269
+ | **LLM Coherence** | `assert_coherence` | Logical consistency |
270
+ | **LLM BERTScore** | `assert_bertscore` (Rust-accelerated token matching) | Semantic similarity via BERT |
271
+ | **NLP** | `assert_bleu`, `assert_rouge`, `assert_ner_f1`, `assert_no_prompt_injection` | Text + security |
272
+ | **NLP Sentiment** | `assert_sentiment_positive`, `assert_no_sentiment_drift` | Sentiment analysis + drift |
273
+ | **Speech** | `assert_wer`, `assert_cer`, `assert_rtf`, `assert_accent_coverage` | Recognition + fairness |
274
+ | **CV** | `assert_iou`, `assert_map`, `assert_frame_accuracy`, `assert_temporal_consistency`, `assert_topk_accuracy` | Video analytics |
275
+ | **CV Tracking** | `assert_mota`, `assert_motp`, `assert_idf1` | Multi-object tracking (CLEAR-MOT) |
276
+ | **CV Face** | `assert_face_far` | False accept rate (NIST FRVT) |
277
+ | **Tabular** | `assert_feature_drift`, `assert_feature_importance_stable`, `assert_class_balance` | Feature validation |
278
+ | **Compliance** | EU AI Act report, OWASP LLM Top 10, FDA audit trail, compliance PDF export | Regulatory evidence |
279
+ | **Retrieval** | `assert_ndcg`, `assert_mrr`, `assert_recall_at_k`, `assert_map_at_k` | Ranking metrics (RAG) |
280
+ | **LLM-as-Judge** | `assert_llm_judge_score`, `assert_llm_judge_pairwise` | Vendor-neutral LLM eval |
281
+ | **Summarization** | `assert_summary_coverage`, `assert_summary_compression`, `assert_summary_faithfulness` | Summary quality |
282
+ | **Recommendation** | `assert_hit_rate`, `assert_diversity`, `assert_novelty`, `assert_coverage`, `assert_serendipity` | RecSys testing |
283
+ | **Long-Context LLM** | `assert_needle_in_haystack`, `assert_context_utilization`, `assert_no_lost_in_middle` | Long-context eval |
284
+ | **Composable Suite** | `MltkSuite`, `SuiteResult`, export to JSON/HTML/JUnit | Run without pytest |
285
+ | **Code Generation** | `assert_code_executes`, `assert_code_passes_tests`, `assert_no_code_vulnerabilities`, `assert_code_complexity` | LLM codegen testing |
286
+ | **Healthcare** | HIPAA compliance mapping, `assert_hipaa_coverage` | Regulated industry |
287
+ | **Finance** | SR 11-7 model risk, `assert_sr117_coverage` | Bank model governance |
288
+ | **Enterprise** | RBAC, audit log, custom compliance frameworks | SOC 2 + governance |
289
+ | **Observability** | `TestScheduler`, anomaly detection, impact analysis, Grafana dashboards | Production monitoring |
290
+ | **Testing Patterns** | `assert_matches_golden`, flaky detection, retry, test selection | Advanced test strategies |
291
+ | **Reports** | Visual diff, test history summarizer, bias report, model card | Analysis + reporting |
292
+ | **Integrations** | Jira, MLflow, GitHub App, W&B, DVC, Kubeflow, SageMaker, Slack, webhooks | Ecosystem connectors |
293
+
294
+ ## Installation
295
+
296
+ ```bash
297
+ # Core (data + model assertions)
298
+ pip install mltk
299
+
300
+ # With CLI
301
+ pip install mltk[cli]
302
+
303
+ # With HTML reports
304
+ pip install mltk[report]
305
+
306
+ # With server platform
307
+ pip install mltk[server]
308
+
309
+ # NER PII detection
310
+ pip install mltk[ner] # Presidio + spaCy NER
311
+
312
+ # Domain kits
313
+ pip install mltk[cv] # Computer Vision
314
+ pip install mltk[nlp] # NLP
315
+ pip install mltk[speech] # Speech Recognition
316
+ pip install mltk[contracts] # Data contracts (YAML)
317
+ pip install mltk[torch] # Gradient inspection
318
+ pip install mltk[llm] # LLM evaluation
319
+
320
+ # Integrations
321
+ pip install mltk[integrations] # Jira adapter
322
+ pip install mltk[mlflow] # MLflow logging
323
+ pip install mltk[aws] # AWS SageMaker/CloudWatch
324
+ pip install mltk[gcp] # GCP Vertex AI
325
+ pip install mltk[azure] # Azure ML monitoring
326
+ pip install mltk[pdf] # Compliance PDF export
327
+ pip install mltk[server] # Self-hosted server platform
328
+
329
+ # Everything
330
+ pip install mltk[all]
331
+ ```
332
+
333
+ ## CLI
334
+
335
+ ```bash
336
+ # Core
337
+ mltk version # Show version
338
+ mltk init # Scaffold config + tests
339
+ mltk scan data.csv # Quick data quality scan
340
+ mltk drift ref.csv cur.csv # Drift analysis
341
+ mltk score # ML Test Score
342
+ mltk doctor # Diagnose environment
343
+
344
+ # Test execution & reporting
345
+ mltk test tests.yaml # Run YAML-defined tests
346
+ mltk model-card results.json # Generate Google Model Card
347
+ mltk compliance results.json # EU AI Act compliance report
348
+ mltk fda-audit results.json # FDA device audit trail export
349
+ mltk compliance-pdf report.html # Export compliance report to PDF
350
+
351
+ # Data contracts
352
+ mltk contract init # Scaffold contract YAML
353
+ mltk contract validate data.csv # Validate against contract
354
+ mltk contract generate-tests # Generate pytest from contract
355
+
356
+ # Documentation
357
+ mltk docs serve # Serve docs locally (hot reload)
358
+ mltk docs build # Build static HTML docs
359
+ mltk docs open # Build, serve, and open in browser
360
+
361
+ # Test registry
362
+ mltk registry push my_fixtures # Save test files to registry
363
+ mltk registry pull my_fixtures # Restore from registry
364
+ mltk registry list # List saved collections
365
+
366
+ # Notifications
367
+ mltk notify slack --results-json r.json # Send results to Slack
368
+
369
+ # Server platform
370
+ mltk server # Start result-tracking server
371
+ mltk server-create-key --project myproj # Generate API key for server
372
+
373
+ # Interactive
374
+ mltk chat --results-json results.json # Q&A about test results
375
+ ```
376
+
377
+ ## pytest Plugin
378
+
379
+ Auto-registered on install. Provides ML-specific markers and `--mltk-report`:
380
+
381
+ ```bash
382
+ pytest -m ml_data # Run only data quality tests
383
+ pytest -m ml_model # Run only model quality tests
384
+ pytest -m "not ml_slow" # Skip long-running tests
385
+ pytest --mltk-report # Generate HTML report
386
+ pytest --mltk-export-json # Export results to JSON
387
+ ```
388
+
389
+ Markers: `ml_data`, `ml_model`, `ml_drift`, `ml_inference`, `ml_smoke`, `ml_slow`, `ml_gpu`, `ml_nondeterministic`
390
+
391
+ ## Rust Acceleration
392
+
393
+ Optional Rust backend for 10-100x speedup on drift detection (KS test, PSI). Falls back to scipy/numpy automatically.
394
+
395
+ ## Comparison
396
+
397
+ | Feature | Great Expectations | Deepchecks | Evidently | DeepEval | Giskard | Arize Phoenix | **mltk** |
398
+ |---|---|---|---|---|---|---|---|
399
+ | Data validation | Yes | Yes | Limited | No | Yes | No | **Yes** |
400
+ | Model testing | No | Yes | Limited | No | Yes (tabular) | No | **Yes** |
401
+ | Drift detection | No | Yes | Yes | No | No | No | **Yes (Rust)** |
402
+ | Streaming drift | No | No | No | No | No | No | **Yes (ADWIN/CUSUM)** |
403
+ | Bias/fairness | No | No | No | No | Yes | No | **Yes** |
404
+ | Inference testing | No | No | No | No | No | No | **Yes** |
405
+ | pytest native | No | No | No | Yes | Yes | No | **Yes** |
406
+ | CLI | Yes | No | No | Yes | Yes | Yes | **Yes** |
407
+ | Domain kits | No | Partial | No | No | No | No | **Yes** |
408
+ | ML Test Score | No | No | No | No | No | No | **Yes** |
409
+ | Rust acceleration | No | No | No | No | No | No | **Yes** |
410
+ | YAML test defs | No | No | No | No | No | No | **Yes** |
411
+ | Compliance frameworks | No | No | No | No | No | No | **Yes (8 frameworks)** |
412
+ | Training bug detection | No | No | No | No | No | No | **Yes** |
413
+ | Conformal prediction | No | No | No | No | No | No | **Yes** |
414
+ | Composable TestSuite | No | No | No | No | No | No | **Yes** |
415
+ | Code Generation | No | No | No | No | No | No | **Yes (4 assertions)** |
416
+ | LLM evaluation | No | Yes (LLM-only) | No | **Yes (50+ metrics)** | Yes (OWASP scanner) | **Yes (tracing)** | **Yes (232 assertions)** |
417
+ | Behavioral consistency | No | No | No | No | No | No | **Yes (7 assertions)** |
418
+ | NER PII detection | No | No | No | No | No | No | **Yes (4 methods)** |
419
+ | Agent trace testing | No | No | No | Yes (basic) | No | Yes (tracing) | **Yes (9 assertions)** |
420
+ | Multi-agent testing | No | No | No | No | No | No | **Yes** |
421
+ | Synthetic data validation | No | No | No | No | No | No | **Yes (4 assertions)** |
422
+ | Safety taxonomy | No | No | No | Yes (red-teaming) | Yes (OWASP) | No | **Yes (per-category)** |
423
+ | LLM observability | No | No | No | No | No | **Yes** | No |
424
+ | OWASP LLM scanning | No | No | No | No | **Yes** | No | **Yes** |
425
+ | License | Elastic | AGPL | Apache 2.0 | Apache 2.0 | Apache 2.0 | Elastic | **Elastic 2.0** |
426
+ | Core deps | Heavy | Heavy | Medium | Heavy (LLM) | Heavy | Heavy | **2 (numpy, pandas)** |
427
+
428
+ ## Documentation
429
+
430
+ - [Getting Started](docs/getting-started.md)
431
+ - [Configuration](docs/configuration.md)
432
+ - [API Reference](docs/api/)
433
+ - [Examples](examples/)
434
+
435
+ ## License
436
+
437
+ [Elastic License 2.0](LICENSE) — free for internal use; commercial licensing
438
+ available at lior1cc@gmail.com. See [LICENSE-COMMERCIAL](LICENSE-COMMERCIAL).
439
+