evalsuite-python 0.4.1__tar.gz → 0.5.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (108) hide show
  1. {evalsuite_python-0.4.1 → evalsuite_python-0.5.0}/CHANGELOG.md +39 -0
  2. {evalsuite_python-0.4.1 → evalsuite_python-0.5.0}/PKG-INFO +58 -8
  3. {evalsuite_python-0.4.1 → evalsuite_python-0.5.0}/README.md +56 -7
  4. {evalsuite_python-0.4.1 → evalsuite_python-0.5.0}/pyproject.toml +1 -0
  5. {evalsuite_python-0.4.1 → evalsuite_python-0.5.0}/src/evalsuite/__init__.py +5 -1
  6. {evalsuite_python-0.4.1 → evalsuite_python-0.5.0}/src/evalsuite/_bench_metrics.py +691 -2
  7. {evalsuite_python-0.4.1 → evalsuite_python-0.5.0}/src/evalsuite/benchmarks.py +13 -0
  8. evalsuite_python-0.5.0/src/evalsuite/llmsys/__init__.py +189 -0
  9. evalsuite_python-0.5.0/src/evalsuite/llmsys/_common.py +131 -0
  10. evalsuite_python-0.5.0/src/evalsuite/llmsys/agents.py +384 -0
  11. evalsuite_python-0.5.0/src/evalsuite/llmsys/code.py +914 -0
  12. evalsuite_python-0.5.0/src/evalsuite/llmsys/efficiency.py +347 -0
  13. evalsuite_python-0.5.0/src/evalsuite/llmsys/longcontext.py +361 -0
  14. evalsuite_python-0.5.0/src/evalsuite/llmsys/multilingual.py +327 -0
  15. evalsuite_python-0.5.0/src/evalsuite/llmsys/robustness.py +504 -0
  16. evalsuite_python-0.5.0/src/evalsuite/llmsys/safety.py +509 -0
  17. evalsuite_python-0.5.0/src/evalsuite/llmsys/uncertainty.py +225 -0
  18. {evalsuite_python-0.4.1 → evalsuite_python-0.5.0}/src/evalsuite/text/__init__.py +2 -0
  19. evalsuite_python-0.5.0/src/evalsuite/text/spice.py +162 -0
  20. {evalsuite_python-0.4.1 → evalsuite_python-0.5.0}/src/evalsuite/version.py +1 -1
  21. {evalsuite_python-0.4.1 → evalsuite_python-0.5.0}/tests/integration/test_readme_examples.py +2 -0
  22. evalsuite_python-0.5.0/tests/llmsys/test_code_longcontext_efficiency.py +340 -0
  23. evalsuite_python-0.5.0/tests/llmsys/test_edges.py +88 -0
  24. evalsuite_python-0.5.0/tests/llmsys/test_safety_robustness.py +265 -0
  25. evalsuite_python-0.5.0/tests/llmsys/test_uncertainty_agents_multilingual.py +195 -0
  26. evalsuite_python-0.5.0/tests/vision/__init__.py +0 -0
  27. {evalsuite_python-0.4.1 → evalsuite_python-0.5.0}/.gitignore +0 -0
  28. {evalsuite_python-0.4.1 → evalsuite_python-0.5.0}/CONTRIBUTING.md +0 -0
  29. {evalsuite_python-0.4.1 → evalsuite_python-0.5.0}/LICENSE +0 -0
  30. {evalsuite_python-0.4.1 → evalsuite_python-0.5.0}/src/evalsuite/__main__.py +0 -0
  31. {evalsuite_python-0.4.1 → evalsuite_python-0.5.0}/src/evalsuite/api.py +0 -0
  32. {evalsuite_python-0.4.1 → evalsuite_python-0.5.0}/src/evalsuite/calibration.py +0 -0
  33. {evalsuite_python-0.4.1 → evalsuite_python-0.5.0}/src/evalsuite/classification/__init__.py +0 -0
  34. {evalsuite_python-0.4.1 → evalsuite_python-0.5.0}/src/evalsuite/classification/_common.py +0 -0
  35. {evalsuite_python-0.4.1 → evalsuite_python-0.5.0}/src/evalsuite/classification/metrics.py +0 -0
  36. {evalsuite_python-0.4.1 → evalsuite_python-0.5.0}/src/evalsuite/cli/__init__.py +0 -0
  37. {evalsuite_python-0.4.1 → evalsuite_python-0.5.0}/src/evalsuite/cli/main.py +0 -0
  38. {evalsuite_python-0.4.1 → evalsuite_python-0.5.0}/src/evalsuite/clinical/__init__.py +0 -0
  39. {evalsuite_python-0.4.1 → evalsuite_python-0.5.0}/src/evalsuite/clinical/metrics.py +0 -0
  40. {evalsuite_python-0.4.1 → evalsuite_python-0.5.0}/src/evalsuite/clinical/report.py +0 -0
  41. {evalsuite_python-0.4.1 → evalsuite_python-0.5.0}/src/evalsuite/core/__init__.py +0 -0
  42. {evalsuite_python-0.4.1 → evalsuite_python-0.5.0}/src/evalsuite/core/context.py +0 -0
  43. {evalsuite_python-0.4.1 → evalsuite_python-0.5.0}/src/evalsuite/core/exceptions.py +0 -0
  44. {evalsuite_python-0.4.1 → evalsuite_python-0.5.0}/src/evalsuite/core/export.py +0 -0
  45. {evalsuite_python-0.4.1 → evalsuite_python-0.5.0}/src/evalsuite/core/registry.py +0 -0
  46. {evalsuite_python-0.4.1 → evalsuite_python-0.5.0}/src/evalsuite/core/result.py +0 -0
  47. {evalsuite_python-0.4.1 → evalsuite_python-0.5.0}/src/evalsuite/core/types.py +0 -0
  48. {evalsuite_python-0.4.1 → evalsuite_python-0.5.0}/src/evalsuite/core/validation.py +0 -0
  49. {evalsuite_python-0.4.1 → evalsuite_python-0.5.0}/src/evalsuite/plot.py +0 -0
  50. {evalsuite_python-0.4.1 → evalsuite_python-0.5.0}/src/evalsuite/py.typed +0 -0
  51. {evalsuite_python-0.4.1 → evalsuite_python-0.5.0}/src/evalsuite/regression/__init__.py +0 -0
  52. {evalsuite_python-0.4.1 → evalsuite_python-0.5.0}/src/evalsuite/regression/metrics.py +0 -0
  53. {evalsuite_python-0.4.1 → evalsuite_python-0.5.0}/src/evalsuite/reporting.py +0 -0
  54. {evalsuite_python-0.4.1 → evalsuite_python-0.5.0}/src/evalsuite/stats/__init__.py +0 -0
  55. {evalsuite_python-0.4.1 → evalsuite_python-0.5.0}/src/evalsuite/stats/_resolve.py +0 -0
  56. {evalsuite_python-0.4.1 → evalsuite_python-0.5.0}/src/evalsuite/stats/compare.py +0 -0
  57. {evalsuite_python-0.4.1 → evalsuite_python-0.5.0}/src/evalsuite/stats/effect.py +0 -0
  58. {evalsuite_python-0.4.1 → evalsuite_python-0.5.0}/src/evalsuite/stats/hypothesis.py +0 -0
  59. {evalsuite_python-0.4.1 → evalsuite_python-0.5.0}/src/evalsuite/stats/intervals.py +0 -0
  60. {evalsuite_python-0.4.1 → evalsuite_python-0.5.0}/src/evalsuite/stats/paired.py +0 -0
  61. {evalsuite_python-0.4.1 → evalsuite_python-0.5.0}/src/evalsuite/stats/results.py +0 -0
  62. {evalsuite_python-0.4.1 → evalsuite_python-0.5.0}/src/evalsuite/text/_common.py +0 -0
  63. {evalsuite_python-0.4.1 → evalsuite_python-0.5.0}/src/evalsuite/text/factuality.py +0 -0
  64. {evalsuite_python-0.4.1 → evalsuite_python-0.5.0}/src/evalsuite/text/generation.py +0 -0
  65. {evalsuite_python-0.4.1 → evalsuite_python-0.5.0}/src/evalsuite/text/judge.py +0 -0
  66. {evalsuite_python-0.4.1 → evalsuite_python-0.5.0}/src/evalsuite/text/qa.py +0 -0
  67. {evalsuite_python-0.4.1 → evalsuite_python-0.5.0}/src/evalsuite/text/rag.py +0 -0
  68. {evalsuite_python-0.4.1 → evalsuite_python-0.5.0}/src/evalsuite/text/reasoning.py +0 -0
  69. {evalsuite_python-0.4.1 → evalsuite_python-0.5.0}/src/evalsuite/text/report.py +0 -0
  70. {evalsuite_python-0.4.1 → evalsuite_python-0.5.0}/src/evalsuite/text/retrieval.py +0 -0
  71. {evalsuite_python-0.4.1 → evalsuite_python-0.5.0}/src/evalsuite/text/semantic.py +0 -0
  72. {evalsuite_python-0.4.1 → evalsuite_python-0.5.0}/src/evalsuite/text/structured.py +0 -0
  73. {evalsuite_python-0.4.1 → evalsuite_python-0.5.0}/src/evalsuite/vision/__init__.py +0 -0
  74. {evalsuite_python-0.4.1 → evalsuite_python-0.5.0}/src/evalsuite/vision/detection.py +0 -0
  75. {evalsuite_python-0.4.1 → evalsuite_python-0.5.0}/src/evalsuite/vision/segmentation.py +0 -0
  76. {evalsuite_python-0.4.1 → evalsuite_python-0.5.0}/tests/__init__.py +0 -0
  77. {evalsuite_python-0.4.1 → evalsuite_python-0.5.0}/tests/classification/__init__.py +0 -0
  78. {evalsuite_python-0.4.1 → evalsuite_python-0.5.0}/tests/classification/test_against_sklearn.py +0 -0
  79. {evalsuite_python-0.4.1 → evalsuite_python-0.5.0}/tests/clinical/__init__.py +0 -0
  80. {evalsuite_python-0.4.1 → evalsuite_python-0.5.0}/tests/clinical/test_outputs.py +0 -0
  81. {evalsuite_python-0.4.1 → evalsuite_python-0.5.0}/tests/clinical/test_v020.py +0 -0
  82. {evalsuite_python-0.4.1 → evalsuite_python-0.5.0}/tests/conftest.py +0 -0
  83. {evalsuite_python-0.4.1 → evalsuite_python-0.5.0}/tests/integration/__init__.py +0 -0
  84. {evalsuite_python-0.4.1 → evalsuite_python-0.5.0}/tests/integration/test_qa.py +0 -0
  85. {evalsuite_python-0.4.1 → evalsuite_python-0.5.0}/tests/integration/test_repo_hygiene.py +0 -0
  86. {evalsuite_python-0.4.1/tests/output → evalsuite_python-0.5.0/tests/llmsys}/__init__.py +0 -0
  87. {evalsuite_python-0.4.1/tests/regression → evalsuite_python-0.5.0/tests/output}/__init__.py +0 -0
  88. {evalsuite_python-0.4.1 → evalsuite_python-0.5.0}/tests/output/test_benchmarks.py +0 -0
  89. {evalsuite_python-0.4.1 → evalsuite_python-0.5.0}/tests/output/test_cli.py +0 -0
  90. {evalsuite_python-0.4.1 → evalsuite_python-0.5.0}/tests/output/test_plot.py +0 -0
  91. {evalsuite_python-0.4.1 → evalsuite_python-0.5.0}/tests/output/test_reporting.py +0 -0
  92. {evalsuite_python-0.4.1/tests/stats → evalsuite_python-0.5.0/tests/regression}/__init__.py +0 -0
  93. {evalsuite_python-0.4.1 → evalsuite_python-0.5.0}/tests/regression/test_against_sklearn.py +0 -0
  94. {evalsuite_python-0.4.1/tests/text → evalsuite_python-0.5.0/tests/stats}/__init__.py +0 -0
  95. {evalsuite_python-0.4.1 → evalsuite_python-0.5.0}/tests/stats/test_branches.py +0 -0
  96. {evalsuite_python-0.4.1 → evalsuite_python-0.5.0}/tests/stats/test_compare.py +0 -0
  97. {evalsuite_python-0.4.1 → evalsuite_python-0.5.0}/tests/stats/test_reference.py +0 -0
  98. {evalsuite_python-0.4.1/tests/unit → evalsuite_python-0.5.0/tests/text}/__init__.py +0 -0
  99. {evalsuite_python-0.4.1 → evalsuite_python-0.5.0}/tests/text/test_against_references.py +0 -0
  100. {evalsuite_python-0.4.1 → evalsuite_python-0.5.0}/tests/text/test_text_edges.py +0 -0
  101. {evalsuite_python-0.4.1 → evalsuite_python-0.5.0}/tests/text/test_v040.py +0 -0
  102. {evalsuite_python-0.4.1/tests/vision → evalsuite_python-0.5.0/tests/unit}/__init__.py +0 -0
  103. {evalsuite_python-0.4.1 → evalsuite_python-0.5.0}/tests/unit/test_core.py +0 -0
  104. {evalsuite_python-0.4.1 → evalsuite_python-0.5.0}/tests/unit/test_edges.py +0 -0
  105. {evalsuite_python-0.4.1 → evalsuite_python-0.5.0}/tests/vision/test_detection.py +0 -0
  106. {evalsuite_python-0.4.1 → evalsuite_python-0.5.0}/tests/vision/test_edges.py +0 -0
  107. {evalsuite_python-0.4.1 → evalsuite_python-0.5.0}/tests/vision/test_outputs.py +0 -0
  108. {evalsuite_python-0.4.1 → evalsuite_python-0.5.0}/tests/vision/test_segmentation.py +0 -0
@@ -6,6 +6,45 @@ All notable changes to this project are documented here. The format follows
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.5.0] - 2026-10-10
10
+
11
+ LLM systems (the v0.5.0 roadmap: 8 areas, 85 items) and SPICE. No existing API changed.
12
+
13
+ ### Added
14
+ - `es.llmsys` (all functions also at top level): 77 new registered metrics. Items on the roadmap that an
15
+ existing function already covers (ECE, MCE, Brier, log loss, abstention, pass@k, BLEU/chrF/COMET,
16
+ ROUGE-L/BERTScore, tool-call precision/recall, Recall@k/MRR) are documented as such.
17
+ - Safety: harmful-response / unsafe-compliance, refusal and appropriate refusal, over-refusal, jailbreak /
18
+ prompt-injection attack success, red-team success@k, expected maximum toxicity and toxicity probability
19
+ (RealToxicityPrompts) with per-attribute scores, CrowS-Pairs stereotype preference, WEAT effect size with
20
+ a permutation test, PII leakage (built-in e-mail, phone, Luhn-checked card, IPv4, SSN detectors plus
21
+ protected strings; `detect_pii`), memorization exposure (Carlini et al.), policy violations.
22
+ - Robustness: adversarial and typo-noise robustness (`add_typos`), OOD accuracy, distribution-shift drop
23
+ with a Welch interval (= SciPy), paraphrase consistency, counterfactual invariance violations, response
24
+ stability, contradiction rate, failure / timeout / error rate, recovery rate, prompt sensitivity, accuracy
25
+ slope against context length.
26
+ - Uncertainty: adaptive calibration error, risk-coverage curve, AURC and E-AURC, selective risk, risk at
27
+ coverage, coverage at risk, confidence AUROC (= scikit-learn).
28
+ - Agents: task completion and progress, invalid tool calls checked against each tool's JSON Schema,
29
+ execution failures, tool-use efficiency, steps per task, plan adherence (LCS), joint goal and slot
30
+ accuracy, tool-failure recovery, repeated-call and loop rates, human intervention, cost per success.
31
+ - Multilingual: language-ID accuracy and macro-F1, bitext mining (cosine or margin), language parity,
32
+ code-switching robustness, z-normalised direct assessment, cultural appropriateness, language consistency,
33
+ cross-lingual consistency.
34
+ - Code: unit-test pass rate, syntax validity (parsed, never run), static-analysis violations per KLOC,
35
+ execution success, test coverage, patch acceptance and bug reproduction, SWE-bench resolved rate,
36
+ security findings by severity, EffiBench NET / NMU, CodeBLEU (n-gram terms identical to the `codebleu`
37
+ package; syntax and data-flow terms from Python's `ast`), cyclomatic complexity and maintainability index
38
+ (identical to radon on every module of EvalSuite and radon).
39
+ - Long context: accuracy by length with effective length (RULER), needle-in-a-haystack grid, accuracy by
40
+ position, lost-in-the-middle gap, context utilization, summary coverage and factual consistency,
41
+ compression ratio, citation coverage, cross-document consistency.
42
+ - Efficiency: TTFT, TPOT, latency percentiles, throughput, token usage, cost (with cached-token pricing),
43
+ resource utilization, energy per request, requests per second, availability and error budget.
44
+ - `es.spice`: SPICE from scene-graph tuples or any `parser`, with exact, WordNet or custom synonym matching
45
+ and object / attribute / relation F-scores. Runs without Java.
46
+ - Benchmarks: `suite="metrics"` covers all 225 metrics and statistics functions; new "LLM systems" group.
47
+
9
48
  ## [0.4.1] - 2026-10-09
10
49
 
11
50
  Benchmarks for every metric. No API changed.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: evalsuite-python
3
- Version: 0.4.1
3
+ Version: 0.5.0
4
4
  Summary: A unified Python framework for machine-learning, clinical, statistical, segmentation, object-detection, uncertainty, and model evaluation.
5
5
  Project-URL: Homepage, https://evalsuite-nine.vercel.app
6
6
  Project-URL: Documentation, https://evalsuite-nine.vercel.app/docs
@@ -55,6 +55,7 @@ Requires-Dist: pycocoevalcap>=1.2; extra == 'dev'
55
55
  Requires-Dist: pycocotools>=2.0.7; extra == 'dev'
56
56
  Requires-Dist: pytest-cov>=4; extra == 'dev'
57
57
  Requires-Dist: pytest>=7; extra == 'dev'
58
+ Requires-Dist: radon>=6; extra == 'dev'
58
59
  Requires-Dist: ranx>=0.3.19; (python_version < '3.14') and extra == 'dev'
59
60
  Requires-Dist: rouge-score>=0.1.2; extra == 'dev'
60
61
  Requires-Dist: ruff>=0.6; extra == 'dev'
@@ -82,9 +83,9 @@ Description-Content-Type: text/markdown
82
83
  EvalSuite brings classification, regression, clinical, statistical, segmentation and object-detection
83
84
  evaluation into one consistent, validated, documented framework.
84
85
 
85
- > **Status: stable (0.4.1).** Every item on the 0.1.0, 0.2.0, 0.3.0 and 0.4.0 roadmaps is implemented and verified
86
- > (except SPICE, which needs a Java scene-graph parser).
87
- > **LLM evaluation is available from 0.4.0**; LLM systems, safety and operations are planned for 0.5.0.
86
+ > **Status: stable (0.5.0).** Every item on the 0.1.0–0.5.0 roadmaps is implemented and verified, including SPICE.
87
+ > **LLM systems arrive in 0.5.0**: safety, robustness, calibration and uncertainty, agents and tool use,
88
+ > multilingual, code generation, long context and summarization, and inference efficiency and cost.
88
89
 
89
90
  ## Installation
90
91
 
@@ -254,6 +255,32 @@ es.json_schema_compliance(outputs, schema) # also tool_call_f1, instruction_com
254
255
  es.pass_at_k(n_samples, n_correct, k=10) # also benchmark_accuracy(..., style="gsm8k")
255
256
  es.compare(references, {"a": preds_a, "b": preds_b}, metrics=["bleu", "rouge_l"]) # paired over examples
256
257
  es.plot.ratings(comparisons) # Bradley–Terry leaderboard with intervals; also win_matrix, text_scores
258
+ es.spice(reference_tuples, candidate_tuples) # scene-graph F-score; parser= for captions, synonyms="wordnet"
259
+ ```
260
+
261
+ ## LLM systems
262
+
263
+ Safety, robustness, uncertainty, agents, multilingual, code, long context and serving cost. The verdicts
264
+ these take (harmful or not, test passed or not, confidence) come from your own judge, classifier or sandbox;
265
+ EvalSuite turns them into rates with Wilson intervals and breakdowns. PII detection, CodeBLEU, cyclomatic
266
+ complexity and the maintainability index (identical to radon) are computed from the text itself, and
267
+ EvalSuite never executes generated code.
268
+
269
+ ```python
270
+ import evalsuite as es
271
+
272
+ es.harmful_response_rate([True, False, False, True], harmful_prompt=[True, True, False, True])
273
+ es.over_refusal_rate(refused=[True, False, True], should_refuse=[True, False, False])
274
+ es.pii_leakage_rate(["mail me at a@b.io", "nothing here"]) # e-mail, phone, Luhn-checked cards, IPs
275
+ es.paraphrase_consistency([["Paris", "paris"], ["4", "5", "4"]])
276
+ es.aurc(correct=[True, True, False, True], confidence=[0.9, 0.8, 0.7, 0.4]) # also selective_risk
277
+ es.plan_adherence(plans=[["search", "read", "answer"]], executed=[["search", "answer"]])
278
+ es.language_parity({"en": [1, 1, 0, 1], "sw": [1, 0, 0, 1]})
279
+ es.codebleu(["def add(a, b):\n return a + b"], ["def add(x, y):\n return x + y"])
280
+ es.code_complexity(["def f(x):\n return 1 if x else 0"]) # cyclomatic complexity + maintainability
281
+ es.needle_in_haystack(correct=[1, 0, 1, 1], context_lengths=[4000, 4000, 8000, 8000], depths=[0, 0.5, 0, 0.5])
282
+ es.time_to_first_token(request_times=[0.0, 1.0], first_token_times=[0.21, 1.35])
283
+ es.inference_cost([1200, 800], [300, 150], input_price=3.0, output_price=15.0) # prices per 1M tokens
257
284
  ```
258
285
 
259
286
  ## Classification report
@@ -343,10 +370,10 @@ alphabetical order:
343
370
  | text: METEOR, exact and stem matches (10000 sentences) | NLTK | 488.1 | 626.7 | **1.3×** |
344
371
  | text: ROUGE-1, ROUGE-2, ROUGE-L (10000 sentences) | rouge-score | 1290.1 | 1095.6 | 0.85× |
345
372
 
346
- **Every metric is benchmarked too** (`evalsuite benchmark --suite metrics`): all 147 registered metrics and
347
- statistics functions at 10,000 and 100,000 samples. 79 are compared with a reference library, 49 with an
348
- independent textbook formula and 19 (learned, judge-dependent or randomised) are timed alone; **all 128
349
- comparisons agree**, and against the libraries the geometric-mean speed-up is **2.76×** (123 of 158
373
+ **Every metric is benchmarked too** (`evalsuite benchmark --suite metrics`): all 225 registered metrics and
374
+ statistics functions at 10,000 and 100,000 samples. 86 are compared with a reference library, 118 with an
375
+ independent textbook formula and 21 (learned, judge-dependent or randomised) are timed alone; **all 204
376
+ comparisons agree**, and against the libraries the geometric-mean speed-up is **2.65×** (137 of 172
350
377
  measurements faster). Per-metric table in BENCHMARKS.md.
351
378
 
352
379
  `evaluate()` validates inputs once and builds the confusion matrix once for all metrics, which is where most
@@ -387,6 +414,29 @@ object size, AP per class with COCO or VOC interpolation, precision-recall curve
387
414
  MSLE, RMSLE, median absolute error, explained variance, max error, mean bias error, quantile (pinball)
388
415
  loss, Huber loss, relative absolute error, relative squared error.
389
416
 
417
+ **LLM evaluation** (0.4.0): BLEU, sentence BLEU, chrF/chrF++, TER, ROUGE-1/2/L/Lsum, METEOR, CIDEr-D, SPICE,
418
+ perplexity, cross-entropy, Distinct-n, Self-BLEU, MAUVE, BERTScore, embedding similarity, MoverScore, learned
419
+ metrics via `model_score`; faithfulness, hallucination rate, groundedness, citation precision/recall, claim
420
+ verification, knowledge consistency, answer correctness/relevance, abstention, exact match, token F1; win
421
+ rate, Bradley–Terry, Elo, Krippendorff's alpha, Fleiss' kappa, judge agreement and biases, rubric scores;
422
+ pass@k, majority vote, benchmark accuracy; Precision/Recall/Hit rate@k, MRR, MAP, NDCG, context precision,
423
+ recall and relevance; JSON / JSON Schema / XML validity, required fields, tool calls, instruction following.
424
+
425
+ **LLM systems** (0.5.0): harmful-response, refusal, over-refusal, attack-success and red-team success rates,
426
+ expected maximum toxicity, CrowS-Pairs stereotype preference, WEAT, PII leakage, memorization exposure,
427
+ policy violations; adversarial, typo-noise, OOD and code-switching robustness, distribution-shift drop,
428
+ paraphrase / counterfactual / cross-lingual consistency, response stability, contradiction rate, failure and
429
+ recovery rates, prompt sensitivity, truncation sensitivity; adaptive calibration error, risk-coverage curve,
430
+ AURC and E-AURC, selective risk, risk at coverage, coverage at risk, confidence AUROC; task completion,
431
+ invalid tool calls, tool-use efficiency, steps per task, plan adherence, state tracking, tool-failure
432
+ recovery, loop rate, human intervention, cost per task; language ID, bitext mining, language parity, direct
433
+ assessment, cultural appropriateness, language consistency; unit-test pass rate, syntax validity, static
434
+ analysis and security findings, execution success, test coverage, patch acceptance, SWE-bench resolved rate,
435
+ CodeBLEU, cyclomatic complexity and maintainability index, runtime efficiency; long-context accuracy by
436
+ length, needle-in-a-haystack grid, position accuracy, lost-in-the-middle gap, context utilization, summary
437
+ coverage, compression ratio, citation coverage, cross-document consistency; TTFT, TPOT, latency percentiles,
438
+ throughput, token usage, cost, resource utilization, energy per request, requests per second, availability.
439
+
390
440
  ## Conventions
391
441
 
392
442
  - `average="auto"` resolves to `"binary"` for binary targets and `"macro"` otherwise; the resolved value
@@ -10,9 +10,9 @@
10
10
  EvalSuite brings classification, regression, clinical, statistical, segmentation and object-detection
11
11
  evaluation into one consistent, validated, documented framework.
12
12
 
13
- > **Status: stable (0.4.1).** Every item on the 0.1.0, 0.2.0, 0.3.0 and 0.4.0 roadmaps is implemented and verified
14
- > (except SPICE, which needs a Java scene-graph parser).
15
- > **LLM evaluation is available from 0.4.0**; LLM systems, safety and operations are planned for 0.5.0.
13
+ > **Status: stable (0.5.0).** Every item on the 0.1.0–0.5.0 roadmaps is implemented and verified, including SPICE.
14
+ > **LLM systems arrive in 0.5.0**: safety, robustness, calibration and uncertainty, agents and tool use,
15
+ > multilingual, code generation, long context and summarization, and inference efficiency and cost.
16
16
 
17
17
  ## Installation
18
18
 
@@ -182,6 +182,32 @@ es.json_schema_compliance(outputs, schema) # also tool_call_f1, instruction_com
182
182
  es.pass_at_k(n_samples, n_correct, k=10) # also benchmark_accuracy(..., style="gsm8k")
183
183
  es.compare(references, {"a": preds_a, "b": preds_b}, metrics=["bleu", "rouge_l"]) # paired over examples
184
184
  es.plot.ratings(comparisons) # Bradley–Terry leaderboard with intervals; also win_matrix, text_scores
185
+ es.spice(reference_tuples, candidate_tuples) # scene-graph F-score; parser= for captions, synonyms="wordnet"
186
+ ```
187
+
188
+ ## LLM systems
189
+
190
+ Safety, robustness, uncertainty, agents, multilingual, code, long context and serving cost. The verdicts
191
+ these take (harmful or not, test passed or not, confidence) come from your own judge, classifier or sandbox;
192
+ EvalSuite turns them into rates with Wilson intervals and breakdowns. PII detection, CodeBLEU, cyclomatic
193
+ complexity and the maintainability index (identical to radon) are computed from the text itself, and
194
+ EvalSuite never executes generated code.
195
+
196
+ ```python
197
+ import evalsuite as es
198
+
199
+ es.harmful_response_rate([True, False, False, True], harmful_prompt=[True, True, False, True])
200
+ es.over_refusal_rate(refused=[True, False, True], should_refuse=[True, False, False])
201
+ es.pii_leakage_rate(["mail me at a@b.io", "nothing here"]) # e-mail, phone, Luhn-checked cards, IPs
202
+ es.paraphrase_consistency([["Paris", "paris"], ["4", "5", "4"]])
203
+ es.aurc(correct=[True, True, False, True], confidence=[0.9, 0.8, 0.7, 0.4]) # also selective_risk
204
+ es.plan_adherence(plans=[["search", "read", "answer"]], executed=[["search", "answer"]])
205
+ es.language_parity({"en": [1, 1, 0, 1], "sw": [1, 0, 0, 1]})
206
+ es.codebleu(["def add(a, b):\n return a + b"], ["def add(x, y):\n return x + y"])
207
+ es.code_complexity(["def f(x):\n return 1 if x else 0"]) # cyclomatic complexity + maintainability
208
+ es.needle_in_haystack(correct=[1, 0, 1, 1], context_lengths=[4000, 4000, 8000, 8000], depths=[0, 0.5, 0, 0.5])
209
+ es.time_to_first_token(request_times=[0.0, 1.0], first_token_times=[0.21, 1.35])
210
+ es.inference_cost([1200, 800], [300, 150], input_price=3.0, output_price=15.0) # prices per 1M tokens
185
211
  ```
186
212
 
187
213
  ## Classification report
@@ -271,10 +297,10 @@ alphabetical order:
271
297
  | text: METEOR, exact and stem matches (10000 sentences) | NLTK | 488.1 | 626.7 | **1.3×** |
272
298
  | text: ROUGE-1, ROUGE-2, ROUGE-L (10000 sentences) | rouge-score | 1290.1 | 1095.6 | 0.85× |
273
299
 
274
- **Every metric is benchmarked too** (`evalsuite benchmark --suite metrics`): all 147 registered metrics and
275
- statistics functions at 10,000 and 100,000 samples. 79 are compared with a reference library, 49 with an
276
- independent textbook formula and 19 (learned, judge-dependent or randomised) are timed alone; **all 128
277
- comparisons agree**, and against the libraries the geometric-mean speed-up is **2.76×** (123 of 158
300
+ **Every metric is benchmarked too** (`evalsuite benchmark --suite metrics`): all 225 registered metrics and
301
+ statistics functions at 10,000 and 100,000 samples. 86 are compared with a reference library, 118 with an
302
+ independent textbook formula and 21 (learned, judge-dependent or randomised) are timed alone; **all 204
303
+ comparisons agree**, and against the libraries the geometric-mean speed-up is **2.65×** (137 of 172
278
304
  measurements faster). Per-metric table in BENCHMARKS.md.
279
305
 
280
306
  `evaluate()` validates inputs once and builds the confusion matrix once for all metrics, which is where most
@@ -315,6 +341,29 @@ object size, AP per class with COCO or VOC interpolation, precision-recall curve
315
341
  MSLE, RMSLE, median absolute error, explained variance, max error, mean bias error, quantile (pinball)
316
342
  loss, Huber loss, relative absolute error, relative squared error.
317
343
 
344
+ **LLM evaluation** (0.4.0): BLEU, sentence BLEU, chrF/chrF++, TER, ROUGE-1/2/L/Lsum, METEOR, CIDEr-D, SPICE,
345
+ perplexity, cross-entropy, Distinct-n, Self-BLEU, MAUVE, BERTScore, embedding similarity, MoverScore, learned
346
+ metrics via `model_score`; faithfulness, hallucination rate, groundedness, citation precision/recall, claim
347
+ verification, knowledge consistency, answer correctness/relevance, abstention, exact match, token F1; win
348
+ rate, Bradley–Terry, Elo, Krippendorff's alpha, Fleiss' kappa, judge agreement and biases, rubric scores;
349
+ pass@k, majority vote, benchmark accuracy; Precision/Recall/Hit rate@k, MRR, MAP, NDCG, context precision,
350
+ recall and relevance; JSON / JSON Schema / XML validity, required fields, tool calls, instruction following.
351
+
352
+ **LLM systems** (0.5.0): harmful-response, refusal, over-refusal, attack-success and red-team success rates,
353
+ expected maximum toxicity, CrowS-Pairs stereotype preference, WEAT, PII leakage, memorization exposure,
354
+ policy violations; adversarial, typo-noise, OOD and code-switching robustness, distribution-shift drop,
355
+ paraphrase / counterfactual / cross-lingual consistency, response stability, contradiction rate, failure and
356
+ recovery rates, prompt sensitivity, truncation sensitivity; adaptive calibration error, risk-coverage curve,
357
+ AURC and E-AURC, selective risk, risk at coverage, coverage at risk, confidence AUROC; task completion,
358
+ invalid tool calls, tool-use efficiency, steps per task, plan adherence, state tracking, tool-failure
359
+ recovery, loop rate, human intervention, cost per task; language ID, bitext mining, language parity, direct
360
+ assessment, cultural appropriateness, language consistency; unit-test pass rate, syntax validity, static
361
+ analysis and security findings, execution success, test coverage, patch acceptance, SWE-bench resolved rate,
362
+ CodeBLEU, cyclomatic complexity and maintainability index, runtime efficiency; long-context accuracy by
363
+ length, needle-in-a-haystack grid, position accuracy, lost-in-the-middle gap, context utilization, summary
364
+ coverage, compression ratio, citation coverage, cross-document consistency; TTFT, TPOT, latency percentiles,
365
+ throughput, token usage, cost, resource utilization, energy per request, requests per second, availability.
366
+
318
367
  ## Conventions
319
368
 
320
369
  - `average="auto"` resolves to `"binary"` for binary targets and `"macro"` otherwise; the resolved value
@@ -56,6 +56,7 @@ dev = [
56
56
  "jsonschema>=4.18",
57
57
  "choix>=0.3",
58
58
  "krippendorff>=0.6",
59
+ "radon>=6",
59
60
  "pot>=0.9; python_version < '3.14'",
60
61
  "ranx>=0.3.19; python_version < '3.14'",
61
62
  "ruff>=0.6",
@@ -5,7 +5,7 @@
5
5
  >>> print(result.summary()) # doctest: +SKIP
6
6
  """
7
7
 
8
- from . import calibration, classification, clinical, plot, regression, stats, text, vision
8
+ from . import calibration, classification, clinical, llmsys, plot, regression, stats, text, vision
9
9
  from .api import evaluate
10
10
  from .calibration import (
11
11
  CalibrationReport,
@@ -63,6 +63,8 @@ from .core.exceptions import (
63
63
  )
64
64
  from .core.registry import MetricInfo, list_metrics, metric_info
65
65
  from .core.result import EvaluationResult, MetricResult
66
+ from .llmsys import * # noqa: F403 (v0.5.0 LLM-systems functions, listed in llmsys.__all__)
67
+ from .llmsys import __all__ as _llmsys_all
66
68
  from .regression import (
67
69
  adjusted_r2,
68
70
  explained_variance,
@@ -137,6 +139,7 @@ from .vision import (
137
139
 
138
140
  __all__ = [
139
141
  "text",
142
+ "llmsys",
140
143
  "SegmentationReport",
141
144
  "segmentation_report",
142
145
  "detection_pr_curve",
@@ -262,3 +265,4 @@ __all__ = [
262
265
  "top_k_accuracy",
263
266
  ]
264
267
  __all__ += list(_text_all)
268
+ __all__ += list(_llmsys_all)