evalpair 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.
@@ -0,0 +1,189 @@
1
+ Metadata-Version: 2.4
2
+ Name: evalpair
3
+ Version: 0.1.0
4
+ Summary: Run an LLM eval suite against a local or hosted model, cache every call, and compare two runs item by item with bootstrap intervals and a measured noise floor. CLI and MCP server.
5
+ Keywords: llm,evaluation,eval,benchmark,bootstrap,ollama,mcp,cli
6
+ Author: Kameswara Sai Srikar Manda
7
+ License-Expression: MIT
8
+ License-File: LICENSE
9
+ Classifier: Development Status :: 3 - Alpha
10
+ Classifier: Environment :: Console
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: Intended Audience :: Science/Research
13
+ Classifier: Operating System :: OS Independent
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3 :: Only
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3.13
19
+ Classifier: Programming Language :: Python :: 3.14
20
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
21
+ Requires-Dist: mcp>=2.3,<3
22
+ Requires-Python: >=3.11
23
+ Project-URL: Homepage, https://github.com/Srikarmk/evalpair
24
+ Project-URL: Source, https://github.com/Srikarmk/evalpair
25
+ Project-URL: Issues, https://github.com/Srikarmk/evalpair/issues
26
+ Description-Content-Type: text/markdown
27
+
28
+ # evalpair
29
+
30
+ <!-- mcp-name: io.github.Srikarmk/evalpair -->
31
+
32
+ Run an LLM eval suite against a model, cache every call, and compare two runs item by item: did the new
33
+ model, prompt or quantization actually change anything, or is the difference noise?
34
+
35
+ Most eval tools print two scores side by side. That reads a 2-point gap on 160 questions as a result, when
36
+ it usually isn't one. evalpair pairs the two runs by item, puts a bootstrap interval on the difference, counts
37
+ the items that got worse and better, and can measure a **noise floor**: the same model asked the same
38
+ questions twice. In my own studies the same prompt sent twice at temperature 0 changed up to 3% of answers,
39
+ so an answer-change rate only means something above that.
40
+
41
+ It's a CLI and an MCP server, so an agent can run an eval and read the verdict itself. It only calls the
42
+ model server you point it at, and keeps everything in one local folder.
43
+
44
+ ## Quick start
45
+
46
+ ```bash
47
+ uvx evalpair suites
48
+ uvx evalpair run gsm8k-160 -m llama3.1:8b --repeat --label llama
49
+ uvx evalpair run gsm8k-160 -m qwen3:8b --think off --label qwen3
50
+ uvx evalpair compare llama qwen3
51
+ ```
52
+
53
+ `run` prints the score with a 95% interval and the first failures, unparsed and truncated replies first
54
+ (those are usually the parser's or the token budget's fault, not the model's). `compare` prints both scores,
55
+ the paired difference with its interval, how many items got worse and better, the noise floor, and ends with
56
+ a plain-language verdict: whether the score difference is distinguishable from zero, and whether the answers
57
+ moved more than the same model asked twice.
58
+
59
+ A real comparison: Ollama's default 4-bit Llama 3.1 8B against its 2-bit build, on an M5 Pro laptop
60
+ (`--num-ctx 4096`; about 40 minutes for both runs):
61
+
62
+ ```
63
+ $ evalpair compare llama-q4 llama-q2
64
+ A llama-q4: 84.4% [79.4%, 90.0%]
65
+ B llama-q2: 60.6% [53.1%, 68.1%]
66
+ B − A -23.8 pp [-31.9 pp, -16.2 pp]
67
+ changed 40.6% [33.1%, 48.1%] of 160 items (43 worse in B, 5 better)
68
+ floor (A) 0.0% [0.0%, 0.0%]; excess +40.6 pp [+33.1 pp, +48.1 pp]
69
+
70
+ B scores lower than A: -23.8 pp [-31.9 pp, -16.2 pp], paired over 160 items. Answers changed on 40.6% of
71
+ items (43 got worse, 5 better). The noise floor (the same model asked twice) is 0.0% for A, so the change
72
+ is beyond noise.
73
+ worse in b: gsm8k-0259 '168' → '52'
74
+ ...
75
+ ```
76
+
77
+ Both scores are the ones the quantization study measured for these builds on the same items.
78
+
79
+ Interrupt a run and run it again: every reply is cached, so it picks up where it stopped.
80
+
81
+ ## As an MCP server
82
+
83
+ ```bash
84
+ claude mcp add evalpair -- uvx evalpair mcp
85
+ ```
86
+
87
+ or in any MCP client's config: `{"command": "uvx", "args": ["evalpair", "mcp"]}`.
88
+
89
+ | Tool | What it does |
90
+ |---|---|
91
+ | `list_suites` | Suites you can run: name, item count, checker, what it measures |
92
+ | `run_eval` | Run a suite against one model and save the run (calls the model; cached replies are reused) |
93
+ | `list_runs` | Saved runs, newest first |
94
+ | `show_run` | A run's score with its interval, its noise floor, and the end of failed replies |
95
+ | `compare_runs` | Two runs paired by item: difference with an interval, flips each way, change vs. noise floor, examples |
96
+
97
+ Everything except `run_eval` only reads saved runs.
98
+
99
+ ## Backends
100
+
101
+ - **Ollama** (default): `--backend ollama`, server at `http://localhost:11434`. The run records the model's
102
+ digest, so you can tell later exactly which build was tested. `--think on|off` for models that think,
103
+ `--num-ctx` for the context window.
104
+ - **Any OpenAI-compatible server**: `--backend openai --base-url http://localhost:8000/v1` for vLLM,
105
+ llama.cpp's server or LM Studio, or a hosted API. A bearer token is read from `EVALPAIR_API_KEY` (or
106
+ `OPENAI_API_KEY`) and never written to disk.
107
+
108
+ Temperature defaults to 0 and the seed to 7. Both are part of the cache key, along with the server URL,
109
+ model, messages, token budget and thinking setting.
110
+
111
+ ## Suites
112
+
113
+ Three are bundled. They're the item sets from my Measuring LLM Systems studies, with those studies' prompts
114
+ word for word, so a run can be checked against the published numbers:
115
+
116
+ | Suite | Items | Checker | Source |
117
+ |---|---|---|---|
118
+ | `gsm8k-160` | 160 | `number` | GSM8K test (MIT) |
119
+ | `mmlu-hs-160` | 160 | `choice`, stratified by subject | MMLU, four high-school subjects (MIT) |
120
+ | `e2e-extract-150` | 150 | `json_fields` | E2E NLG restaurant records (CC BY-SA 4.0) |
121
+
122
+ To make your own, create a folder with two files, in `~/.evalpair/suites/<name>/` or anywhere you then pass
123
+ by path:
124
+
125
+ ```toml
126
+ # suite.toml
127
+ description = "Capitals, answered in one word"
128
+ checker = "exact"
129
+ max_tokens = 64
130
+ system = "Answer in one word." # optional
131
+ user = "What is the capital of {country}?"
132
+ group = "region" # optional: stratify the bootstrap by this item field
133
+ ```
134
+
135
+ ```jsonl
136
+ {"id": "fr", "country": "France", "region": "Europe", "gold": "Paris"}
137
+ {"id": "pe", "country": "Peru", "region": "Americas", "gold": ["Lima", "Ciudad de los Reyes"]}
138
+ ```
139
+
140
+ `{field}` in a prompt is filled from the item; a list of strings becomes lettered options (`A. …`), anything
141
+ else is shown as indented JSON. Use `{{` and `}}` for literal braces.
142
+
143
+ | Checker | Scores | Gold |
144
+ |---|---|---|
145
+ | `number` | the number after "Answer:", else `\boxed{}`, else the last number | a number |
146
+ | `choice` | the letter after "Answer:", with fallbacks (letters set by `checker_options.letters`) | a letter |
147
+ | `exact` | the text after "Answer:", or the last line, normalised | a string or list of strings |
148
+ | `contains` | whether a gold string appears as whole words | a string or list |
149
+ | `regex` | the last match of `checker_options.pattern` (first group) | a string or list |
150
+ | `json_fields` | the share of the gold object's fields the reply's JSON gets right (null must be null) | an object |
151
+
152
+ Checkers are deterministic code: no LLM grades another LLM here. The `number`, `choice` and `json_fields`
153
+ parsers come from the studies, and re-scoring all 9,870 replies from the quantization study's main run with them gives
154
+ the study's own scores on every one (`scripts/check_against_studies.py`).
155
+
156
+ ## How the numbers are computed
157
+
158
+ - **Unit of resampling: the item.** 2,000 bootstrap draws, percentile intervals, seeded, so the same runs
159
+ always give the same interval. With a `group`, items are resampled within each group.
160
+ - **Comparisons are paired** over the items both runs answered, using the first pass of each. If the two
161
+ runs used different versions of a suite (the hash of its spec and items differs), the comparison says so.
162
+ - **Noise floor**: with `--repeat`, every item is sent a second time as a separate call (its own cache entry).
163
+ The floor is the share of items whose parsed answer changed between the passes. A comparison calls a change
164
+ "beyond noise" only if, per item, (changed between runs) minus (changed between the passes) has an interval
165
+ above zero for every run that has a floor.
166
+ - Items are taken in file order, so `--limit 50` is the same 50 items every time and limited runs still pair up.
167
+
168
+ ## Where things live
169
+
170
+ `$EVALPAIR_HOME`, or `~/.evalpair`:
171
+
172
+ ```
173
+ cache.sqlite every reply, keyed by request
174
+ runs/<run>/meta.json suite and its hash, model, digest, backend, options, counts, timings
175
+ runs/<run>/rows.jsonl one line per item and pass: reply, parsed answer, score, tokens
176
+ suites/<name>/ your suites
177
+ ```
178
+
179
+ ## Limits
180
+
181
+ - One model per run, chat-style prompts, one turn. No tool use, multi-turn or constrained decoding yet.
182
+ - Deterministic checkers only, so open-ended answers need a suite whose answer can be checked by code.
183
+ - The noise floor measures run-to-run variation on the same server. It doesn't cover a different
184
+ machine or a server update.
185
+
186
+ ## License
187
+
188
+ MIT for the code. The bundled suites keep their sources' licenses (MIT for GSM8K and MMLU, CC BY-SA 4.0 for
189
+ E2E NLG); each `suite.toml` names its license and source.
@@ -0,0 +1,22 @@
1
+ evalpair/__init__.py,sha256=u6T6mVNl2lIscZ36S_PU-pQiLrluAzCl8Ea4ZP201Nk,120
2
+ evalpair/__main__.py,sha256=MSmt_5Xg84uHqzTN38JwgseJK8rsJn_11A8WD99VtEo,61
3
+ evalpair/analysis.py,sha256=R6PgjAy6s1hOD9cl5EEuY6KBYIro57oVokZYye4JVsE,7413
4
+ evalpair/backends.py,sha256=VXxpjsPUa85av5fq7FhPgGCBdr1FlgjYaPpV5TAs3ZU,7859
5
+ evalpair/checkers.py,sha256=UEg8IflccufnwLs0NaQvY5OTBk9j_MweRHUMInnI_So,8952
6
+ evalpair/cli.py,sha256=nf9IGmKJTcAX1ZyUZTLe9GborRfaFwFBZSRDnGaRq2I,7618
7
+ evalpair/runner.py,sha256=oVYpt13-Uk8c9cDHI6njRTjZpb-kWac7ssbhX--D_uE,2907
8
+ evalpair/server.py,sha256=dpv0ShR8yu_QX85cqBcaJdXkf_GXakND1zL0nz9OrLE,6124
9
+ evalpair/stats.py,sha256=jL6HjTu0A4k5pxj2khvioLu43D_h9kLS9XL4mxFeEbY,1716
10
+ evalpair/store.py,sha256=sxbqQSVjMJsMB3_EPiy19khq1cri-0seTfLR64G4slw,2809
11
+ evalpair/suites/e2e-extract-150/items.jsonl,sha256=BTneDLboWKC-_VJGI3VyVGPrSB5uZ4zUxY4d1n8n-y4,59432
12
+ evalpair/suites/e2e-extract-150/suite.toml,sha256=L-EuZ1vbFCXNGLobQfaZaiyTM5tGrnlctLBUP37pFhU,865
13
+ evalpair/suites/gsm8k-160/items.jsonl,sha256=FnOkqlGDFVyTx2bmUwXe782WJnSDzO8ImY1VDwsLTVo,47887
14
+ evalpair/suites/gsm8k-160/suite.toml,sha256=2P-DwTZEn_fRvyhr_r1yV2r61HXoav1Cj0P7aTkhgNo,367
15
+ evalpair/suites/mmlu-hs-160/items.jsonl,sha256=u69couESNS3gkulZurhaRMqVhhy_yLwth9pAkyIgpXY,69944
16
+ evalpair/suites/mmlu-hs-160/suite.toml,sha256=SslxOXNhEOsQphquoi5WtGUsByxcSLccQURzAH3_JJk,505
17
+ evalpair/suites.py,sha256=_FTpHX0vjjDKxaN3S7SoGmYYQTinker1VPbD-Kn3f08,5800
18
+ evalpair-0.1.0.dist-info/licenses/LICENSE,sha256=KbGgOtv_tGSCYXuA_XcavgNuMxNxAOZ3YXtnz2HOKNM,1083
19
+ evalpair-0.1.0.dist-info/WHEEL,sha256=MWx7psoF7KNST9G72pGtiBYuaXRXQXBk9pw5R6FzYko,80
20
+ evalpair-0.1.0.dist-info/entry_points.txt,sha256=EYTIX4HPWhV2O-0b9BuiClCl2qPE5Fe0hz7IwSbsddI,48
21
+ evalpair-0.1.0.dist-info/METADATA,sha256=19t6HXCR1P3QIUPtxNvWnnDC1MEEjAhI9JOQPwhmvyk,9142
22
+ evalpair-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: uv 0.13.7
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,3 @@
1
+ [console_scripts]
2
+ evalpair = evalpair.cli:main
3
+
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Kameswara Sai Srikar Manda
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.