evalrouter 0.3.7__tar.gz → 0.3.9__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 (42) hide show
  1. {evalrouter-0.3.7 → evalrouter-0.3.9}/PKG-INFO +135 -14
  2. {evalrouter-0.3.7 → evalrouter-0.3.9}/README.md +134 -13
  3. {evalrouter-0.3.7 → evalrouter-0.3.9}/pyproject.toml +1 -1
  4. {evalrouter-0.3.7 → evalrouter-0.3.9}/src/evalrouter_contracts/__init__.py +1 -1
  5. {evalrouter-0.3.7 → evalrouter-0.3.9}/src/kimpton_evalrouter/__init__.py +6 -1
  6. {evalrouter-0.3.7 → evalrouter-0.3.9}/src/kimpton_evalrouter/_account.py +134 -9
  7. {evalrouter-0.3.7 → evalrouter-0.3.9}/src/kimpton_evalrouter/_comparison.py +690 -32
  8. evalrouter-0.3.9/src/kimpton_evalrouter/_comparison_html.py +690 -0
  9. {evalrouter-0.3.7 → evalrouter-0.3.9}/src/kimpton_evalrouter/_guided.py +1432 -112
  10. {evalrouter-0.3.7 → evalrouter-0.3.9}/src/kimpton_evalrouter/_listing.py +153 -11
  11. evalrouter-0.3.9/src/kimpton_evalrouter/_progress.py +190 -0
  12. evalrouter-0.3.9/src/kimpton_evalrouter/_read_cache.py +399 -0
  13. evalrouter-0.3.9/src/kimpton_evalrouter/_report_pareto.py +870 -0
  14. evalrouter-0.3.9/src/kimpton_evalrouter/_report_theme.py +249 -0
  15. {evalrouter-0.3.7 → evalrouter-0.3.9}/src/kimpton_evalrouter/_resources.py +98 -0
  16. {evalrouter-0.3.7 → evalrouter-0.3.9}/src/kimpton_evalrouter/cli.py +1585 -130
  17. {evalrouter-0.3.7 → evalrouter-0.3.9}/src/kimpton_evalrouter/render/__init__.py +3 -1
  18. {evalrouter-0.3.7 → evalrouter-0.3.9}/src/kimpton_evalrouter/render/live.py +222 -106
  19. {evalrouter-0.3.7 → evalrouter-0.3.9}/src/kimpton_evalrouter/render/picker.py +187 -2
  20. {evalrouter-0.3.7 → evalrouter-0.3.9}/src/kimpton_evalrouter/render/screens.py +385 -125
  21. {evalrouter-0.3.7 → evalrouter-0.3.9}/src/kimpton_evalrouter/render/tables.py +16 -3
  22. {evalrouter-0.3.7 → evalrouter-0.3.9}/src/kimpton_evalrouter/types.py +423 -3
  23. evalrouter-0.3.7/src/kimpton_evalrouter/_comparison_html.py +0 -233
  24. {evalrouter-0.3.7 → evalrouter-0.3.9}/LICENSE +0 -0
  25. {evalrouter-0.3.7 → evalrouter-0.3.9}/src/evalrouter_contracts/bundle.py +0 -0
  26. {evalrouter-0.3.7 → evalrouter-0.3.9}/src/evalrouter_contracts/components.py +0 -0
  27. {evalrouter-0.3.7 → evalrouter-0.3.9}/src/evalrouter_contracts/models.py +0 -0
  28. {evalrouter-0.3.7 → evalrouter-0.3.9}/src/evalrouter_contracts/protocol.py +0 -0
  29. {evalrouter-0.3.7 → evalrouter-0.3.9}/src/evalrouter_contracts/py.typed +0 -0
  30. {evalrouter-0.3.7 → evalrouter-0.3.9}/src/evalrouter_contracts/templates.py +0 -0
  31. {evalrouter-0.3.7 → evalrouter-0.3.9}/src/evalrouter_contracts/validation.py +0 -0
  32. {evalrouter-0.3.7 → evalrouter-0.3.9}/src/kimpton_evalrouter/__main__.py +0 -0
  33. {evalrouter-0.3.7 → evalrouter-0.3.9}/src/kimpton_evalrouter/_artifacts.py +0 -0
  34. {evalrouter-0.3.7 → evalrouter-0.3.9}/src/kimpton_evalrouter/_boundary.py +0 -0
  35. {evalrouter-0.3.7 → evalrouter-0.3.9}/src/kimpton_evalrouter/_helpers.py +0 -0
  36. {evalrouter-0.3.7 → evalrouter-0.3.9}/src/kimpton_evalrouter/_transport.py +0 -0
  37. {evalrouter-0.3.7 → evalrouter-0.3.9}/src/kimpton_evalrouter/langsmith.py +0 -0
  38. {evalrouter-0.3.7 → evalrouter-0.3.9}/src/kimpton_evalrouter/py.typed +0 -0
  39. {evalrouter-0.3.7 → evalrouter-0.3.9}/src/kimpton_evalrouter/render/_console.py +0 -0
  40. {evalrouter-0.3.7 → evalrouter-0.3.9}/src/kimpton_evalrouter/render/_theme.py +0 -0
  41. {evalrouter-0.3.7 → evalrouter-0.3.9}/src/kimpton_evalrouter/render/_widgets.py +0 -0
  42. {evalrouter-0.3.7 → evalrouter-0.3.9}/src/kimpton_evalrouter/tracing.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: evalrouter
3
- Version: 0.3.7
3
+ Version: 0.3.9
4
4
  Summary: Typed Kimpton evaluation client and command-line interface
5
5
  License-Expression: LicenseRef-Kimpton-EvalRouter-SDK
6
6
  License-File: LICENSE
@@ -110,18 +110,92 @@ The idempotency key of each accepted quote is saved locally before the run is
110
110
  submitted (`~/.local/state/evalrouter`, or `EVALROUTER_STATE_DIR`; identifiers
111
111
  only, never credentials). Repeating the same command after a dropped connection
112
112
  resumes that run instead of starting another; `--new` starts a separate one.
113
- Afterwards, `results`, `export --format html,json`, `wait` and `open` default to
114
- your last run and accept a unique run ID prefix. `results --diff` also compares
113
+ Afterwards, `results RUN`, `export RUN --format html,json` and `wait RUN`
114
+ take the run's ID or a unique prefix of it. `results --diff` also compares
115
115
  with the previous run of the same benchmark and model; that takes a few more
116
- requests, so plain `results` does not. Watching a run survives brief API
117
- outages such as a 503 during a deployment.
116
+ requests, so plain `results` does not. `run --from RUN` runs an earlier
117
+ evaluation again as a new run with the same setup; other `run` options override
118
+ it. Watching a run survives brief API
119
+ outages such as a 503 during a deployment. If the API stays unreachable for
120
+ 90 seconds (`--disconnect-timeout SECONDS`), the CLI stops watching, says so and
121
+ prints the `evalrouter wait` command that reattaches; the run continues.
122
+
123
+ ## Resume a stopped run
124
+
125
+ ```sh
126
+ evalrouter resume RUN_ID --dry-run
127
+ evalrouter resume RUN_ID
128
+ ```
129
+
130
+ When a run stops early, for example because it reached its spending cap,
131
+ `resume` quotes a new run that covers the same tasks. Tasks the original run
132
+ already graded are reused at $0, with no model request and no fee; only the
133
+ remaining tasks are rerun and charged, within a new cap. The quote shows the
134
+ source run, how many tasks are reused and rerun, which are left out and why,
135
+ the worst case, the cap, and when the reusable evidence and the quote expire.
136
+ Only a yes (or `--yes`) starts paid work; `--dry-run` never does. Without a
137
+ terminal, pass both `--yes` and `--max-cost USD`. A running run is only
138
+ watched. The original run and its results are never changed.
139
+
140
+ The accepted quote and its key are saved locally before submission, so
141
+ repeating the command after a dropped connection, or after adding credit when
142
+ the account was short, submits the same quote and cannot start a second run.
143
+ An expired quote is replaced by a fresh one, which must be confirmed again if
144
+ its cap differs. Repeating it with a different `--max-cost` or
145
+ `--include-cancelled` choice gets a fresh quote instead; if the earlier
146
+ submission already started a run, that run is shown and its scope stays as
147
+ accepted. A run can be resumed once: `resume` on a run that was already
148
+ resumed follows it to the newest run of that chain. A newest run that is still
149
+ running is watched; a finished one is quoted and asked about again, even with
150
+ `--yes`, and scripts are refused with its ID (`continuation_exists`, exit 2).
151
+ Tasks stopped by cancellation or the time limit are rerun only with
152
+ `--include-cancelled`.
153
+
154
+ Refused tasks and cancellations omitted without `--include-cancelled` remain
155
+ excluded from this and every later resume. The quote asks you to acknowledge
156
+ those permanent exclusions; scripts need `--accept-left-out`.
157
+
158
+ New quotes show unresolved effects separately as **Pending**. Safe tasks can
159
+ continue while those cells retain their original provenance. A later resume
160
+ rechecks the original outcome and can run it only when it is genuinely safe;
161
+ a waived charge with an unknown provider outcome does not qualify. Nothing
162
+ retries automatically. Older quotes without pending provenance keep their
163
+ original permanent exclusions, except that an unknown provider outcome can be
164
+ offered for one explicit new attempt (below).
165
+
166
+ A task whose provider call failed is decided from that call's record, never
167
+ from its error name. If its original answer was stored, the resume grades that
168
+ stored answer at no charge, with no new request (`saved_response_cells`). If the
169
+ call is still unresolved, the quote says when reconciliation settles it (up to
170
+ 24 hours after it started). If the outcome is uncertain (the provider may have
171
+ processed the request; your charge for it was waived) or the provider did not
172
+ bill a transient failure, nothing retries it on its own: `--retry-unknown`
173
+ consents to pay for **one** new attempt of each such task, once ever, within
174
+ the same cap. The original outcome and charge stay unchanged, and a late
175
+ original answer never adds a charge. `--retry-unknown-max N` refuses (never
176
+ trims) a quote with more such tasks. With your own provider connection, that
177
+ provider may bill both requests, so `--accept-duplicate-provider-charges` is
178
+ also required. The JSON quote reports these as `continuation.unknown_retry`.
179
+
180
+ Resume supports one model, one benchmark and one attempt per task on the
181
+ reviewed native benchmark families (Inspect, SOB text and lm-eval) without a
182
+ judge model, within the source run's evidence retention and on the same
183
+ EvalRouter deployment. Comparisons, several benchmarks or attempts, judge-graded
184
+ benchmarks, repository agents and your own benchmarks are refused rather than
185
+ rerun. Graded tasks from runs that finished before resume evidence was recorded,
186
+ including existing runs, cannot gain that evidence later, and results are
187
+ never reused across EvalRouter deployments: after a deployment, those tasks are
188
+ refused rather than reused or rerun. Tasks whose earlier charge or provider
189
+ outcome is unresolved are never called until a fresh quote proves eligibility. A server without resume
190
+ says so, and nothing is quoted or charged.
118
191
 
119
192
  ## Lists
120
193
 
121
194
  `catalog`, `catalog --models`, `status`, `connections list` and `workspace list`
122
195
  print a compact table sized to your terminal with one suggested next command;
123
196
  `catalog` hides benchmarks in review or unavailable unless you pass `--all`, and
124
- `catalog -i` browses them interactively. Every list accepts `--json`,
197
+ `catalog -i` browses them interactively; `status -i` keeps your run list live and
198
+ opens a run with Enter. Every list accepts `--json`,
125
199
  `--jq '.data[].id'` (a small jq subset), `-w/--wide`, `--columns a,b`,
126
200
  `--sort COL` (`--sort=-COL` descending), `--filter KEY=VALUE` and `--limit N`.
127
201
  Piped output stays JSON. Colour follows `NO_COLOR`, `CI` and `TERM=dumb`.
@@ -142,6 +216,21 @@ evalrouter catalog --slug BENCHMARK_SLUG --json
142
216
  Choose a profile whose `quote_availability.status` is `ready_for_quote` and a
143
217
  compatible managed model route from those responses. An active catalog entry
144
218
  alone does not mean it is ready to run.
219
+
220
+ These three catalog reads are public, so the CLI sends them without your
221
+ credentials: they never read the keychain or refresh a sign-in. If the API
222
+ explicitly allows it (`Cache-Control` with `max-age`, and no `no-store`,
223
+ `no-cache` or `private`), the CLI keeps a local copy for at most five minutes
224
+ and says so on stderr when it uses one. `--refresh` reads the catalog now,
225
+ asking caches along the way to revalidate, and fails rather than show an older copy, and `--offline` uses only a fresh local
226
+ copy with no network. When a server marks a response `no-store`, the command still makes a request
227
+ and no offline copy is retained. Availability shown from a copy is informational: a quote always
228
+ checks it again. Workspace data, run status, results, quotes, credits and signed
229
+ URLs are never cached. The copy lives in `$XDG_CACHE_HOME/evalrouter` (or
230
+ `~/.cache/evalrouter`; `%LOCALAPPDATA%\evalrouter\cache` on Windows, or
231
+ `EVALROUTER_CACHE_DIR`), may be deleted at any time, and
232
+ `EVALROUTER_READ_CACHE=off` disables it.
233
+
145
234
  Save this as `quote.json`, replacing both uppercase identifiers:
146
235
 
147
236
  ```json
@@ -196,8 +285,12 @@ evalrouter compare RUN_ID RUN_ID --format html --output my-comparison
196
285
  task population, task selection and output format in one workspace. Each run
197
286
  must be a managed or connected model run; comparison, agent and environment
198
287
  runs are refused, and so is a run whose export does not record one of these
199
- identities. It downloads each run's JSON export again and saves
200
- `comparison.json` and `sources/<run>.json` in a new private directory.
288
+ identities. It reads each run's summary export (`export?format=summary`:
289
+ identities, frozen native summary, coverage, billing snapshot and export
290
+ policy, with no sample rows) and saves `comparison.json` and
291
+ `sources/<run>.summary.json` in a new private directory. `--evidence`
292
+ downloads each run's full JSON export instead (`sources/<run>.json`) and also
293
+ compares grader versions and graded task sets; the scores are the same.
201
294
  `comparison.json` holds each run's model identity (route, revision, protocol,
202
295
  recorded limits, generation and routing settings), coverage, errors, its
203
296
  frozen native summary with the headline's own denominator, and its settled
@@ -205,13 +298,27 @@ EvalRouter charge. A run that did not complete, or graded fewer tasks than
205
298
  planned, is marked partial in `comparison.json` and in its own row of the
206
299
  terminal table.
207
300
 
208
- `sources/` keeps each export byte for byte, with its SHA-256 recorded. By
209
- default every graded sample must carry its scored answer: the final completion
301
+ For SOB Text runs that were continued (`evalrouter resume`), add
302
+ `--include-resumed` (`--chain` is the same flag): each ID then names one
303
+ chain, meaning the original run and its resumes, and the chain becomes one
304
+ series. The service decides every task from the one run that graded it,
305
+ re-derives the SOB native summary with the benchmark authors' code, and keeps
306
+ ungraded tasks as errors with their codes. Each score is shown with its runs
307
+ ("original + 1 resume") and its graded-of-planned count. If a resume replayed
308
+ a reused answer and got a different score (`reuse_score_mismatch`), the
309
+ report warns and the chain is not complete. `evalrouter export RUN
310
+ --include-resumed` saves that chain result by itself. The command follows
311
+ each run to its newest resume at the time you run it, so a later resume makes
312
+ it return a longer chain; the saved chain documents keep the exact version.
313
+
314
+ `sources/` keeps each export byte for byte, with its SHA-256 recorded. With
315
+ `--evidence`, every graded sample must carry its scored answer by default: the final completion
210
316
  text for SOB, plus the per-sample metadata the export supplies (for SOB, the
211
317
  response's token counts and finish reason). Exports do not contain complete
212
318
  transcripts, reasoning, timings or per-attempt usage. Keep these files
213
- private. Use `--without-raw` to archive runs whose answers have expired or
214
- are withheld by the export policy. Different transports, limits or generation
319
+ private. Use `--without-raw` (which implies `--evidence`) to archive runs
320
+ whose answers have expired or are withheld by the export policy. A chain
321
+ summary report downloads member exports only with `--evidence`. Different transports, limits or generation
215
322
  settings are listed as warnings. Nothing is regraded, and no deltas,
216
323
  intervals or winner are computed. `--output NAME.json` puts the sources in
217
324
  `NAME-sources/`.
@@ -219,9 +326,13 @@ intervals or winner are computed. `--output NAME.json` puts the sources in
219
326
  ## Supported commands
220
327
 
221
328
  `catalog` (`--models`, `--slug` or `--environment`), `connections list/create/check/update/disable`,
222
- `quote`, `run`, `status`, `wait`, `cancel`, `results`, `export`, `compare` and `open`.
329
+ `quote`, `run`, `resume`, `status`, `wait`, `cancel`, `results`, `export`, `compare` and `open`.
223
330
  Repository qualification uses `agent-builds options/preview/create/list/status/cancel`.
224
331
  Authoring your own benchmark package uses `benchmark init/validate/bundle`.
332
+ `credits` shows the workspace balance, the amount held by running evaluations
333
+ and what is available for new ones. It works with an `evalrouter login` sign-in
334
+ or an API key with the `billing:read` scope. Credit is added on the website under
335
+ Settings > Billing; the CLI never takes a payment.
225
336
  Run each command with `--help` for exact flags. A connected model's credential
226
337
  is never a command argument: `connections create` asks with hidden input in a
227
338
  terminal, and scripts use `--key-stdin` or `--key-env NAME`
@@ -233,11 +344,21 @@ an interactive terminal, with a percentage when validated processed and planned
233
344
  counts are available. Use `--progress plain` for structured progress or
234
345
  `--progress off` to suppress it. Redirected stderr and `--json` retain structured
235
346
  progress. A progress percentage counts processed samples; it is not a score.
347
+ `--progress json` writes `evalrouter.progress.v1` records on stderr, on every
348
+ change and every 30 seconds: phase, processed and planned counts, errors,
349
+ spend and elapsed time. `evalrouter events RUN --follow` prints the run's
350
+ event log as JSON lines until it ends; `--type`, `--tail N` and `--after N`
351
+ filter, start from the end and resume.
352
+ `evalrouter open RUN` opens the run's live report page, also when an agent
353
+ runs it with `--json`; `run --open` opens it as soon as the run starts. No
354
+ browser opens in CI, over SSH, without a display, with `--no-browser` or with
355
+ `EVALROUTER_NO_BROWSER=1`; the address is printed instead.
236
356
 
237
357
  Use `--config -` for JSON on stdin. `--json` writes one result on stdout and
238
358
  progress on stderr. Exit codes: 0 success; 1 API/transport or failed run;
239
359
  2 invalid input or rejected request (including a refused unattended `run`);
240
- 4 partial/cancelled waited run; 5 confirmation declined, nothing started. Interrupting
360
+ 4 partial/cancelled waited run; 5 confirmation declined, nothing started;
361
+ 6 stopped watching because the API stayed unreachable. Interrupting
241
362
  a local wait does not cancel server work. Use `evalrouter cancel RUN_ID`
242
363
  explicitly when cancellation is intended.
243
364
 
@@ -90,18 +90,92 @@ The idempotency key of each accepted quote is saved locally before the run is
90
90
  submitted (`~/.local/state/evalrouter`, or `EVALROUTER_STATE_DIR`; identifiers
91
91
  only, never credentials). Repeating the same command after a dropped connection
92
92
  resumes that run instead of starting another; `--new` starts a separate one.
93
- Afterwards, `results`, `export --format html,json`, `wait` and `open` default to
94
- your last run and accept a unique run ID prefix. `results --diff` also compares
93
+ Afterwards, `results RUN`, `export RUN --format html,json` and `wait RUN`
94
+ take the run's ID or a unique prefix of it. `results --diff` also compares
95
95
  with the previous run of the same benchmark and model; that takes a few more
96
- requests, so plain `results` does not. Watching a run survives brief API
97
- outages such as a 503 during a deployment.
96
+ requests, so plain `results` does not. `run --from RUN` runs an earlier
97
+ evaluation again as a new run with the same setup; other `run` options override
98
+ it. Watching a run survives brief API
99
+ outages such as a 503 during a deployment. If the API stays unreachable for
100
+ 90 seconds (`--disconnect-timeout SECONDS`), the CLI stops watching, says so and
101
+ prints the `evalrouter wait` command that reattaches; the run continues.
102
+
103
+ ## Resume a stopped run
104
+
105
+ ```sh
106
+ evalrouter resume RUN_ID --dry-run
107
+ evalrouter resume RUN_ID
108
+ ```
109
+
110
+ When a run stops early, for example because it reached its spending cap,
111
+ `resume` quotes a new run that covers the same tasks. Tasks the original run
112
+ already graded are reused at $0, with no model request and no fee; only the
113
+ remaining tasks are rerun and charged, within a new cap. The quote shows the
114
+ source run, how many tasks are reused and rerun, which are left out and why,
115
+ the worst case, the cap, and when the reusable evidence and the quote expire.
116
+ Only a yes (or `--yes`) starts paid work; `--dry-run` never does. Without a
117
+ terminal, pass both `--yes` and `--max-cost USD`. A running run is only
118
+ watched. The original run and its results are never changed.
119
+
120
+ The accepted quote and its key are saved locally before submission, so
121
+ repeating the command after a dropped connection, or after adding credit when
122
+ the account was short, submits the same quote and cannot start a second run.
123
+ An expired quote is replaced by a fresh one, which must be confirmed again if
124
+ its cap differs. Repeating it with a different `--max-cost` or
125
+ `--include-cancelled` choice gets a fresh quote instead; if the earlier
126
+ submission already started a run, that run is shown and its scope stays as
127
+ accepted. A run can be resumed once: `resume` on a run that was already
128
+ resumed follows it to the newest run of that chain. A newest run that is still
129
+ running is watched; a finished one is quoted and asked about again, even with
130
+ `--yes`, and scripts are refused with its ID (`continuation_exists`, exit 2).
131
+ Tasks stopped by cancellation or the time limit are rerun only with
132
+ `--include-cancelled`.
133
+
134
+ Refused tasks and cancellations omitted without `--include-cancelled` remain
135
+ excluded from this and every later resume. The quote asks you to acknowledge
136
+ those permanent exclusions; scripts need `--accept-left-out`.
137
+
138
+ New quotes show unresolved effects separately as **Pending**. Safe tasks can
139
+ continue while those cells retain their original provenance. A later resume
140
+ rechecks the original outcome and can run it only when it is genuinely safe;
141
+ a waived charge with an unknown provider outcome does not qualify. Nothing
142
+ retries automatically. Older quotes without pending provenance keep their
143
+ original permanent exclusions, except that an unknown provider outcome can be
144
+ offered for one explicit new attempt (below).
145
+
146
+ A task whose provider call failed is decided from that call's record, never
147
+ from its error name. If its original answer was stored, the resume grades that
148
+ stored answer at no charge, with no new request (`saved_response_cells`). If the
149
+ call is still unresolved, the quote says when reconciliation settles it (up to
150
+ 24 hours after it started). If the outcome is uncertain (the provider may have
151
+ processed the request; your charge for it was waived) or the provider did not
152
+ bill a transient failure, nothing retries it on its own: `--retry-unknown`
153
+ consents to pay for **one** new attempt of each such task, once ever, within
154
+ the same cap. The original outcome and charge stay unchanged, and a late
155
+ original answer never adds a charge. `--retry-unknown-max N` refuses (never
156
+ trims) a quote with more such tasks. With your own provider connection, that
157
+ provider may bill both requests, so `--accept-duplicate-provider-charges` is
158
+ also required. The JSON quote reports these as `continuation.unknown_retry`.
159
+
160
+ Resume supports one model, one benchmark and one attempt per task on the
161
+ reviewed native benchmark families (Inspect, SOB text and lm-eval) without a
162
+ judge model, within the source run's evidence retention and on the same
163
+ EvalRouter deployment. Comparisons, several benchmarks or attempts, judge-graded
164
+ benchmarks, repository agents and your own benchmarks are refused rather than
165
+ rerun. Graded tasks from runs that finished before resume evidence was recorded,
166
+ including existing runs, cannot gain that evidence later, and results are
167
+ never reused across EvalRouter deployments: after a deployment, those tasks are
168
+ refused rather than reused or rerun. Tasks whose earlier charge or provider
169
+ outcome is unresolved are never called until a fresh quote proves eligibility. A server without resume
170
+ says so, and nothing is quoted or charged.
98
171
 
99
172
  ## Lists
100
173
 
101
174
  `catalog`, `catalog --models`, `status`, `connections list` and `workspace list`
102
175
  print a compact table sized to your terminal with one suggested next command;
103
176
  `catalog` hides benchmarks in review or unavailable unless you pass `--all`, and
104
- `catalog -i` browses them interactively. Every list accepts `--json`,
177
+ `catalog -i` browses them interactively; `status -i` keeps your run list live and
178
+ opens a run with Enter. Every list accepts `--json`,
105
179
  `--jq '.data[].id'` (a small jq subset), `-w/--wide`, `--columns a,b`,
106
180
  `--sort COL` (`--sort=-COL` descending), `--filter KEY=VALUE` and `--limit N`.
107
181
  Piped output stays JSON. Colour follows `NO_COLOR`, `CI` and `TERM=dumb`.
@@ -122,6 +196,21 @@ evalrouter catalog --slug BENCHMARK_SLUG --json
122
196
  Choose a profile whose `quote_availability.status` is `ready_for_quote` and a
123
197
  compatible managed model route from those responses. An active catalog entry
124
198
  alone does not mean it is ready to run.
199
+
200
+ These three catalog reads are public, so the CLI sends them without your
201
+ credentials: they never read the keychain or refresh a sign-in. If the API
202
+ explicitly allows it (`Cache-Control` with `max-age`, and no `no-store`,
203
+ `no-cache` or `private`), the CLI keeps a local copy for at most five minutes
204
+ and says so on stderr when it uses one. `--refresh` reads the catalog now,
205
+ asking caches along the way to revalidate, and fails rather than show an older copy, and `--offline` uses only a fresh local
206
+ copy with no network. When a server marks a response `no-store`, the command still makes a request
207
+ and no offline copy is retained. Availability shown from a copy is informational: a quote always
208
+ checks it again. Workspace data, run status, results, quotes, credits and signed
209
+ URLs are never cached. The copy lives in `$XDG_CACHE_HOME/evalrouter` (or
210
+ `~/.cache/evalrouter`; `%LOCALAPPDATA%\evalrouter\cache` on Windows, or
211
+ `EVALROUTER_CACHE_DIR`), may be deleted at any time, and
212
+ `EVALROUTER_READ_CACHE=off` disables it.
213
+
125
214
  Save this as `quote.json`, replacing both uppercase identifiers:
126
215
 
127
216
  ```json
@@ -176,8 +265,12 @@ evalrouter compare RUN_ID RUN_ID --format html --output my-comparison
176
265
  task population, task selection and output format in one workspace. Each run
177
266
  must be a managed or connected model run; comparison, agent and environment
178
267
  runs are refused, and so is a run whose export does not record one of these
179
- identities. It downloads each run's JSON export again and saves
180
- `comparison.json` and `sources/<run>.json` in a new private directory.
268
+ identities. It reads each run's summary export (`export?format=summary`:
269
+ identities, frozen native summary, coverage, billing snapshot and export
270
+ policy, with no sample rows) and saves `comparison.json` and
271
+ `sources/<run>.summary.json` in a new private directory. `--evidence`
272
+ downloads each run's full JSON export instead (`sources/<run>.json`) and also
273
+ compares grader versions and graded task sets; the scores are the same.
181
274
  `comparison.json` holds each run's model identity (route, revision, protocol,
182
275
  recorded limits, generation and routing settings), coverage, errors, its
183
276
  frozen native summary with the headline's own denominator, and its settled
@@ -185,13 +278,27 @@ EvalRouter charge. A run that did not complete, or graded fewer tasks than
185
278
  planned, is marked partial in `comparison.json` and in its own row of the
186
279
  terminal table.
187
280
 
188
- `sources/` keeps each export byte for byte, with its SHA-256 recorded. By
189
- default every graded sample must carry its scored answer: the final completion
281
+ For SOB Text runs that were continued (`evalrouter resume`), add
282
+ `--include-resumed` (`--chain` is the same flag): each ID then names one
283
+ chain, meaning the original run and its resumes, and the chain becomes one
284
+ series. The service decides every task from the one run that graded it,
285
+ re-derives the SOB native summary with the benchmark authors' code, and keeps
286
+ ungraded tasks as errors with their codes. Each score is shown with its runs
287
+ ("original + 1 resume") and its graded-of-planned count. If a resume replayed
288
+ a reused answer and got a different score (`reuse_score_mismatch`), the
289
+ report warns and the chain is not complete. `evalrouter export RUN
290
+ --include-resumed` saves that chain result by itself. The command follows
291
+ each run to its newest resume at the time you run it, so a later resume makes
292
+ it return a longer chain; the saved chain documents keep the exact version.
293
+
294
+ `sources/` keeps each export byte for byte, with its SHA-256 recorded. With
295
+ `--evidence`, every graded sample must carry its scored answer by default: the final completion
190
296
  text for SOB, plus the per-sample metadata the export supplies (for SOB, the
191
297
  response's token counts and finish reason). Exports do not contain complete
192
298
  transcripts, reasoning, timings or per-attempt usage. Keep these files
193
- private. Use `--without-raw` to archive runs whose answers have expired or
194
- are withheld by the export policy. Different transports, limits or generation
299
+ private. Use `--without-raw` (which implies `--evidence`) to archive runs
300
+ whose answers have expired or are withheld by the export policy. A chain
301
+ summary report downloads member exports only with `--evidence`. Different transports, limits or generation
195
302
  settings are listed as warnings. Nothing is regraded, and no deltas,
196
303
  intervals or winner are computed. `--output NAME.json` puts the sources in
197
304
  `NAME-sources/`.
@@ -199,9 +306,13 @@ intervals or winner are computed. `--output NAME.json` puts the sources in
199
306
  ## Supported commands
200
307
 
201
308
  `catalog` (`--models`, `--slug` or `--environment`), `connections list/create/check/update/disable`,
202
- `quote`, `run`, `status`, `wait`, `cancel`, `results`, `export`, `compare` and `open`.
309
+ `quote`, `run`, `resume`, `status`, `wait`, `cancel`, `results`, `export`, `compare` and `open`.
203
310
  Repository qualification uses `agent-builds options/preview/create/list/status/cancel`.
204
311
  Authoring your own benchmark package uses `benchmark init/validate/bundle`.
312
+ `credits` shows the workspace balance, the amount held by running evaluations
313
+ and what is available for new ones. It works with an `evalrouter login` sign-in
314
+ or an API key with the `billing:read` scope. Credit is added on the website under
315
+ Settings > Billing; the CLI never takes a payment.
205
316
  Run each command with `--help` for exact flags. A connected model's credential
206
317
  is never a command argument: `connections create` asks with hidden input in a
207
318
  terminal, and scripts use `--key-stdin` or `--key-env NAME`
@@ -213,11 +324,21 @@ an interactive terminal, with a percentage when validated processed and planned
213
324
  counts are available. Use `--progress plain` for structured progress or
214
325
  `--progress off` to suppress it. Redirected stderr and `--json` retain structured
215
326
  progress. A progress percentage counts processed samples; it is not a score.
327
+ `--progress json` writes `evalrouter.progress.v1` records on stderr, on every
328
+ change and every 30 seconds: phase, processed and planned counts, errors,
329
+ spend and elapsed time. `evalrouter events RUN --follow` prints the run's
330
+ event log as JSON lines until it ends; `--type`, `--tail N` and `--after N`
331
+ filter, start from the end and resume.
332
+ `evalrouter open RUN` opens the run's live report page, also when an agent
333
+ runs it with `--json`; `run --open` opens it as soon as the run starts. No
334
+ browser opens in CI, over SSH, without a display, with `--no-browser` or with
335
+ `EVALROUTER_NO_BROWSER=1`; the address is printed instead.
216
336
 
217
337
  Use `--config -` for JSON on stdin. `--json` writes one result on stdout and
218
338
  progress on stderr. Exit codes: 0 success; 1 API/transport or failed run;
219
339
  2 invalid input or rejected request (including a refused unattended `run`);
220
- 4 partial/cancelled waited run; 5 confirmation declined, nothing started. Interrupting
340
+ 4 partial/cancelled waited run; 5 confirmation declined, nothing started;
341
+ 6 stopped watching because the API stayed unreachable. Interrupting
221
342
  a local wait does not cancel server work. Use `evalrouter cancel RUN_ID`
222
343
  explicitly when cancellation is intended.
223
344
 
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "evalrouter"
7
- version = "0.3.7"
7
+ version = "0.3.9"
8
8
  description = "Typed Kimpton evaluation client and command-line interface"
9
9
  readme = "README.md"
10
10
  license = "LicenseRef-Kimpton-EvalRouter-SDK"
@@ -8,4 +8,4 @@ computes digests and refuses invalid packages; it never imports contributed
8
8
  code, opens a network connection, signs anything or carries operator state.
9
9
  """
10
10
 
11
- __version__ = "0.3.7"
11
+ __version__ = "0.3.9"
@@ -13,6 +13,7 @@ from ._resources import Evals as _Evals
13
13
  from ._resources import Evaluations as _Evaluations
14
14
  from ._resources import Protocols as _Protocols
15
15
  from ._resources import Quotes as _Quotes
16
+ from ._resources import Regrades as _Regrades
16
17
  from ._resources import Runs as _Runs
17
18
  from ._transport import APIError, ClientError, RequestOptions, RequestTimeout, WaitCancelled
18
19
  from ._transport import Transport as _Transport
@@ -27,7 +28,7 @@ __all__ = [
27
28
  "WaitCancelled",
28
29
  "types",
29
30
  ]
30
- __version__ = "0.3.7"
31
+ __version__ = "0.3.9"
31
32
 
32
33
 
33
34
  class Client(_Transport):
@@ -71,6 +72,10 @@ class Client(_Transport):
71
72
  def runs(self) -> _Runs:
72
73
  return _Runs(self)
73
74
 
75
+ @_cached_property
76
+ def regrades(self) -> _Regrades:
77
+ return _Regrades(self)
78
+
74
79
  @_cached_property
75
80
  def evals(self) -> _Evals:
76
81
  return _Evals(self)
@@ -55,9 +55,11 @@ FILE_STORE_NAME = "credentials.json"
55
55
  REFRESH_MARGIN_SECONDS = 60
56
56
  MAX_POLL_INTERVAL = 60
57
57
  DEFAULT_API_ORIGIN = "https://api.evalrouter.ai"
58
+ #: API host -> the website for that environment. Dev's API is served only at its
59
+ #: Modal address; the name api.dev.evalrouter.ai is the Dev Auth0 audience (an
60
+ #: identifier in tokens), not a host, so it is not listed.
58
61
  CONNECT_WEBSITES = {
59
62
  "api.evalrouter.ai": "https://evalrouter.ai",
60
- "api.dev.evalrouter.ai": "https://dev.evalrouter.ai",
61
63
  "kimpton-evalrouter-dev--evalrouter-service-api.us-east.modal.direct": "https://dev.evalrouter.ai",
62
64
  }
63
65
  LOGIN_HINT = "Run `evalrouter login` or set EVALROUTER_API_KEY."
@@ -1452,11 +1454,7 @@ def _onboarding_workspaces(
1452
1454
  except APIError as error:
1453
1455
  if error.code not in {"account_not_found", "email_unverified"}:
1454
1456
  raise
1455
- website = {
1456
- "api.evalrouter.ai": "https://evalrouter.ai",
1457
- "api.dev.evalrouter.ai": "https://dev.evalrouter.ai",
1458
- "kimpton-evalrouter-dev--evalrouter-service-api.us-east.modal.direct": "https://dev.evalrouter.ai",
1459
- }.get(urlsplit(base).netloc)
1457
+ website = CONNECT_WEBSITES.get(urlsplit(base).netloc)
1460
1458
  if website is None:
1461
1459
  raise
1462
1460
  target = website + "/login?next=%2Fsettings%2Faccount"
@@ -1924,7 +1922,9 @@ def workspaces(args, *, client_factory, store: CredentialStore | None = None):
1924
1922
  base = _require_base(args)
1925
1923
  access = session_token(store, base)
1926
1924
  if not access:
1927
- raise ClientError("login_required", "You are not signed in. Run `evalrouter login`.")
1925
+ raise ClientError(
1926
+ "authentication_required", "You are not signed in. Run `evalrouter login`."
1927
+ )
1928
1928
  entry = store.server(base)
1929
1929
  local = entry.get("devices") or {}
1930
1930
  rows = [
@@ -1954,7 +1954,9 @@ def switch(args, *, client_factory, store: CredentialStore | None = None):
1954
1954
  )
1955
1955
  access = session_token(store, base)
1956
1956
  if not access:
1957
- raise ClientError("login_required", "You are not signed in. Run `evalrouter login`.")
1957
+ raise ClientError(
1958
+ "authentication_required", "You are not signed in. Run `evalrouter login`."
1959
+ )
1958
1960
  chosen = _pick_workspace(_list_workspaces(client_factory, access), entry.get("active"))
1959
1961
  if chosen is False:
1960
1962
  raise ClientError(
@@ -1974,7 +1976,9 @@ def switch(args, *, client_factory, store: CredentialStore | None = None):
1974
1976
  return {"active": {"id": matches[0], "name": name}, "registered": False}
1975
1977
  access = session_token(store, base)
1976
1978
  if not access:
1977
- raise ClientError("login_required", "You are not signed in. Run `evalrouter login`.")
1979
+ raise ClientError(
1980
+ "authentication_required", "You are not signed in. Run `evalrouter login`."
1981
+ )
1978
1982
  workspace = _select_workspace(_list_workspaces(client_factory, access), wanted)
1979
1983
  device = _register(client_factory, store, base, access, workspace)
1980
1984
  return {"active": {"id": device["id"], "name": device["workspace_name"]}, "registered": True}
@@ -2059,5 +2063,126 @@ def human(command: str, action: str | None, value: dict) -> list[str]:
2059
2063
  return lines
2060
2064
 
2061
2065
 
2066
+ # --- credits ---------------------------------------------------------------------
2067
+ #
2068
+ # `evalrouter credits` reads GET /v1/billing/wallet fresh on every call (never
2069
+ # cached; see docs/CLI-READ-CONSISTENCY.md). Credit is added only on the website:
2070
+ # the CLI prints the billing page and never opens a browser or starts a payment.
2071
+
2072
+ WALLET_PATH = "/billing/wallet"
2073
+ BILLING_PAGE = "/settings/billing"
2074
+ CREDIT_CODES = frozenset({"insufficient_credit", "wallet_negative"})
2075
+
2076
+
2077
+ def billing_url(base: str | None) -> str | None:
2078
+ """The website billing page for a known hosted API; None for any other server."""
2079
+ website = CONNECT_WEBSITES.get(urlsplit(base).netloc) if base else None
2080
+ return website + BILLING_PAGE if website else None
2081
+
2082
+
2083
+ def add_credit_text(base: str | None) -> str:
2084
+ url = billing_url(base)
2085
+ return (
2086
+ f"Add credit at {url}"
2087
+ if url
2088
+ else "Add credit on the EvalRouter website under Settings > Billing"
2089
+ )
2090
+
2091
+
2092
+ def signed_money(value: object) -> str:
2093
+ """Wire micro-USD as `$W.FF`, keeping a minus sign (a wallet can be below zero)."""
2094
+ from .render import format_money
2095
+
2096
+ if isinstance(value, str) and value.startswith("-") and value[1:].isdecimal():
2097
+ text = format_money(value[1:])
2098
+ return "unknown" if text == "unknown" else "-" + text
2099
+ return format_money(value)
2100
+
2101
+
2102
+ def _micro(value: object) -> int | None:
2103
+ if isinstance(value, str) and value.lstrip("-").isascii() and value.lstrip("-").isdecimal():
2104
+ return int(value)
2105
+ return None
2106
+
2107
+
2108
+ def credits_rows(value: dict) -> list[tuple[str, str, str]]:
2109
+ """(label, amount, note) for the wallet's balance, held and available amounts."""
2110
+ return [
2111
+ ("Balance", signed_money(value.get("balance_microusd")), ""),
2112
+ ("Held", signed_money(value.get("reserved_microusd")), "reserved for running evaluations"),
2113
+ ("Available", signed_money(value.get("available_microusd")), "for new evaluations"),
2114
+ ]
2115
+
2116
+
2117
+ def credits_lines(value: dict, base: str | None) -> list[str]:
2118
+ """Terminal projection of the wallet; `--json` prints the document unchanged."""
2119
+ rows = credits_rows(value)
2120
+ width = max(len(label) for label, _, _ in rows) + 1
2121
+ amount = max(len(text) for _, text, _ in rows)
2122
+ lines = ["Workspace credits"]
2123
+ for label, text, note in rows:
2124
+ lines.append(f" {label + ':':<{width}} {text:>{amount}}" + (f" {note}" if note else ""))
2125
+ return lines + credits_notes(value, base)
2126
+
2127
+
2128
+ def credits_notes(value: dict, base: str | None) -> list[str]:
2129
+ """What the amounts mean for new evaluations, and where to add credit."""
2130
+ lines = []
2131
+ balance, available = (
2132
+ _micro(value.get(key)) for key in ("balance_microusd", "available_microusd")
2133
+ )
2134
+ if balance is not None and balance < 0:
2135
+ lines.append(
2136
+ "The balance is below zero, so new evaluations cannot start until you add credit."
2137
+ )
2138
+ elif available is not None and available <= 0:
2139
+ lines.append("No credit is available for new evaluations.")
2140
+ lines.append(
2141
+ "Each run reserves its spending cap. Unused credit returns after its charges settle."
2142
+ )
2143
+ if value.get("purchases_enabled") is True:
2144
+ lines.append(add_credit_text(base) + ".")
2145
+ elif value.get("purchases_enabled") is False:
2146
+ lines.append("Credit purchases are not available for this workspace right now.")
2147
+ if value.get("payment_mode") == "test":
2148
+ lines.append("Test environment: purchases use test payments and are not charged.")
2149
+ return lines
2150
+
2151
+
2152
+ def credits_error(error: ClientError, base: str | None) -> None:
2153
+ """Customer guidance for a wallet read this credential may not make.
2154
+
2155
+ A device sign-in registered before sign-ins could read credits is told
2156
+ (by the server's ``renew_sign_in``) to sign in once more; that registers a
2157
+ new grant with the read. An API key without billing:read keeps key advice.
2158
+ """
2159
+ if not (isinstance(error, APIError) and error.code == "insufficient_scope"):
2160
+ return
2161
+ url = billing_url(base)
2162
+ where = f"at {url}" if url else "on the EvalRouter website under Settings > Billing"
2163
+ details = error.details if isinstance(error.details, dict) else {}
2164
+ if details.get("renew_sign_in") is True:
2165
+ error.message = (
2166
+ "This device signed in before sign-ins could read the credit balance. "
2167
+ f"Run `evalrouter login` once to renew it, or see your balance {where}."
2168
+ )
2169
+ return
2170
+ error.message = (
2171
+ "This sign-in cannot read the credit balance. See your balance and add credit "
2172
+ f"{where}, or use a workspace API key with the billing:read scope in EVALROUTER_API_KEY."
2173
+ )
2174
+
2175
+
2176
+ def credit_hint(error: ClientError, base: str | None) -> str | None:
2177
+ """The next step after a funding refusal (402); None for any other error.
2178
+
2179
+ Only the website adds credit, and the command is run again afterwards. A
2180
+ budget-stopped run cannot be continued yet, so nothing suggests that.
2181
+ """
2182
+ if not (isinstance(error, APIError) and error.status == 402 and error.code in CREDIT_CODES):
2183
+ return None
2184
+ return f"{add_credit_text(base)}, then run the command again. Nothing was charged for this request."
2185
+
2186
+
2062
2187
  def file_mode(path: Path) -> int:
2063
2188
  return stat.S_IMODE(path.stat().st_mode)