benchkit-cli 0.1.0__py3-none-any.whl

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 (149) hide show
  1. benchkit/__init__.py +1 -0
  2. benchkit/_pi_proxy.py +219 -0
  3. benchkit/answer_key_guard.ts +49 -0
  4. benchkit/artifacts.py +87 -0
  5. benchkit/benchmarks/__init__.py +105 -0
  6. benchkit/benchmarks/aider_polyglot.py +405 -0
  7. benchkit/benchmarks/arc.py +52 -0
  8. benchkit/benchmarks/banking77.py +149 -0
  9. benchkit/benchmarks/base.py +19 -0
  10. benchkit/benchmarks/boolq.py +49 -0
  11. benchkit/benchmarks/chartqa.py +133 -0
  12. benchkit/benchmarks/code_verifier.py +77 -0
  13. benchkit/benchmarks/downloads.py +166 -0
  14. benchkit/benchmarks/evalplus.py +288 -0
  15. benchkit/benchmarks/git_surgery.py +485 -0
  16. benchkit/benchmarks/gpqa.py +56 -0
  17. benchkit/benchmarks/gsm8k.py +97 -0
  18. benchkit/benchmarks/hellaswag.py +49 -0
  19. benchkit/benchmarks/humaneval.py +103 -0
  20. benchkit/benchmarks/ifeval.py +56 -0
  21. benchkit/benchmarks/ifeval_instructions.py +477 -0
  22. benchkit/benchmarks/mbpp.py +60 -0
  23. benchkit/benchmarks/mc_arena.py +479 -0
  24. benchkit/benchmarks/mcq.py +94 -0
  25. benchkit/benchmarks/medfailbench.py +537 -0
  26. benchkit/benchmarks/mmlu.py +54 -0
  27. benchkit/benchmarks/mmlu_pro.py +62 -0
  28. benchkit/benchmarks/mmvp.py +115 -0
  29. benchkit/benchmarks/ocrbench.py +96 -0
  30. benchkit/benchmarks/openbookqa.py +52 -0
  31. benchkit/benchmarks/patcheval.py +929 -0
  32. benchkit/benchmarks/piqa.py +52 -0
  33. benchkit/benchmarks/ruler.py +172 -0
  34. benchkit/benchmarks/ruler_generator.py +535 -0
  35. benchkit/benchmarks/sanity.py +174 -0
  36. benchkit/benchmarks/treejs_arena.py +268 -0
  37. benchkit/benchmarks/truthfulqa.py +52 -0
  38. benchkit/benchmarks/utils.py +25 -0
  39. benchkit/benchmarks/vision.py +230 -0
  40. benchkit/benchmarks/vstar.py +108 -0
  41. benchkit/benchmarks/winogrande.py +52 -0
  42. benchkit/benchmarks/xstest.py +116 -0
  43. benchkit/browser.py +429 -0
  44. benchkit/catalog.py +121 -0
  45. benchkit/cli.py +1000 -0
  46. benchkit/client.py +1413 -0
  47. benchkit/controls.py +87 -0
  48. benchkit/datasets/MMLU_LICENSE.txt +21 -0
  49. benchkit/datasets/README.md +142 -0
  50. benchkit/datasets/arc_challenge.jsonl +1172 -0
  51. benchkit/datasets/banking77.jsonl +3080 -0
  52. benchkit/datasets/banking77_intents.json +79 -0
  53. benchkit/datasets/boolq.jsonl +3270 -0
  54. benchkit/datasets/code_verifier.jsonl +500 -0
  55. benchkit/datasets/gpqa_diamond.jsonl +198 -0
  56. benchkit/datasets/gsm8k.jsonl +1319 -0
  57. benchkit/datasets/hellaswag.jsonl +1000 -0
  58. benchkit/datasets/humaneval.jsonl +164 -0
  59. benchkit/datasets/ifeval.jsonl +541 -0
  60. benchkit/datasets/mbpp.jsonl +500 -0
  61. benchkit/datasets/mc_blocks_1_20_1.jsonl +1003 -0
  62. benchkit/datasets/medfailbench_hard30.jsonl +30 -0
  63. benchkit/datasets/medfailbench_hard30.md +13 -0
  64. benchkit/datasets/openbookqa.jsonl +500 -0
  65. benchkit/datasets/piqa.jsonl +1838 -0
  66. benchkit/datasets/sanity_code.jsonl +6 -0
  67. benchkit/datasets/truthfulqa.jsonl +817 -0
  68. benchkit/datasets/winogrande.jsonl +1267 -0
  69. benchkit/datasets/xstest.csv +451 -0
  70. benchkit/decision.py +194 -0
  71. benchkit/demo.py +451 -0
  72. benchkit/dockerfiles.py +247 -0
  73. benchkit/engine.py +1270 -0
  74. benchkit/evaluation.py +195 -0
  75. benchkit/events.py +141 -0
  76. benchkit/executor.py +96 -0
  77. benchkit/git_surgery/backport-release-stack/setup.sh +328 -0
  78. benchkit/git_surgery/backport-release-stack/verify.sh +119 -0
  79. benchkit/git_surgery/bisect-the-regression/setup.sh +49 -0
  80. benchkit/git_surgery/bisect-the-regression/verify.sh +34 -0
  81. benchkit/git_surgery/rebase-conflict-chain/setup.sh +65 -0
  82. benchkit/git_surgery/rebase-conflict-chain/verify.sh +43 -0
  83. benchkit/git_surgery/recover-complex-stash/setup.sh +152 -0
  84. benchkit/git_surgery/recover-complex-stash/verify.sh +95 -0
  85. benchkit/git_surgery/recover-lost-work/setup.sh +40 -0
  86. benchkit/git_surgery/recover-lost-work/verify.sh +36 -0
  87. benchkit/git_surgery/repair-force-pushed-remote/setup.sh +171 -0
  88. benchkit/git_surgery/repair-force-pushed-remote/verify.sh +83 -0
  89. benchkit/git_surgery/revert-merge-with-followups/setup.sh +198 -0
  90. benchkit/git_surgery/revert-merge-with-followups/verify.sh +98 -0
  91. benchkit/git_surgery/secret-in-history/README.md +27 -0
  92. benchkit/git_surgery/secret-in-history/setup.sh +107 -0
  93. benchkit/git_surgery/secret-in-history/verify.sh +106 -0
  94. benchkit/git_surgery/split-the-mega-commit/setup.sh +50 -0
  95. benchkit/git_surgery/split-the-mega-commit/verify.sh +48 -0
  96. benchkit/git_surgery/untangle-nested-submodules/setup.sh +193 -0
  97. benchkit/git_surgery/untangle-nested-submodules/verify.sh +90 -0
  98. benchkit/history.py +474 -0
  99. benchkit/jobs.py +332 -0
  100. benchkit/leakage.py +51 -0
  101. benchkit/looping.py +873 -0
  102. benchkit/mc_render.py +274 -0
  103. benchkit/mc_viewer/dist/atlas.png +0 -0
  104. benchkit/mc_viewer/dist/blockStates.json.gz +0 -0
  105. benchkit/mc_viewer/dist/version.json +4 -0
  106. benchkit/mc_viewer/dist/viewer.html +23 -0
  107. benchkit/mc_viewer/dist/viewer.js +2 -0
  108. benchkit/mc_viewer/dist/viewer.js.LICENSE.txt +25 -0
  109. benchkit/mc_viewer/dist/worker.js +2 -0
  110. benchkit/mc_viewer/dist/worker.js.LICENSE.txt +19 -0
  111. benchkit/metrics.py +100 -0
  112. benchkit/ollama.py +60 -0
  113. benchkit/perf.py +353 -0
  114. benchkit/perf_report.py +207 -0
  115. benchkit/perturbations.py +208 -0
  116. benchkit/pi_agent.py +476 -0
  117. benchkit/pi_package/package-lock.json +1827 -0
  118. benchkit/pi_package/package.json +8 -0
  119. benchkit/report.py +142 -0
  120. benchkit/report_markdown.py +645 -0
  121. benchkit/results.py +688 -0
  122. benchkit/retry.py +163 -0
  123. benchkit/runner.py +769 -0
  124. benchkit/sandbox.py +1167 -0
  125. benchkit/template_check.py +291 -0
  126. benchkit/templates/arena.html +504 -0
  127. benchkit/templates/history.html +58 -0
  128. benchkit/templates/perf.html +509 -0
  129. benchkit/templates/report.html +769 -0
  130. benchkit/tui/__init__.py +5 -0
  131. benchkit/tui/app.py +87 -0
  132. benchkit/tui/app.tcss +512 -0
  133. benchkit/tui/formatting.py +84 -0
  134. benchkit/tui/screens/__init__.py +1 -0
  135. benchkit/tui/screens/connect.py +191 -0
  136. benchkit/tui/screens/detail.py +288 -0
  137. benchkit/tui/screens/help.py +84 -0
  138. benchkit/tui/screens/modals.py +544 -0
  139. benchkit/tui/screens/results.py +361 -0
  140. benchkit/tui/screens/run.py +988 -0
  141. benchkit/tui/screens/setup.py +733 -0
  142. benchkit/tui/theme.py +135 -0
  143. benchkit/tui/widgets.py +120 -0
  144. benchkit_cli-0.1.0.dist-info/METADATA +294 -0
  145. benchkit_cli-0.1.0.dist-info/RECORD +149 -0
  146. benchkit_cli-0.1.0.dist-info/WHEEL +5 -0
  147. benchkit_cli-0.1.0.dist-info/entry_points.txt +3 -0
  148. benchkit_cli-0.1.0.dist-info/licenses/LICENSE +201 -0
  149. benchkit_cli-0.1.0.dist-info/top_level.txt +1 -0
benchkit/tui/theme.py ADDED
@@ -0,0 +1,135 @@
1
+ """Dogi themes for BenchKit.
2
+
3
+ Ported from the Dogi editor theme by Doğukan Ürker
4
+ (https://github.com/DogukanUrker/DogiZed). Dogi is a flat, high-contrast
5
+ palette: pure black or pure white everywhere, no tinted panels or borders, and
6
+ colour reserved for state. The TUI gets its separation from translucent
7
+ overlays instead of solid panel colours, which is what `bk-raise` and
8
+ `bk-border` carry.
9
+ """
10
+
11
+ from __future__ import annotations
12
+
13
+ from textual.theme import Theme
14
+
15
+ # Dogi Dark
16
+ DARK_BACKGROUND = "#000000"
17
+ DARK_FOREGROUND = "#FFFFFF"
18
+ DARK_BLUE = "#60A5FA"
19
+ DARK_PINK = "#F472B6"
20
+ DARK_CYAN = "#22D3EE"
21
+ DARK_GREEN = "#34D399"
22
+ DARK_YELLOW = "#FACC15"
23
+ DARK_RED = "#EF4444"
24
+ DARK_MUTED = "#6B7280"
25
+ DARK_PLACEHOLDER = "#4A4A4A"
26
+
27
+ # Dogi Light
28
+ LIGHT_BACKGROUND = "#FFFFFF"
29
+ LIGHT_FOREGROUND = "#0B0B0B"
30
+ LIGHT_BLUE = "#2563EB"
31
+ LIGHT_PINK = "#DB2777"
32
+ LIGHT_CYAN = "#0891B2"
33
+ LIGHT_GREEN = "#059669"
34
+ LIGHT_YELLOW = "#D97706"
35
+ LIGHT_RED = "#DC2626"
36
+ LIGHT_MUTED = "#6B7280"
37
+ LIGHT_PLACEHOLDER = "#9CA3AF"
38
+
39
+ DOGI_DARK = Theme(
40
+ name="dogi",
41
+ primary=DARK_BLUE,
42
+ secondary=DARK_PINK,
43
+ accent=DARK_CYAN,
44
+ success=DARK_GREEN,
45
+ warning=DARK_YELLOW,
46
+ error=DARK_RED,
47
+ foreground=DARK_FOREGROUND,
48
+ background=DARK_BACKGROUND,
49
+ surface=DARK_BACKGROUND,
50
+ panel=DARK_BACKGROUND,
51
+ # Solid stand-ins for Dogi's translucent white overlay (#FFFFFF08).
52
+ boost="#141414",
53
+ dark=True,
54
+ variables={
55
+ # Dogi draws no hard borders; these translucent whites stand in.
56
+ "bk-border": "#FFFFFF 14%",
57
+ "bk-raise": "#FFFFFF 6%",
58
+ "bk-selection": "#FFFFFF 20%",
59
+ "text-muted": DARK_MUTED,
60
+ "text-disabled": DARK_PLACEHOLDER,
61
+ "input-cursor-background": DARK_BLUE,
62
+ "input-cursor-foreground": DARK_BACKGROUND,
63
+ "input-selection-background": f"{DARK_BLUE} 35%",
64
+ "block-cursor-background": DARK_BLUE,
65
+ "block-cursor-foreground": DARK_BACKGROUND,
66
+ "block-cursor-text-style": "bold",
67
+ "footer-key-foreground": DARK_BLUE,
68
+ "footer-description-foreground": DARK_FOREGROUND,
69
+ "scrollbar": "#FFFFFF 12%",
70
+ "scrollbar-hover": "#FFFFFF 20%",
71
+ "scrollbar-active": DARK_BLUE,
72
+ "scrollbar-background": DARK_BACKGROUND,
73
+ "link-color-hover": DARK_BLUE,
74
+ "markdown-table-border": "#FFFFFF 14%",
75
+ },
76
+ )
77
+
78
+ DOGI_LIGHT = Theme(
79
+ name="dogi-light",
80
+ primary=LIGHT_BLUE,
81
+ secondary=LIGHT_PINK,
82
+ accent=LIGHT_CYAN,
83
+ success=LIGHT_GREEN,
84
+ warning=LIGHT_YELLOW,
85
+ error=LIGHT_RED,
86
+ foreground=LIGHT_FOREGROUND,
87
+ background=LIGHT_BACKGROUND,
88
+ surface=LIGHT_BACKGROUND,
89
+ panel=LIGHT_BACKGROUND,
90
+ # Dogi's #00000010 hover overlay, flattened.
91
+ boost="#F0F0F0",
92
+ dark=False,
93
+ variables={
94
+ "bk-border": "#000000 14%",
95
+ "bk-raise": "#000000 5%",
96
+ "bk-selection": "#000000 18%",
97
+ "text-muted": LIGHT_MUTED,
98
+ "text-disabled": LIGHT_PLACEHOLDER,
99
+ "input-cursor-background": LIGHT_BLUE,
100
+ "input-cursor-foreground": LIGHT_BACKGROUND,
101
+ "input-selection-background": f"{LIGHT_BLUE} 25%",
102
+ "block-cursor-background": LIGHT_BLUE,
103
+ "block-cursor-foreground": LIGHT_BACKGROUND,
104
+ "block-cursor-text-style": "bold",
105
+ "footer-key-foreground": LIGHT_BLUE,
106
+ "footer-description-foreground": LIGHT_FOREGROUND,
107
+ "scrollbar": "#000000 15%",
108
+ "scrollbar-hover": "#000000 25%",
109
+ "scrollbar-active": LIGHT_BLUE,
110
+ "scrollbar-background": LIGHT_BACKGROUND,
111
+ "link-color-hover": LIGHT_BLUE,
112
+ "markdown-table-border": "#000000 14%",
113
+ },
114
+ )
115
+
116
+ THEMES = [DOGI_DARK, DOGI_LIGHT]
117
+
118
+ DEFAULT_THEME = DOGI_DARK.name
119
+ ALTERNATE_THEME = DOGI_LIGHT.name
120
+
121
+ # Fallbacks so the stylesheet still parses under Textual's built-in themes,
122
+ # which know nothing about the Dogi variables. Variable values are substituted
123
+ # literally, so these have to be real colours rather than other variables.
124
+ VARIABLE_DEFAULTS = {
125
+ "bk-border": "#808080 40%",
126
+ "bk-raise": "#808080 15%",
127
+ "bk-selection": "#808080 30%",
128
+ }
129
+
130
+
131
+ def score_palette(dark: bool) -> dict[str, str]:
132
+ """Pass/warn/fail colours that stay readable on the active background."""
133
+ if dark:
134
+ return {"high": DARK_GREEN, "mid": DARK_YELLOW, "low": DARK_RED}
135
+ return {"high": LIGHT_GREEN, "mid": LIGHT_YELLOW, "low": LIGHT_RED}
@@ -0,0 +1,120 @@
1
+ """Reusable presentational widgets for the BenchKit TUI."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing import Any
6
+
7
+ from textual.app import ComposeResult
8
+ from textual.content import Content
9
+ from textual.reactive import reactive
10
+ from textual.screen import Screen
11
+ from textual.widget import Widget
12
+ from textual.widgets import Static
13
+
14
+
15
+ class StatCard(Widget):
16
+ """A label above a large value, used for the live run statistics."""
17
+
18
+ DEFAULT_CSS = """
19
+ StatCard {
20
+ width: 1fr;
21
+ height: 4;
22
+ padding: 0 1;
23
+ border-left: outer $bk-border;
24
+ background: $surface;
25
+ }
26
+ StatCard .stat-label {
27
+ color: $text-muted;
28
+ text-style: none;
29
+ text-wrap: nowrap;
30
+ text-overflow: ellipsis;
31
+ }
32
+ StatCard .stat-value {
33
+ text-style: bold;
34
+ text-wrap: nowrap;
35
+ text-overflow: ellipsis;
36
+ }
37
+ StatCard .stat-hint {
38
+ color: $text-muted;
39
+ text-wrap: nowrap;
40
+ text-overflow: ellipsis;
41
+ }
42
+ """
43
+
44
+ value: reactive[str] = reactive("--")
45
+ hint: reactive[str] = reactive("")
46
+
47
+ def __init__(
48
+ self,
49
+ label: str,
50
+ value: str = "--",
51
+ hint: str = "",
52
+ *,
53
+ id: str | None = None,
54
+ classes: str | None = None,
55
+ ) -> None:
56
+ super().__init__(id=id, classes=classes)
57
+ self.label = label
58
+ self.set_reactive(StatCard.value, value)
59
+ self.set_reactive(StatCard.hint, hint)
60
+
61
+ def compose(self) -> ComposeResult:
62
+ yield Static(self.label, classes="stat-label")
63
+ yield Static(self.value, classes="stat-value", id="value")
64
+ yield Static(self.hint, classes="stat-hint", id="hint")
65
+
66
+ def watch_value(self, value: str) -> None:
67
+ if self.is_mounted:
68
+ self.query_one("#value", Static).update(value)
69
+
70
+ def watch_hint(self, hint: str) -> None:
71
+ if self.is_mounted:
72
+ self.query_one("#hint", Static).update(hint)
73
+
74
+ def set_state(self, value: str, hint: str = "") -> None:
75
+ self.value = value
76
+ self.hint = hint
77
+
78
+
79
+ class Banner(Static):
80
+ """The BenchKit wordmark used on the connection screen."""
81
+
82
+ ART = r"""
83
+ ██████╗ ███████╗███╗ ██╗ ██████╗██╗ ██╗██╗ ██╗██╗████████╗
84
+ ██╔══██╗██╔════╝████╗ ██║██╔════╝██║ ██║██║ ██╔╝██║╚══██╔══╝
85
+ ██████╔╝█████╗ ██╔██╗ ██║██║ ███████║█████╔╝ ██║ ██║
86
+ ██╔══██╗██╔══╝ ██║╚██╗██║██║ ██╔══██║██╔═██╗ ██║ ██║
87
+ ██████╔╝███████╗██║ ╚████║╚██████╗██║ ██║██║ ██╗██║ ██║
88
+ ╚═════╝ ╚══════╝╚═╝ ╚═══╝ ╚═════╝╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝
89
+ """.strip("\n")
90
+
91
+ def __init__(self, **kwargs: Any) -> None:
92
+ super().__init__(self.ART, **kwargs)
93
+
94
+
95
+ class SectionTitle(Static):
96
+ """A pane heading with an optional right-aligned counter."""
97
+
98
+ def __init__(self, title: str, detail: str = "", **kwargs: Any) -> None:
99
+ super().__init__(**kwargs)
100
+ self._title = title
101
+ self._detail = detail
102
+ self.update(self._render())
103
+
104
+ def _render(self) -> Content:
105
+ if self._detail:
106
+ return Content.from_markup(
107
+ "[b]$title[/b] [dim]$detail[/dim]",
108
+ title=self._title,
109
+ detail=self._detail,
110
+ )
111
+ return Content.from_markup("[b]$title[/b]", title=self._title)
112
+
113
+ def set_detail(self, detail: str) -> None:
114
+ self._detail = detail
115
+ self.update(self._render())
116
+
117
+
118
+ def apply_compact(screen: Screen, height: int) -> None:
119
+ """Tighten the stat cards and progress block on short terminals."""
120
+ screen.set_class(height < 32, "compact")
@@ -0,0 +1,294 @@
1
+ Metadata-Version: 2.4
2
+ Name: benchkit-cli
3
+ Version: 0.1.0
4
+ Summary: Benchmark your local LLMs with real eval suites
5
+ License-Expression: Apache-2.0
6
+ Requires-Python: >=3.11
7
+ Description-Content-Type: text/markdown
8
+ License-File: LICENSE
9
+ Requires-Dist: evalplus==0.3.1
10
+ Requires-Dist: httpx>=0.28.1
11
+ Requires-Dist: pyarrow>=25.0.0
12
+ Requires-Dist: rich>=15.0.0
13
+ Requires-Dist: python-dotenv>=1.2.3
14
+ Requires-Dist: textual>=8.2.8
15
+ Provides-Extra: browser
16
+ Requires-Dist: playwright>=1.63.0; extra == "browser"
17
+ Dynamic: license-file
18
+
19
+ <div align="center">
20
+
21
+ <img src="assets/benchkit-connect.png" alt="BenchKit" width="880">
22
+
23
+ # BenchKit
24
+
25
+ **Benchmark local LLMs with real evaluation suites from a full terminal UI.**
26
+
27
+ Not vibes. Actual scores.
28
+
29
+ <img src="https://img.shields.io/badge/Python-3.11%2B-2563EB?style=flat-square&logo=python&logoColor=white&labelColor=0b0b0b" alt="Python 3.11+">
30
+ <img src="https://img.shields.io/badge/TUI-Textual-60A5FA?style=flat-square&labelColor=0b0b0b" alt="Built with Textual">
31
+ <img src="https://img.shields.io/badge/Suites-25-34D399?style=flat-square&labelColor=0b0b0b" alt="25 benchmark suites">
32
+ <img src="https://img.shields.io/badge/License-Apache%202.0-6B7280?style=flat-square&labelColor=0b0b0b" alt="Apache 2.0">
33
+
34
+ </div>
35
+
36
+ ## What it does
37
+
38
+ BenchKit runs established coding, reasoning, knowledge, instruction-following,
39
+ vision, and long-context benchmarks against local models. It supports OpenAI-compatible
40
+ servers such as llama.cpp, llama-swap, vLLM, and LM Studio, plus native Ollama.
41
+
42
+ - Guided terminal UI for connecting, selecting models, running suites, and
43
+ exploring results
44
+ - Headless mode for scripts and CI
45
+ - Live streamed responses, reasoning traces, progress, speed, and loop detection
46
+ - Direct model evaluation and optional Pi coding-agent evaluation
47
+ - Benchmark slicing, tag filters, verifier repair, and choice-order robustness
48
+ - JSON, CSV, Markdown, and standalone interactive HTML reports
49
+ - Performance profiling and a local dashboard for historical runs
50
+
51
+ <div align="center">
52
+ <img src="assets/benchkit-run.png" alt="BenchKit running a benchmark" width="940">
53
+ </div>
54
+
55
+ ## Quick start
56
+
57
+ BenchKit requires Python 3.11 or newer and [uv](https://docs.astral.sh/uv/).
58
+
59
+ ```bash
60
+ uvx benchkit-cli # try it without installing
61
+ uv tool install benchkit-cli # or install the `benchkit` command
62
+ ```
63
+
64
+ From a clone of this repository:
65
+
66
+ ```bash
67
+ uv sync
68
+ cp .env.example .env
69
+ uv run benchkit
70
+ ```
71
+
72
+ Set your server in a `.env` in the directory you run `benchkit` from (parent
73
+ directories are not searched), or enter it on the Connect screen:
74
+
75
+ ```env
76
+ BENCHKIT_PROVIDER=openai
77
+ BENCHKIT_HOST=http://localhost:8080/v1
78
+ BENCHKIT_API_KEY=
79
+ ```
80
+
81
+ For Ollama:
82
+
83
+ ```env
84
+ BENCHKIT_PROVIDER=ollama
85
+ OLLAMA_HOST=http://localhost:11434
86
+ ```
87
+
88
+ No inference server available? Explore the complete UI offline:
89
+
90
+ ```bash
91
+ uv run benchkit --demo
92
+ ```
93
+
94
+ ## Run benchmarks
95
+
96
+ The TUI lets you select models, benchmarks, task limits, and optional run modes.
97
+ For automation, use headless mode:
98
+
99
+ ```bash
100
+ # Run the first 20 HumanEval tasks
101
+ uv run benchkit --headless --models qwen3:8b --benchmarks humaneval:20
102
+
103
+ # Run multiple models and benchmarks
104
+ uv run benchkit --headless \
105
+ --models qwen3:8b,gemma3:12b \
106
+ --benchmarks sanity,gsm8k:50
107
+
108
+ # Print prompts, reasoning traces, and responses
109
+ uv run benchkit --headless --models qwen3:8b \
110
+ --benchmarks sanity --verbose
111
+ ```
112
+
113
+ Task slices accept `20` for the first 20 tasks, `-20` for the last 20, and
114
+ `40-80` for a range.
115
+
116
+ Useful commands:
117
+
118
+ ```bash
119
+ uv run benchkit --list
120
+ uv run benchkit --help
121
+ ```
122
+
123
+ ## Benchmarks
124
+
125
+ | Benchmark | Key | Tasks | What it tests |
126
+ | --- | --- | ---: | --- |
127
+ | PatchEval | `patcheval` | 20 | Real Python bug fixes verified by hidden tests with Pi |
128
+ | Sanity | `sanity` | 25 | Fast checks across five core capabilities |
129
+ | Three.js Arena | `treejs-arena` | 25 | Creative single-file scenes, scored only on whether they render |
130
+ | Git Surgery | `git-surgery` | 10 | Stateful Git operations with Pi |
131
+ | MedFailBench | `medfailbench` | 30 | Offline heuristic screen for high-risk clinical responses; not clinical validation, certification, deployment evidence, or model ranking |
132
+ | Aider Polyglot | `aider-polyglot` | 225 | Repository editing across six languages with Pi |
133
+ | HumanEval | `humaneval` | 164 | Python function completion |
134
+ | HumanEval+ | `humaneval-plus` | 164 | HumanEval with expanded EvalPlus tests |
135
+ | MBPP | `mbpp` | 500 | Short Python programming tasks |
136
+ | MBPP+ | `mbpp-plus` | 378 | MBPP with expanded EvalPlus tests |
137
+ | GSM8K | `gsm8k` | 1,319 | Multi-step grade-school math |
138
+ | IFEval | `ifeval` | 541 | Verifiable instruction following |
139
+ | RULER | `ruler` | 39 × 6 | Practical long-context retrieval from 4K to 128K |
140
+ | RULER Full | `ruler-full` | 6,500 × 6 | Research-scale RULER (explicit opt-in) |
141
+ | XSTest | `xstest` | 450 | Safe compliance and unsafe refusal with an offline checker |
142
+ | GPQA | `gpqa` | 198 | Graduate-level science questions |
143
+ | MMLU-Pro | `mmlu-pro` | 12,032 | Reasoning across 14 knowledge categories |
144
+ | BANKING77 | `banking77` | 3,080 | Route a banking message to one of 77 intents |
145
+ | Code Verifier | `code-verifier` | 500 | Judge whether a model-written HumanEval+ solution passes its tests |
146
+ | OCRBench | `ocrbench` | 1,000 | Text recognition and text-centric VQA over images |
147
+ | ChartQA | `chartqa` | 2,500 | Questions about real charts, 5% relaxed numeric accuracy |
148
+ | MMVP | `mmvp` | 300 | Look-alike image pairs that differ in one detail; also reports pair accuracy |
149
+ | V* Bench | `vstar` | 191 | Small details in high-resolution images |
150
+ | MMLU | `mmlu` | 14,042 | Academic and professional knowledge |
151
+ | ARC | `arc` | 1,172 | Grade-school science reasoning |
152
+ | OpenBookQA | `openbookqa` | 500 | Elementary science knowledge |
153
+ | WinoGrande | `winogrande` | 1,267 | Commonsense pronoun resolution |
154
+ | PIQA | `piqa` | 1,838 | Physical commonsense reasoning |
155
+ | BoolQ | `boolq` | 3,270 | Passage-based yes/no questions |
156
+ | TruthfulQA | `truthfulqa` | 817 | Resistance to common misconceptions |
157
+ | HellaSwag | `hellaswag` | 1,000 | Plausible real-world continuations |
158
+
159
+ `treejs-arena` renders each generated page in headless Chromium, so it needs
160
+ the browser extra first:
161
+
162
+ ```bash
163
+ uv sync --extra browser
164
+ uv run playwright install chromium
165
+ ```
166
+
167
+ Vision suites (`ocrbench`, `chartqa`, `mmvp`, `vstar`) send images inline as
168
+ base64, so they need a vision model (a llama.cpp server started with
169
+ `--mmproj`, or an Ollama vision model). Each one downloads a pinned dataset
170
+ revision on first use. `mmvp` and `vstar` are small enough to run in full on
171
+ one consumer GPU and also run on decision models with an mmproj.
172
+
173
+ Small suites ship with BenchKit and work offline. Larger datasets (`mmlu`,
174
+ `mmlu-pro`, the vision suites, EvalPlus, RULER's haystacks, Aider Polyglot,
175
+ PatchEval) are
176
+ downloaded once into `~/.cache/benchkit` the first time a run needs them. List
177
+ what is installed and fetch everything that is missing ahead of time with:
178
+
179
+ ```bash
180
+ uv run benchkit datasets
181
+ uv run benchkit datasets install # every missing dataset
182
+ uv run benchkit datasets install mmlu # or just the ones you name
183
+ ```
184
+
185
+ In the terminal app, press `d` on the setup screen (or click **Datasets**) for
186
+ the same list with an **Install all missing** button.
187
+
188
+ The CLI registry is the canonical source for current counts, descriptions,
189
+ and supported perturbations:
190
+
191
+ ```bash
192
+ uv run benchkit --list
193
+ ```
194
+
195
+ ## Advanced runs
196
+
197
+ Compare raw generation with the stock Pi coding agent (Docker required):
198
+
199
+ ```bash
200
+ uv run benchkit --headless --models qwen3:8b \
201
+ --benchmarks gsm8k:20 --harness both
202
+ ```
203
+
204
+ Give incorrect answers one verifier-guided replacement attempt:
205
+
206
+ ```bash
207
+ uv run benchkit --headless --models qwen3:8b \
208
+ --benchmarks gsm8k:20 --repair-attempts 1
209
+ ```
210
+
211
+ Repairs default to off and can be set from 0–10. One is a practical starting
212
+ point, but the right depth depends on what you want to measure.
213
+
214
+ Test whether multiple-choice accuracy survives reordered answer choices:
215
+
216
+ ```bash
217
+ uv run benchkit --headless --models qwen3:8b \
218
+ --benchmarks mmlu-pro:100 --perturbation choice-order
219
+ ```
220
+
221
+ Decision models served by llama.cpp (`/v1/systemone`) are detected
222
+ automatically and run on the multiple-choice and yes/no suites, scored on
223
+ accuracy plus calibration (Brier, ECE):
224
+
225
+ ```bash
226
+ llama-server -hf ggml-org/Kev-4B-GGUF
227
+ uv run benchkit --headless --models <decision-model> \
228
+ --benchmarks mmlu-pro:100,boolq:100
229
+ ```
230
+
231
+ Behind a proxy that hides this, such as llama-swap (v262+), name the model:
232
+
233
+ ```bash
234
+ uv run benchkit --headless --models d1-3b,qwen3:8b --benchmarks gpqa \
235
+ --decision-models d1-3b
236
+ ```
237
+
238
+ or mark it once in the llama-swap config:
239
+
240
+ ```yaml
241
+ models:
242
+ d1-3b:
243
+ metadata:
244
+ decision: true
245
+ ```
246
+
247
+ Profile inference performance:
248
+
249
+ ```bash
250
+ uv run benchkit perf qwen3:8b
251
+ uv run benchkit perf qwen3:8b --depths minimal,4k,16k --gen 256 --reps 10
252
+ ```
253
+
254
+ ## Results
255
+
256
+ Every run creates a timestamped directory containing:
257
+
258
+ ```text
259
+ results/<timestamp>/
260
+ ├── results.json
261
+ ├── results.csv
262
+ ├── results.md
263
+ └── results.html
264
+ ```
265
+
266
+ Open `results.html` for an interactive report with charts and task-level
267
+ prompts, responses, reasoning traces, timing, and diagnostics.
268
+
269
+ Browse completed benchmark and performance runs locally:
270
+
271
+ ```bash
272
+ uv run benchkit history
273
+ ```
274
+
275
+ ## Development
276
+
277
+ ```bash
278
+ uv sync
279
+ uv run pre-commit install
280
+ uv run ruff check .
281
+ uv run ruff format .
282
+ uv run pytest
283
+ ```
284
+
285
+ See [CONTRIBUTING.md](CONTRIBUTING.md) for contributor setup and workflow.
286
+
287
+ ## License
288
+
289
+ Apache License 2.0
290
+
291
+ <div align="center">
292
+ <br>
293
+ <sub>Themed with <a href="https://github.com/DogukanUrker/DogiZed">Dogi</a> · built on <a href="https://github.com/Textualize/textual">Textual</a></sub>
294
+ </div>