inferencekit-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.
- inferencekit/__init__.py +9 -0
- inferencekit/__main__.py +5 -0
- inferencekit/analysis/__init__.py +1 -0
- inferencekit/analysis/ncu_csv.py +284 -0
- inferencekit/analysis/nsys_sqlite.py +518 -0
- inferencekit/canonical.py +104 -0
- inferencekit/checkpoint.py +396 -0
- inferencekit/cli.py +274 -0
- inferencekit/cuda/bw_peak.cu +252 -0
- inferencekit/cuda/torch_bw.py +60 -0
- inferencekit/engines/__init__.py +7 -0
- inferencekit/engines/adapters.py +190 -0
- inferencekit/engines/clip/__init__.py +13 -0
- inferencekit/engines/clip/comfyui.py +749 -0
- inferencekit/engines/clip/diffusers_ltx.py +601 -0
- inferencekit/engines/clip/noise.py +46 -0
- inferencekit/engines/clip/official_ltx.py +316 -0
- inferencekit/engines/clip/server.py +542 -0
- inferencekit/engines/clip/stepdump.py +182 -0
- inferencekit/engines/gates.py +94 -0
- inferencekit/engines/sglang_worker.py +86 -0
- inferencekit/engines/vllm_worker.py +129 -0
- inferencekit/evidence.py +427 -0
- inferencekit/gpuinfo.py +93 -0
- inferencekit/hardware.py +135 -0
- inferencekit/mcp_server.py +178 -0
- inferencekit/ops/__init__.py +30 -0
- inferencekit/ops/bench.py +184 -0
- inferencekit/ops/bench_audio.py +384 -0
- inferencekit/ops/bench_clip.py +819 -0
- inferencekit/ops/bench_image.py +393 -0
- inferencekit/ops/bench_rounds.py +297 -0
- inferencekit/ops/bench_serve.py +866 -0
- inferencekit/ops/ceiling.py +135 -0
- inferencekit/ops/compare.py +378 -0
- inferencekit/ops/correctness.py +153 -0
- inferencekit/ops/doctor.py +486 -0
- inferencekit/ops/gates.py +1772 -0
- inferencekit/ops/gates_clip.py +930 -0
- inferencekit/ops/intake.py +1321 -0
- inferencekit/ops/ledger.py +749 -0
- inferencekit/ops/manifest.py +309 -0
- inferencekit/ops/ncu.py +183 -0
- inferencekit/ops/nsys.py +224 -0
- inferencekit/ops/prompts.py +316 -0
- inferencekit/ops/quality.py +2161 -0
- inferencekit/ops/quality_clip.py +690 -0
- inferencekit/ops/quality_clip_steps.py +341 -0
- inferencekit/ops/report.py +317 -0
- inferencekit/ops/review.py +119 -0
- inferencekit/ops/rocprof.py +89 -0
- inferencekit/ops/roofline.py +392 -0
- inferencekit/ops/store.py +61 -0
- inferencekit/proc.py +172 -0
- inferencekit/prompts/ATTRIBUTION.md +56 -0
- inferencekit/prompts/__init__.py +167 -0
- inferencekit/prompts/build.py +518 -0
- inferencekit/prompts/dev-load.jsonl.gz +0 -0
- inferencekit/prompts/dev-load.manifest.json +212 -0
- inferencekit/prompts/dev.jsonl.gz +0 -0
- inferencekit/prompts/dev.manifest.json +214 -0
- inferencekit/prompts/exclusions.json +54 -0
- inferencekit/quality/__init__.py +23 -0
- inferencekit/quality/client.py +66 -0
- inferencekit/quality/data/gsm8k_LICENSE.txt +21 -0
- inferencekit/quality/fake.py +329 -0
- inferencekit/quality/gsm8k.py +224 -0
- inferencekit/quality/logprobs.py +106 -0
- inferencekit/quality/metrics.py +235 -0
- inferencekit/quality/niah.py +63 -0
- inferencekit/quality/parquet.py +296 -0
- inferencekit/quality/sampling.py +262 -0
- inferencekit/quality/step_replay.py +217 -0
- inferencekit/quality/video_metrics.py +304 -0
- inferencekit/registry.py +206 -0
- inferencekit/review/__init__.py +6 -0
- inferencekit/review/diff.py +163 -0
- inferencekit/review/media.py +181 -0
- inferencekit/review/page.py +920 -0
- inferencekit/review/rundir.py +844 -0
- inferencekit/roofline_headers.py +504 -0
- inferencekit/schemas/evidence.v1.json +130 -0
- inferencekit/schemas/evidence.v2.json +499 -0
- inferencekit/schemas/intake.v1.json +276 -0
- inferencekit/schemas/run-manifest.v1.json +118 -0
- inferencekit/serve/__init__.py +8 -0
- inferencekit/serve/audio_client.py +330 -0
- inferencekit/serve/client.py +446 -0
- inferencekit/serve/clip_client.py +351 -0
- inferencekit/serve/clip_rounds.py +429 -0
- inferencekit/serve/image_client.py +373 -0
- inferencekit/serve/loadgen.py +136 -0
- inferencekit/serve/metrics.py +203 -0
- inferencekit/serve/profiles.py +105 -0
- inferencekit/serve/prompts_io.py +125 -0
- inferencekit/serve/rounds.py +1111 -0
- inferencekit/serve/servers.py +897 -0
- inferencekit/stats.py +249 -0
- inferencekit_cli-0.1.0.dist-info/METADATA +233 -0
- inferencekit_cli-0.1.0.dist-info/RECORD +104 -0
- inferencekit_cli-0.1.0.dist-info/WHEEL +4 -0
- inferencekit_cli-0.1.0.dist-info/entry_points.txt +2 -0
- inferencekit_cli-0.1.0.dist-info/licenses/LICENSE +202 -0
- inferencekit_cli-0.1.0.dist-info/licenses/NOTICE +9 -0
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "dev-load",
|
|
3
|
+
"version": "1.0",
|
|
4
|
+
"n": 1280,
|
|
5
|
+
"buckets": {
|
|
6
|
+
"short": 1000,
|
|
7
|
+
"medium": 280
|
|
8
|
+
},
|
|
9
|
+
"sha256": "fe42629d968dbf37e75cb0a5bd7c00d0605190845f2c27e1942b7428b6120632",
|
|
10
|
+
"sealed": false,
|
|
11
|
+
"role": "load",
|
|
12
|
+
"seed": "inferencekit-prompts-v1",
|
|
13
|
+
"max_tokens": 256,
|
|
14
|
+
"length_proxy": "proxy_tokens = whitespace words * 1.3",
|
|
15
|
+
"bucket_rules": {
|
|
16
|
+
"very_short": {
|
|
17
|
+
"words": [
|
|
18
|
+
1,
|
|
19
|
+
5
|
|
20
|
+
]
|
|
21
|
+
},
|
|
22
|
+
"short": {
|
|
23
|
+
"proxy_tokens": [
|
|
24
|
+
20,
|
|
25
|
+
50
|
|
26
|
+
]
|
|
27
|
+
},
|
|
28
|
+
"medium": {
|
|
29
|
+
"proxy_tokens": [
|
|
30
|
+
240,
|
|
31
|
+
360
|
|
32
|
+
]
|
|
33
|
+
},
|
|
34
|
+
"long": {
|
|
35
|
+
"proxy_tokens": [
|
|
36
|
+
2000,
|
|
37
|
+
4000
|
|
38
|
+
]
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
"split_rule": "sha256(seed|split|group): even first byte -> dev, odd -> sealed; group = sha256 of the normalised dolly context (else the normalised instruction / question; long: the book); one candidate per group; near-duplicates (>50% shared 12-word shingles with the dev sets or the same split) dropped",
|
|
42
|
+
"selection": "ranked by sha256(seed|rank|split|bucket|key) within the split",
|
|
43
|
+
"secret_sha256": null,
|
|
44
|
+
"secret_rule": null,
|
|
45
|
+
"exclusions": {
|
|
46
|
+
"rows": 19,
|
|
47
|
+
"sha256": "7e90005d3c4f0c9f5f55479b3b6f59379a21dd9853dd03cec509b899f32b6644",
|
|
48
|
+
"rule": "rows listed in exclusions.json or flagged by the private leak-scanner rules"
|
|
49
|
+
},
|
|
50
|
+
"sources": [
|
|
51
|
+
{
|
|
52
|
+
"name": "databricks-dolly-15k",
|
|
53
|
+
"license": "CC-BY-SA-3.0",
|
|
54
|
+
"url": "https://huggingface.co/datasets/databricks/databricks-dolly-15k/resolve/bdd27f4d94b9c1f951818a7da7fd7aeea5dbff1a/databricks-dolly-15k.jsonl",
|
|
55
|
+
"sha256": "2df9083338b4abd6bceb5635764dab5d833b393b55759dffb0959b6fcbf794ec"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"name": "gsm8k-train",
|
|
59
|
+
"license": "MIT",
|
|
60
|
+
"url": "https://raw.githubusercontent.com/openai/grade-school-math/3101c7d5072418e28b9008a6636bde82a006892c/grade_school_math/data/train.jsonl",
|
|
61
|
+
"sha256": "17f347dc51477c50d4efb83959dbb7c56297aba886e5544ee2aaed3024813465"
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"name": "gutenberg-11",
|
|
65
|
+
"title": "Alice's Adventures in Wonderland (Lewis Carroll)",
|
|
66
|
+
"license": "public-domain",
|
|
67
|
+
"url": "https://www.gutenberg.org/cache/epub/11/pg11.txt",
|
|
68
|
+
"sha256": "01b38ea4c710a84bc18d0bd41271a5a1a92b94e97b2812f4dece97d4a694725e"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"name": "gutenberg-35",
|
|
72
|
+
"title": "The Time Machine (H. G. Wells)",
|
|
73
|
+
"license": "public-domain",
|
|
74
|
+
"url": "https://www.gutenberg.org/cache/epub/35/pg35.txt",
|
|
75
|
+
"sha256": "2892e919000e17c83e1dac51b30f4675db50536b644d7579fe8a89bb399a9bdc"
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"name": "gutenberg-36",
|
|
79
|
+
"title": "The War of the Worlds (H. G. Wells)",
|
|
80
|
+
"license": "public-domain",
|
|
81
|
+
"url": "https://www.gutenberg.org/cache/epub/36/pg36.txt",
|
|
82
|
+
"sha256": "8417469e3ab664749f7b36ebb85799075818207b0380b54c27d07d592a44117d"
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"name": "gutenberg-43",
|
|
86
|
+
"title": "The Strange Case of Dr Jekyll and Mr Hyde (R. L. Stevenson)",
|
|
87
|
+
"license": "public-domain",
|
|
88
|
+
"url": "https://www.gutenberg.org/cache/epub/43/pg43.txt",
|
|
89
|
+
"sha256": "b43448a88391591f9cf82b25553df00faf47a2752a873185fcdd1156eebdb990"
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"name": "gutenberg-76",
|
|
93
|
+
"title": "Adventures of Huckleberry Finn (Mark Twain)",
|
|
94
|
+
"license": "public-domain",
|
|
95
|
+
"url": "https://www.gutenberg.org/cache/epub/76/pg76.txt",
|
|
96
|
+
"sha256": "d617a37aa7ae1e1a93dcde2634db2bccb86824e31e29a55230bdbf77d6872d59"
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
"name": "gutenberg-84",
|
|
100
|
+
"title": "Frankenstein (Mary Shelley)",
|
|
101
|
+
"license": "public-domain",
|
|
102
|
+
"url": "https://www.gutenberg.org/cache/epub/84/pg84.txt",
|
|
103
|
+
"sha256": "7810cd483cffcf2cc8a1d8f0d5807931e69d4f48cd14149b8c76f88af82fead3"
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
"name": "gutenberg-98",
|
|
107
|
+
"title": "A Tale of Two Cities (Charles Dickens)",
|
|
108
|
+
"license": "public-domain",
|
|
109
|
+
"url": "https://www.gutenberg.org/cache/epub/98/pg98.txt",
|
|
110
|
+
"sha256": "d54c2b80d40a40b982cd88852c6180bb944d95acdb028af3d0e01a1750681784"
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
"name": "gutenberg-120",
|
|
114
|
+
"title": "Treasure Island (R. L. Stevenson)",
|
|
115
|
+
"license": "public-domain",
|
|
116
|
+
"url": "https://www.gutenberg.org/cache/epub/120/pg120.txt",
|
|
117
|
+
"sha256": "5bc08275eacea8640b1aa185c645283bb8c564d7b23df6b03437d229b4fc6ebd"
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
"name": "gutenberg-158",
|
|
121
|
+
"title": "Emma (Jane Austen)",
|
|
122
|
+
"license": "public-domain",
|
|
123
|
+
"url": "https://www.gutenberg.org/cache/epub/158/pg158.txt",
|
|
124
|
+
"sha256": "532b122b4e6a76cc556d6fdcd729b5892f5c4ce4a1b7060b9f832adfad8680dc"
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
"name": "gutenberg-161",
|
|
128
|
+
"title": "Sense and Sensibility (Jane Austen)",
|
|
129
|
+
"license": "public-domain",
|
|
130
|
+
"url": "https://www.gutenberg.org/cache/epub/161/pg161.txt",
|
|
131
|
+
"sha256": "22272ec4d4da2f50cda51edf34ab8486b325c4a99580120db565fb8917228a22"
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
"name": "gutenberg-174",
|
|
135
|
+
"title": "The Picture of Dorian Gray (Oscar Wilde)",
|
|
136
|
+
"license": "public-domain",
|
|
137
|
+
"url": "https://www.gutenberg.org/cache/epub/174/pg174.txt",
|
|
138
|
+
"sha256": "38f36b510417177aa87a6a24c968e3ec63a447b7df36a9c1a7c5a3f2d9e51547"
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
"name": "gutenberg-215",
|
|
142
|
+
"title": "The Call of the Wild (Jack London)",
|
|
143
|
+
"license": "public-domain",
|
|
144
|
+
"url": "https://www.gutenberg.org/cache/epub/215/pg215.txt",
|
|
145
|
+
"sha256": "30f569c5671bba7bbc4a92ab6d8ee01a0d3be00f994819c77da62c28041eb8a2"
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
"name": "gutenberg-219",
|
|
149
|
+
"title": "Heart of Darkness (Joseph Conrad)",
|
|
150
|
+
"license": "public-domain",
|
|
151
|
+
"url": "https://www.gutenberg.org/cache/epub/219/pg219.txt",
|
|
152
|
+
"sha256": "1bcdf0a1ac611dd6b70a20d100a07085754da4e90a949d6031717b86cd6d020a"
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
"name": "gutenberg-345",
|
|
156
|
+
"title": "Dracula (Bram Stoker)",
|
|
157
|
+
"license": "public-domain",
|
|
158
|
+
"url": "https://www.gutenberg.org/cache/epub/345/pg345.txt",
|
|
159
|
+
"sha256": "96cd16eacdbfebae8fdda5591f66e0cc8ee76be18e0cd1aca02bc00615782d28"
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
"name": "gutenberg-768",
|
|
163
|
+
"title": "Wuthering Heights (Emily Bronte)",
|
|
164
|
+
"license": "public-domain",
|
|
165
|
+
"url": "https://www.gutenberg.org/cache/epub/768/pg768.txt",
|
|
166
|
+
"sha256": "e533fe750589f0421d5d744576315f5c2b9b0d69e981179ea0551bbf134c5e02"
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
"name": "gutenberg-1260",
|
|
170
|
+
"title": "Jane Eyre (Charlotte Bronte)",
|
|
171
|
+
"license": "public-domain",
|
|
172
|
+
"url": "https://www.gutenberg.org/cache/epub/1260/pg1260.txt",
|
|
173
|
+
"sha256": "13414dee2951c3ee731d76d2ffd822016b2479c892162760c5d0eb2aa5fa7631"
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
"name": "gutenberg-1342",
|
|
177
|
+
"title": "Pride and Prejudice (Jane Austen)",
|
|
178
|
+
"license": "public-domain",
|
|
179
|
+
"url": "https://www.gutenberg.org/cache/epub/1342/pg1342.txt",
|
|
180
|
+
"sha256": "3f6bb9d6f78e0293b56acd4714dd68cb7d6d1d293402031ce9d5a216bcaf9d75"
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
"name": "gutenberg-1400",
|
|
184
|
+
"title": "Great Expectations (Charles Dickens)",
|
|
185
|
+
"license": "public-domain",
|
|
186
|
+
"url": "https://www.gutenberg.org/cache/epub/1400/pg1400.txt",
|
|
187
|
+
"sha256": "9a637118af8e953e9764ec603d9b0a032883384d465acac2e27966a80cf1c6f8"
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
"name": "gutenberg-1661",
|
|
191
|
+
"title": "The Adventures of Sherlock Holmes (Arthur Conan Doyle)",
|
|
192
|
+
"license": "public-domain",
|
|
193
|
+
"url": "https://www.gutenberg.org/cache/epub/1661/pg1661.txt",
|
|
194
|
+
"sha256": "922e2a12ccb43a4c9544c260b2166c6ad2097aeb5957faeee113f173bb857cd0"
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
"name": "gutenberg-2554",
|
|
198
|
+
"title": "Crime and Punishment (Fyodor Dostoevsky, tr. Constance Garnett)",
|
|
199
|
+
"license": "public-domain",
|
|
200
|
+
"url": "https://www.gutenberg.org/cache/epub/2554/pg2554.txt",
|
|
201
|
+
"sha256": "d139120965c81f10e3f747d891a49babdb49d986b25f7ab25299b1bbf4731146"
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
"name": "gutenberg-2701",
|
|
205
|
+
"title": "Moby Dick (Herman Melville)",
|
|
206
|
+
"license": "public-domain",
|
|
207
|
+
"url": "https://www.gutenberg.org/cache/epub/2701/pg2701.txt",
|
|
208
|
+
"sha256": "b5e88b71a1cda068e9ab1d94344c9d932338ba6da1a66def97a1aecd9cfcc87d"
|
|
209
|
+
}
|
|
210
|
+
],
|
|
211
|
+
"builder": "scripts/build_prompts.py (inferencekit prompts build / seal)"
|
|
212
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "dev",
|
|
3
|
+
"version": "1.0",
|
|
4
|
+
"n": 64,
|
|
5
|
+
"buckets": {
|
|
6
|
+
"very_short": 16,
|
|
7
|
+
"short": 16,
|
|
8
|
+
"medium": 16,
|
|
9
|
+
"long": 16
|
|
10
|
+
},
|
|
11
|
+
"sha256": "736717af715d14e64540b64f359372cc0aa0c611584167d61c12d918995592b6",
|
|
12
|
+
"sealed": false,
|
|
13
|
+
"role": "single",
|
|
14
|
+
"seed": "inferencekit-prompts-v1",
|
|
15
|
+
"max_tokens": 256,
|
|
16
|
+
"length_proxy": "proxy_tokens = whitespace words * 1.3",
|
|
17
|
+
"bucket_rules": {
|
|
18
|
+
"very_short": {
|
|
19
|
+
"words": [
|
|
20
|
+
1,
|
|
21
|
+
5
|
|
22
|
+
]
|
|
23
|
+
},
|
|
24
|
+
"short": {
|
|
25
|
+
"proxy_tokens": [
|
|
26
|
+
20,
|
|
27
|
+
50
|
|
28
|
+
]
|
|
29
|
+
},
|
|
30
|
+
"medium": {
|
|
31
|
+
"proxy_tokens": [
|
|
32
|
+
240,
|
|
33
|
+
360
|
|
34
|
+
]
|
|
35
|
+
},
|
|
36
|
+
"long": {
|
|
37
|
+
"proxy_tokens": [
|
|
38
|
+
2000,
|
|
39
|
+
4000
|
|
40
|
+
]
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
"split_rule": "sha256(seed|split|group): even first byte -> dev, odd -> sealed; group = sha256 of the normalised dolly context (else the normalised instruction / question; long: the book); one candidate per group; near-duplicates (>50% shared 12-word shingles with the dev sets or the same split) dropped",
|
|
44
|
+
"selection": "ranked by sha256(seed|rank|split|bucket|key) within the split",
|
|
45
|
+
"secret_sha256": null,
|
|
46
|
+
"secret_rule": null,
|
|
47
|
+
"exclusions": {
|
|
48
|
+
"rows": 19,
|
|
49
|
+
"sha256": "7e90005d3c4f0c9f5f55479b3b6f59379a21dd9853dd03cec509b899f32b6644",
|
|
50
|
+
"rule": "rows listed in exclusions.json or flagged by the private leak-scanner rules"
|
|
51
|
+
},
|
|
52
|
+
"sources": [
|
|
53
|
+
{
|
|
54
|
+
"name": "databricks-dolly-15k",
|
|
55
|
+
"license": "CC-BY-SA-3.0",
|
|
56
|
+
"url": "https://huggingface.co/datasets/databricks/databricks-dolly-15k/resolve/bdd27f4d94b9c1f951818a7da7fd7aeea5dbff1a/databricks-dolly-15k.jsonl",
|
|
57
|
+
"sha256": "2df9083338b4abd6bceb5635764dab5d833b393b55759dffb0959b6fcbf794ec"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"name": "gsm8k-train",
|
|
61
|
+
"license": "MIT",
|
|
62
|
+
"url": "https://raw.githubusercontent.com/openai/grade-school-math/3101c7d5072418e28b9008a6636bde82a006892c/grade_school_math/data/train.jsonl",
|
|
63
|
+
"sha256": "17f347dc51477c50d4efb83959dbb7c56297aba886e5544ee2aaed3024813465"
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"name": "gutenberg-11",
|
|
67
|
+
"title": "Alice's Adventures in Wonderland (Lewis Carroll)",
|
|
68
|
+
"license": "public-domain",
|
|
69
|
+
"url": "https://www.gutenberg.org/cache/epub/11/pg11.txt",
|
|
70
|
+
"sha256": "01b38ea4c710a84bc18d0bd41271a5a1a92b94e97b2812f4dece97d4a694725e"
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"name": "gutenberg-35",
|
|
74
|
+
"title": "The Time Machine (H. G. Wells)",
|
|
75
|
+
"license": "public-domain",
|
|
76
|
+
"url": "https://www.gutenberg.org/cache/epub/35/pg35.txt",
|
|
77
|
+
"sha256": "2892e919000e17c83e1dac51b30f4675db50536b644d7579fe8a89bb399a9bdc"
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"name": "gutenberg-36",
|
|
81
|
+
"title": "The War of the Worlds (H. G. Wells)",
|
|
82
|
+
"license": "public-domain",
|
|
83
|
+
"url": "https://www.gutenberg.org/cache/epub/36/pg36.txt",
|
|
84
|
+
"sha256": "8417469e3ab664749f7b36ebb85799075818207b0380b54c27d07d592a44117d"
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
"name": "gutenberg-43",
|
|
88
|
+
"title": "The Strange Case of Dr Jekyll and Mr Hyde (R. L. Stevenson)",
|
|
89
|
+
"license": "public-domain",
|
|
90
|
+
"url": "https://www.gutenberg.org/cache/epub/43/pg43.txt",
|
|
91
|
+
"sha256": "b43448a88391591f9cf82b25553df00faf47a2752a873185fcdd1156eebdb990"
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
"name": "gutenberg-76",
|
|
95
|
+
"title": "Adventures of Huckleberry Finn (Mark Twain)",
|
|
96
|
+
"license": "public-domain",
|
|
97
|
+
"url": "https://www.gutenberg.org/cache/epub/76/pg76.txt",
|
|
98
|
+
"sha256": "d617a37aa7ae1e1a93dcde2634db2bccb86824e31e29a55230bdbf77d6872d59"
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
"name": "gutenberg-84",
|
|
102
|
+
"title": "Frankenstein (Mary Shelley)",
|
|
103
|
+
"license": "public-domain",
|
|
104
|
+
"url": "https://www.gutenberg.org/cache/epub/84/pg84.txt",
|
|
105
|
+
"sha256": "7810cd483cffcf2cc8a1d8f0d5807931e69d4f48cd14149b8c76f88af82fead3"
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
"name": "gutenberg-98",
|
|
109
|
+
"title": "A Tale of Two Cities (Charles Dickens)",
|
|
110
|
+
"license": "public-domain",
|
|
111
|
+
"url": "https://www.gutenberg.org/cache/epub/98/pg98.txt",
|
|
112
|
+
"sha256": "d54c2b80d40a40b982cd88852c6180bb944d95acdb028af3d0e01a1750681784"
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
"name": "gutenberg-120",
|
|
116
|
+
"title": "Treasure Island (R. L. Stevenson)",
|
|
117
|
+
"license": "public-domain",
|
|
118
|
+
"url": "https://www.gutenberg.org/cache/epub/120/pg120.txt",
|
|
119
|
+
"sha256": "5bc08275eacea8640b1aa185c645283bb8c564d7b23df6b03437d229b4fc6ebd"
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
"name": "gutenberg-158",
|
|
123
|
+
"title": "Emma (Jane Austen)",
|
|
124
|
+
"license": "public-domain",
|
|
125
|
+
"url": "https://www.gutenberg.org/cache/epub/158/pg158.txt",
|
|
126
|
+
"sha256": "532b122b4e6a76cc556d6fdcd729b5892f5c4ce4a1b7060b9f832adfad8680dc"
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
"name": "gutenberg-161",
|
|
130
|
+
"title": "Sense and Sensibility (Jane Austen)",
|
|
131
|
+
"license": "public-domain",
|
|
132
|
+
"url": "https://www.gutenberg.org/cache/epub/161/pg161.txt",
|
|
133
|
+
"sha256": "22272ec4d4da2f50cda51edf34ab8486b325c4a99580120db565fb8917228a22"
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
"name": "gutenberg-174",
|
|
137
|
+
"title": "The Picture of Dorian Gray (Oscar Wilde)",
|
|
138
|
+
"license": "public-domain",
|
|
139
|
+
"url": "https://www.gutenberg.org/cache/epub/174/pg174.txt",
|
|
140
|
+
"sha256": "38f36b510417177aa87a6a24c968e3ec63a447b7df36a9c1a7c5a3f2d9e51547"
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
"name": "gutenberg-215",
|
|
144
|
+
"title": "The Call of the Wild (Jack London)",
|
|
145
|
+
"license": "public-domain",
|
|
146
|
+
"url": "https://www.gutenberg.org/cache/epub/215/pg215.txt",
|
|
147
|
+
"sha256": "30f569c5671bba7bbc4a92ab6d8ee01a0d3be00f994819c77da62c28041eb8a2"
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
"name": "gutenberg-219",
|
|
151
|
+
"title": "Heart of Darkness (Joseph Conrad)",
|
|
152
|
+
"license": "public-domain",
|
|
153
|
+
"url": "https://www.gutenberg.org/cache/epub/219/pg219.txt",
|
|
154
|
+
"sha256": "1bcdf0a1ac611dd6b70a20d100a07085754da4e90a949d6031717b86cd6d020a"
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
"name": "gutenberg-345",
|
|
158
|
+
"title": "Dracula (Bram Stoker)",
|
|
159
|
+
"license": "public-domain",
|
|
160
|
+
"url": "https://www.gutenberg.org/cache/epub/345/pg345.txt",
|
|
161
|
+
"sha256": "96cd16eacdbfebae8fdda5591f66e0cc8ee76be18e0cd1aca02bc00615782d28"
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
"name": "gutenberg-768",
|
|
165
|
+
"title": "Wuthering Heights (Emily Bronte)",
|
|
166
|
+
"license": "public-domain",
|
|
167
|
+
"url": "https://www.gutenberg.org/cache/epub/768/pg768.txt",
|
|
168
|
+
"sha256": "e533fe750589f0421d5d744576315f5c2b9b0d69e981179ea0551bbf134c5e02"
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
"name": "gutenberg-1260",
|
|
172
|
+
"title": "Jane Eyre (Charlotte Bronte)",
|
|
173
|
+
"license": "public-domain",
|
|
174
|
+
"url": "https://www.gutenberg.org/cache/epub/1260/pg1260.txt",
|
|
175
|
+
"sha256": "13414dee2951c3ee731d76d2ffd822016b2479c892162760c5d0eb2aa5fa7631"
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
"name": "gutenberg-1342",
|
|
179
|
+
"title": "Pride and Prejudice (Jane Austen)",
|
|
180
|
+
"license": "public-domain",
|
|
181
|
+
"url": "https://www.gutenberg.org/cache/epub/1342/pg1342.txt",
|
|
182
|
+
"sha256": "3f6bb9d6f78e0293b56acd4714dd68cb7d6d1d293402031ce9d5a216bcaf9d75"
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
"name": "gutenberg-1400",
|
|
186
|
+
"title": "Great Expectations (Charles Dickens)",
|
|
187
|
+
"license": "public-domain",
|
|
188
|
+
"url": "https://www.gutenberg.org/cache/epub/1400/pg1400.txt",
|
|
189
|
+
"sha256": "9a637118af8e953e9764ec603d9b0a032883384d465acac2e27966a80cf1c6f8"
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
"name": "gutenberg-1661",
|
|
193
|
+
"title": "The Adventures of Sherlock Holmes (Arthur Conan Doyle)",
|
|
194
|
+
"license": "public-domain",
|
|
195
|
+
"url": "https://www.gutenberg.org/cache/epub/1661/pg1661.txt",
|
|
196
|
+
"sha256": "922e2a12ccb43a4c9544c260b2166c6ad2097aeb5957faeee113f173bb857cd0"
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
"name": "gutenberg-2554",
|
|
200
|
+
"title": "Crime and Punishment (Fyodor Dostoevsky, tr. Constance Garnett)",
|
|
201
|
+
"license": "public-domain",
|
|
202
|
+
"url": "https://www.gutenberg.org/cache/epub/2554/pg2554.txt",
|
|
203
|
+
"sha256": "d139120965c81f10e3f747d891a49babdb49d986b25f7ab25299b1bbf4731146"
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
"name": "gutenberg-2701",
|
|
207
|
+
"title": "Moby Dick (Herman Melville)",
|
|
208
|
+
"license": "public-domain",
|
|
209
|
+
"url": "https://www.gutenberg.org/cache/epub/2701/pg2701.txt",
|
|
210
|
+
"sha256": "b5e88b71a1cda068e9ab1d94344c9d932338ba6da1a66def97a1aecd9cfcc87d"
|
|
211
|
+
}
|
|
212
|
+
],
|
|
213
|
+
"builder": "scripts/build_prompts.py (inferencekit prompts build / seal)"
|
|
214
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
{
|
|
2
|
+
"format": 1,
|
|
3
|
+
"rule": "source rows the release leak scanner's private rules would flag; listed by position in the source file (keyed by that file's sha256) so a rebuild without the private rules matches",
|
|
4
|
+
"sources": {
|
|
5
|
+
"1bcdf0a1ac611dd6b70a20d100a07085754da4e90a949d6031717b86cd6d020a": "gutenberg-219",
|
|
6
|
+
"2892e919000e17c83e1dac51b30f4675db50536b644d7579fe8a89bb399a9bdc": "gutenberg-35",
|
|
7
|
+
"2df9083338b4abd6bceb5635764dab5d833b393b55759dffb0959b6fcbf794ec": "databricks-dolly-15k",
|
|
8
|
+
"7810cd483cffcf2cc8a1d8f0d5807931e69d4f48cd14149b8c76f88af82fead3": "gutenberg-84",
|
|
9
|
+
"8417469e3ab664749f7b36ebb85799075818207b0380b54c27d07d592a44117d": "gutenberg-36",
|
|
10
|
+
"b43448a88391591f9cf82b25553df00faf47a2752a873185fcdd1156eebdb990": "gutenberg-43",
|
|
11
|
+
"b5e88b71a1cda068e9ab1d94344c9d932338ba6da1a66def97a1aecd9cfcc87d": "gutenberg-2701",
|
|
12
|
+
"d139120965c81f10e3f747d891a49babdb49d986b25f7ab25299b1bbf4731146": "gutenberg-2554",
|
|
13
|
+
"d54c2b80d40a40b982cd88852c6180bb944d95acdb028af3d0e01a1750681784": "gutenberg-98"
|
|
14
|
+
},
|
|
15
|
+
"excluded": {
|
|
16
|
+
"1bcdf0a1ac611dd6b70a20d100a07085754da4e90a949d6031717b86cd6d020a": [
|
|
17
|
+
"gutenberg:219:passage0",
|
|
18
|
+
"gutenberg:219:passage1"
|
|
19
|
+
],
|
|
20
|
+
"2892e919000e17c83e1dac51b30f4675db50536b644d7579fe8a89bb399a9bdc": [
|
|
21
|
+
"gutenberg:35:passage2",
|
|
22
|
+
"gutenberg:35:passage5"
|
|
23
|
+
],
|
|
24
|
+
"2df9083338b4abd6bceb5635764dab5d833b393b55759dffb0959b6fcbf794ec": [
|
|
25
|
+
"dolly:row5363",
|
|
26
|
+
"dolly:row6271",
|
|
27
|
+
"dolly:row8117",
|
|
28
|
+
"dolly:row8205",
|
|
29
|
+
"dolly:row9651",
|
|
30
|
+
"dolly:row11219",
|
|
31
|
+
"dolly:row11284"
|
|
32
|
+
],
|
|
33
|
+
"7810cd483cffcf2cc8a1d8f0d5807931e69d4f48cd14149b8c76f88af82fead3": [
|
|
34
|
+
"gutenberg:84:passage1"
|
|
35
|
+
],
|
|
36
|
+
"8417469e3ab664749f7b36ebb85799075818207b0380b54c27d07d592a44117d": [
|
|
37
|
+
"gutenberg:36:passage4"
|
|
38
|
+
],
|
|
39
|
+
"b43448a88391591f9cf82b25553df00faf47a2752a873185fcdd1156eebdb990": [
|
|
40
|
+
"gutenberg:43:passage0"
|
|
41
|
+
],
|
|
42
|
+
"b5e88b71a1cda068e9ab1d94344c9d932338ba6da1a66def97a1aecd9cfcc87d": [
|
|
43
|
+
"gutenberg:2701:passage0",
|
|
44
|
+
"gutenberg:2701:passage1",
|
|
45
|
+
"gutenberg:2701:passage3"
|
|
46
|
+
],
|
|
47
|
+
"d139120965c81f10e3f747d891a49babdb49d986b25f7ab25299b1bbf4731146": [
|
|
48
|
+
"gutenberg:2554:passage3"
|
|
49
|
+
],
|
|
50
|
+
"d54c2b80d40a40b982cd88852c6180bb944d95acdb028af3d0e01a1750681784": [
|
|
51
|
+
"gutenberg:98:passage2"
|
|
52
|
+
]
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"""Quality checks for LLM engines: does a faster engine still produce the model's output?
|
|
2
|
+
|
|
3
|
+
Two complementary packs (the operations live in ``inferencekit.ops.quality``):
|
|
4
|
+
|
|
5
|
+
* **Trajectory scoring** (``quality trajectory`` then ``quality score``): every engine
|
|
6
|
+
generates its own greedy text with top-k logprobs; a higher-precision reference
|
|
7
|
+
(e.g. vLLM serving BF16) then re-reads that exact text token by token ("teacher
|
|
8
|
+
forcing") and reports, per position bucket, top-1 agreement, KL(reference || engine),
|
|
9
|
+
the reference's negative log-likelihood of the engine's tokens, and where the engine
|
|
10
|
+
first leaves the reference's own greedy path. An A/A run of the reference against
|
|
11
|
+
itself gives the noise floor every engine is judged against.
|
|
12
|
+
* **Task accuracy** (``quality gsm8k``): GSM8K test split, zero-shot chain of thought,
|
|
13
|
+
exact numeric answer match, with a Wilson CI and McNemar's exact test for pairs.
|
|
14
|
+
|
|
15
|
+
Module map:
|
|
16
|
+
metrics.py KL on truncated top-k lists, position buckets, bootstrap CIs, Wilson, McNemar
|
|
17
|
+
client.py a tiny stdlib OpenAI-compatible HTTP client
|
|
18
|
+
logprobs.py parse chat-completion logprobs and vLLM prompt_logprobs into token ids
|
|
19
|
+
gsm8k.py the GSM8K test split (pinned HF download, sha256-checked, cached), prompt and
|
|
20
|
+
answer extraction
|
|
21
|
+
parquet.py a dependency-free reader for the flat Parquet file that split comes in
|
|
22
|
+
fake.py a deterministic fake OpenAI-compatible server (tests and dry runs)
|
|
23
|
+
"""
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"""A tiny OpenAI-compatible HTTP client (stdlib only; no streaming: quality runs need whole responses).
|
|
2
|
+
|
|
3
|
+
The API key, if any, is read from an environment variable whose *name* the caller gives
|
|
4
|
+
(default ``OPENAI_API_KEY``); its value is sent as a bearer token and never recorded.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
from __future__ import annotations
|
|
8
|
+
|
|
9
|
+
import json
|
|
10
|
+
import os
|
|
11
|
+
import urllib.error
|
|
12
|
+
import urllib.request
|
|
13
|
+
|
|
14
|
+
from inferencekit.registry import OpError
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class HTTPError(OpError):
|
|
18
|
+
"""A non-2xx answer from the server; ``status`` and ``message`` come from its body when it has one."""
|
|
19
|
+
|
|
20
|
+
def __init__(self, url: str, status: int, message: str):
|
|
21
|
+
super().__init__(f"{url}: HTTP {status}: {message[:500]}")
|
|
22
|
+
self.status = status
|
|
23
|
+
self.message = message
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
class Client:
|
|
27
|
+
def __init__(self, base_url: str, api_key_env: str | None = "OPENAI_API_KEY", timeout: float = 600):
|
|
28
|
+
self.base = base_url.rstrip("/")
|
|
29
|
+
if self.base.endswith("/v1"):
|
|
30
|
+
self.base = self.base[:-3]
|
|
31
|
+
self.timeout = timeout
|
|
32
|
+
self._key = os.environ.get(api_key_env) if api_key_env else None
|
|
33
|
+
|
|
34
|
+
def url(self, path: str) -> str:
|
|
35
|
+
return self.base + path
|
|
36
|
+
|
|
37
|
+
def _request(self, path: str, body: dict | None) -> dict:
|
|
38
|
+
url = self.url(path)
|
|
39
|
+
data = None if body is None else json.dumps(body).encode()
|
|
40
|
+
req = urllib.request.Request(url, data=data, method="GET" if body is None else "POST")
|
|
41
|
+
req.add_header("Content-Type", "application/json")
|
|
42
|
+
if self._key:
|
|
43
|
+
req.add_header("Authorization", f"Bearer {self._key}")
|
|
44
|
+
try:
|
|
45
|
+
with urllib.request.urlopen(req, timeout=self.timeout) as resp:
|
|
46
|
+
return json.loads(resp.read().decode("utf-8"))
|
|
47
|
+
except urllib.error.HTTPError as e:
|
|
48
|
+
raw = e.read().decode("utf-8", "replace")
|
|
49
|
+
try:
|
|
50
|
+
obj = json.loads(raw)
|
|
51
|
+
err = obj.get("error", obj)
|
|
52
|
+
msg = err.get("message") if isinstance(err, dict) else str(err)
|
|
53
|
+
msg = msg or obj.get("detail") or raw
|
|
54
|
+
except (ValueError, AttributeError):
|
|
55
|
+
msg = raw
|
|
56
|
+
raise HTTPError(url, e.code, str(msg)) from None
|
|
57
|
+
except (urllib.error.URLError, OSError) as e:
|
|
58
|
+
raise OpError(f"{url}: cannot connect ({getattr(e, 'reason', e)})") from None
|
|
59
|
+
except ValueError:
|
|
60
|
+
raise OpError(f"{url}: response is not JSON") from None
|
|
61
|
+
|
|
62
|
+
def post(self, path: str, body: dict) -> dict:
|
|
63
|
+
return self._request(path, body)
|
|
64
|
+
|
|
65
|
+
def get(self, path: str) -> dict:
|
|
66
|
+
return self._request(path, None)
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2021 OpenAI
|
|
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.
|