evalrouter 0.3.3__tar.gz → 0.3.5__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 (32) hide show
  1. {evalrouter-0.3.3 → evalrouter-0.3.5}/PKG-INFO +7 -7
  2. {evalrouter-0.3.3 → evalrouter-0.3.5}/README.md +6 -6
  3. {evalrouter-0.3.3 → evalrouter-0.3.5}/pyproject.toml +1 -1
  4. {evalrouter-0.3.3 → evalrouter-0.3.5}/src/evalrouter_contracts/__init__.py +1 -1
  5. {evalrouter-0.3.3 → evalrouter-0.3.5}/src/kimpton_evalrouter/__init__.py +1 -1
  6. {evalrouter-0.3.3 → evalrouter-0.3.5}/src/kimpton_evalrouter/_boundary.py +14 -1
  7. {evalrouter-0.3.3 → evalrouter-0.3.5}/src/kimpton_evalrouter/_guided.py +81 -2
  8. {evalrouter-0.3.3 → evalrouter-0.3.5}/src/kimpton_evalrouter/cli.py +905 -63
  9. {evalrouter-0.3.3 → evalrouter-0.3.5}/src/kimpton_evalrouter/render/live.py +31 -0
  10. {evalrouter-0.3.3 → evalrouter-0.3.5}/src/kimpton_evalrouter/render/screens.py +93 -6
  11. {evalrouter-0.3.3 → evalrouter-0.3.5}/src/kimpton_evalrouter/types.py +49 -2
  12. {evalrouter-0.3.3 → evalrouter-0.3.5}/LICENSE +0 -0
  13. {evalrouter-0.3.3 → evalrouter-0.3.5}/src/evalrouter_contracts/bundle.py +0 -0
  14. {evalrouter-0.3.3 → evalrouter-0.3.5}/src/evalrouter_contracts/components.py +0 -0
  15. {evalrouter-0.3.3 → evalrouter-0.3.5}/src/evalrouter_contracts/models.py +0 -0
  16. {evalrouter-0.3.3 → evalrouter-0.3.5}/src/evalrouter_contracts/protocol.py +0 -0
  17. {evalrouter-0.3.3 → evalrouter-0.3.5}/src/evalrouter_contracts/py.typed +0 -0
  18. {evalrouter-0.3.3 → evalrouter-0.3.5}/src/evalrouter_contracts/templates.py +0 -0
  19. {evalrouter-0.3.3 → evalrouter-0.3.5}/src/evalrouter_contracts/validation.py +0 -0
  20. {evalrouter-0.3.3 → evalrouter-0.3.5}/src/kimpton_evalrouter/__main__.py +0 -0
  21. {evalrouter-0.3.3 → evalrouter-0.3.5}/src/kimpton_evalrouter/_account.py +0 -0
  22. {evalrouter-0.3.3 → evalrouter-0.3.5}/src/kimpton_evalrouter/_helpers.py +0 -0
  23. {evalrouter-0.3.3 → evalrouter-0.3.5}/src/kimpton_evalrouter/_listing.py +0 -0
  24. {evalrouter-0.3.3 → evalrouter-0.3.5}/src/kimpton_evalrouter/_resources.py +0 -0
  25. {evalrouter-0.3.3 → evalrouter-0.3.5}/src/kimpton_evalrouter/_transport.py +0 -0
  26. {evalrouter-0.3.3 → evalrouter-0.3.5}/src/kimpton_evalrouter/py.typed +0 -0
  27. {evalrouter-0.3.3 → evalrouter-0.3.5}/src/kimpton_evalrouter/render/__init__.py +0 -0
  28. {evalrouter-0.3.3 → evalrouter-0.3.5}/src/kimpton_evalrouter/render/_console.py +0 -0
  29. {evalrouter-0.3.3 → evalrouter-0.3.5}/src/kimpton_evalrouter/render/_theme.py +0 -0
  30. {evalrouter-0.3.3 → evalrouter-0.3.5}/src/kimpton_evalrouter/render/_widgets.py +0 -0
  31. {evalrouter-0.3.3 → evalrouter-0.3.5}/src/kimpton_evalrouter/render/picker.py +0 -0
  32. {evalrouter-0.3.3 → evalrouter-0.3.5}/src/kimpton_evalrouter/render/tables.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: evalrouter
3
- Version: 0.3.3
3
+ Version: 0.3.5
4
4
  Summary: Typed Kimpton evaluation client and command-line interface
5
5
  License-Expression: LicenseRef-Kimpton-EvalRouter-SDK
6
6
  License-File: LICENSE
@@ -38,7 +38,8 @@ the `kimpton_evalrouter` import and every API are unchanged. To switch, run
38
38
  `pip uninstall -y kimpton-evalrouter-sdk evalrouter`) and install `evalrouter`.
39
39
 
40
40
  The package supplies the `evalrouter` command; no repository checkout is needed.
41
- Run the browser sign-in below to sign in or create your account.
41
+ [Create an EvalRouter account](https://evalrouter.ai/register), verify your email,
42
+ and follow the browser sign-in below.
42
43
  Package installation does not grant account access or evaluation credit.
43
44
 
44
45
  Sign in with your account:
@@ -48,9 +49,10 @@ evalrouter login
48
49
  evalrouter whoami
49
50
  ```
50
51
 
51
- The browser guides you through sign-up or sign-in, email verification and
52
- terminal approval. The CLI resumes automatically and selects your only workspace.
53
- Production is the default API, with `--base-url` available for other environments.
52
+ Approve the browser code. New accounts finish setup on the website; the CLI
53
+ continues when that is complete. It selects your only workspace automatically.
54
+ Production is the default API; `evalrouter options` lists `--base-url` and the other
55
+ settings that apply to every command.
54
56
  No API key or credential-storage setup is needed for a normal sign-in.
55
57
 
56
58
  CI and services can use `EVALROUTER_API_KEY` and `EVALROUTER_WORKSPACE_ID` supplied
@@ -275,5 +277,3 @@ Replace the coverage placeholder with the entire returned object; do not guess
275
277
  tasks, counts or seeds. Use the existing `quote`, `run`, `wait`, `results` and
276
278
  `export` commands above. Qualification and evaluation have separate caps and
277
279
  charges. A qualification pass does not submit an evaluation automatically.
278
-
279
- After confirming the terminal code, sign in if asked and keep the browser open until your device is connected. If the browser says the code is invalid, press Enter in the waiting terminal for a fresh code (or restart evalrouter login). Your account and workspace are preserved.
@@ -23,7 +23,8 @@ the `kimpton_evalrouter` import and every API are unchanged. To switch, run
23
23
  `pip uninstall -y kimpton-evalrouter-sdk evalrouter`) and install `evalrouter`.
24
24
 
25
25
  The package supplies the `evalrouter` command; no repository checkout is needed.
26
- Run the browser sign-in below to sign in or create your account.
26
+ [Create an EvalRouter account](https://evalrouter.ai/register), verify your email,
27
+ and follow the browser sign-in below.
27
28
  Package installation does not grant account access or evaluation credit.
28
29
 
29
30
  Sign in with your account:
@@ -33,9 +34,10 @@ evalrouter login
33
34
  evalrouter whoami
34
35
  ```
35
36
 
36
- The browser guides you through sign-up or sign-in, email verification and
37
- terminal approval. The CLI resumes automatically and selects your only workspace.
38
- Production is the default API, with `--base-url` available for other environments.
37
+ Approve the browser code. New accounts finish setup on the website; the CLI
38
+ continues when that is complete. It selects your only workspace automatically.
39
+ Production is the default API; `evalrouter options` lists `--base-url` and the other
40
+ settings that apply to every command.
39
41
  No API key or credential-storage setup is needed for a normal sign-in.
40
42
 
41
43
  CI and services can use `EVALROUTER_API_KEY` and `EVALROUTER_WORKSPACE_ID` supplied
@@ -260,5 +262,3 @@ Replace the coverage placeholder with the entire returned object; do not guess
260
262
  tasks, counts or seeds. Use the existing `quote`, `run`, `wait`, `results` and
261
263
  `export` commands above. Qualification and evaluation have separate caps and
262
264
  charges. A qualification pass does not submit an evaluation automatically.
263
-
264
- After confirming the terminal code, sign in if asked and keep the browser open until your device is connected. If the browser says the code is invalid, press Enter in the waiting terminal for a fresh code (or restart evalrouter login). Your account and workspace are preserved.
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "evalrouter"
7
- version = "0.3.3"
7
+ version = "0.3.5"
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.3"
11
+ __version__ = "0.3.5"
@@ -26,7 +26,7 @@ __all__ = [
26
26
  "WaitCancelled",
27
27
  "types",
28
28
  ]
29
- __version__ = "0.3.3"
29
+ __version__ = "0.3.5"
30
30
 
31
31
 
32
32
  class Client(_Transport):
@@ -5,6 +5,9 @@ import re as _re
5
5
 
6
6
  from ._transport import ClientError
7
7
 
8
+ # Quote output formats (additive; the server resolves and freezes the choice).
9
+ OUTPUT_FORMATS = frozenset({"default", "leaderboard", "prompt_json", "native_json", "json_schema"})
10
+
8
11
 
9
12
  def validate_submission(resource, body):
10
13
  if resource == "agent_builds":
@@ -129,6 +132,16 @@ def validate_submission(resource, body):
129
132
  raise ClientError(
130
133
  "invalid_input", "Concurrency must be auto, max, or an integer from 1 to 100."
131
134
  )
135
+ if (
136
+ resource == "quotes"
137
+ and isinstance(body, dict)
138
+ and "output_format" in body
139
+ and body["output_format"] not in OUTPUT_FORMATS
140
+ ):
141
+ raise ClientError(
142
+ "invalid_input",
143
+ "Output format must be default, leaderboard, prompt_json, native_json or json_schema.",
144
+ )
132
145
  if resource == "quotes" and isinstance(body, dict) and "agent" in body:
133
146
  selection = body.get("selection")
134
147
  if (
@@ -145,7 +158,7 @@ def validate_submission(resource, body):
145
158
  )
146
159
  return body
147
160
  allowed = (
148
- {"selection", "model", "coverage", "max_charge_microusd", "concurrency"}
161
+ {"selection", "model", "coverage", "max_charge_microusd", "concurrency", "output_format"}
149
162
  if resource == "quotes"
150
163
  else {
151
164
  "model",
@@ -111,6 +111,7 @@ LAST_RUN_EXAMPLES = """examples:
111
111
  EXPORT_EXAMPLES = """examples:
112
112
  evalrouter export last run as evalrouter-<id>.json
113
113
  evalrouter export --format html,json both reports in one call
114
+ evalrouter export --format bundle evidence ZIP: report, CSV, JSONL, checksums
114
115
  evalrouter export 1a2b3c4d --format csv --output scores.csv
115
116
  """
116
117
 
@@ -179,6 +180,7 @@ def add_run_arguments(run, concurrency_type) -> None:
179
180
  metavar="auto|max|1..100",
180
181
  help="Requested model-request ceiling for the new quote",
181
182
  )
183
+ add_format_argument(run)
182
184
  run.add_argument(
183
185
  "-y", "--yes", action="store_true", help="Start without asking (needs a cap off-terminal)"
184
186
  )
@@ -195,6 +197,23 @@ def add_run_arguments(run, concurrency_type) -> None:
195
197
  add_metrics_argument(run)
196
198
 
197
199
 
200
+ OUTPUT_FORMATS = ("default", "leaderboard", "prompt_json", "native_json", "json_schema")
201
+
202
+
203
+ def add_format_argument(parser) -> None:
204
+ """The output format for a benchmark version that declares selectable formats."""
205
+ parser.add_argument(
206
+ "--format",
207
+ dest="output_format",
208
+ choices=OUTPUT_FORMATS,
209
+ help=(
210
+ "Output format for versions that offer one (default: the version's default). "
211
+ "leaderboard runs native JSON and refuses a model without it; "
212
+ "results record the format and never mix formats"
213
+ ),
214
+ )
215
+
216
+
198
217
  def add_metrics_argument(parser) -> None:
199
218
  parser.add_argument(
200
219
  "--all-metrics",
@@ -227,6 +246,7 @@ def argument_conflict(args) -> str | None:
227
246
  ("--seed", args.seed),
228
247
  ("--max-cost", args.max_cost),
229
248
  ("--concurrency", args.concurrency),
249
+ ("--format", getattr(args, "output_format", None)),
230
250
  )
231
251
  if value not in (None, False)
232
252
  ]
@@ -714,6 +734,28 @@ def _version_record(client, slug: str, version: str | None) -> dict:
714
734
  )
715
735
 
716
736
 
737
+ #: A workspace-private benchmark created by `evalrouter benchmark create`.
738
+ PRIVATE_BENCHMARK = re.compile(
739
+ r"byob-[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}@1"
740
+ )
741
+
742
+
743
+ def _private_record(client, term: str) -> dict:
744
+ value = client.request("GET", f"/private-benchmarks/{term}")
745
+ if not isinstance(value, dict) or value.get("id") != term:
746
+ raise ClientError("invalid_response", "The API returned another private benchmark.")
747
+ if value.get("status") != "active":
748
+ raise ClientError("benchmark_unavailable", f"{term} is archived and cannot start new runs.")
749
+ return {
750
+ "id": term,
751
+ "slug": term.split("@", 1)[0],
752
+ "version": "1",
753
+ "name": value.get("name"),
754
+ "task_count": value.get("row_count"),
755
+ "quote_availability": {"status": "ready_for_quote"},
756
+ }
757
+
758
+
717
759
  def resolve_benchmark(client, term: str | None, *, prompt: bool) -> dict:
718
760
  """One quotable benchmark profile record for a slug, name, `slug@version` or profile ID."""
719
761
  if not term and not prompt:
@@ -721,6 +763,9 @@ def resolve_benchmark(client, term: str | None, *, prompt: bool) -> dict:
721
763
  "benchmark_not_found",
722
764
  "Name a benchmark, for example: evalrouter run gpqa-diamond --model MODEL",
723
765
  )
766
+ if term and PRIVATE_BENCHMARK.fullmatch(term):
767
+ # Private benchmarks are never in the shared catalog listing.
768
+ return _private_record(client, term)
724
769
  if term and "@" in term:
725
770
  slug, _, version = term.partition("@")
726
771
  return _version_record(client, slug, version)
@@ -870,6 +915,21 @@ def _coverage_text(plan: dict) -> str:
870
915
  return text + (f", seed {seed}" if type(seed) is int else "")
871
916
 
872
917
 
918
+ def _format_text(plan: dict) -> str | None:
919
+ """The frozen output format(s) of a quote, when its versions declare one."""
920
+ selected = [
921
+ profile.get("output_format")
922
+ for profile in plan.get("profiles") or []
923
+ if isinstance(profile, dict) and isinstance(profile.get("output_format"), dict)
924
+ ]
925
+ names = list(dict.fromkeys(str(item.get("id")) for item in selected))
926
+ if not names:
927
+ return None
928
+ policies = {item.get("policy") for item in selected}
929
+ policy = "" if policies <= {"explicit", None} else f" ({', '.join(sorted(map(str, policies)))})"
930
+ return ", ".join(names) + policy
931
+
932
+
873
933
  def _concurrency_text(plan: dict) -> str | None:
874
934
  metadata = plan.get("concurrency")
875
935
  if not isinstance(metadata, dict):
@@ -950,7 +1010,14 @@ def parallel_note(quote: dict) -> str | None:
950
1010
  metadata = plan.get("concurrency") if isinstance(plan.get("concurrency"), dict) else None
951
1011
  if metadata is not None:
952
1012
  requested = metadata.get("requested")
953
- target = 4 if requested == "auto" else 100 if requested == "max" else requested
1013
+ # `auto` sizes itself from the route's latency (the admitted ceiling).
1014
+ target = (
1015
+ metadata.get("admitted_ceiling")
1016
+ if requested == "auto"
1017
+ else 100
1018
+ if requested == "max"
1019
+ else requested
1020
+ )
954
1021
  adapters = [
955
1022
  p.get("adapter_ceiling")
956
1023
  for p in metadata.get("profiles") or []
@@ -1021,7 +1088,14 @@ def quote_rows(
1021
1088
  ("Model", str(model or "unknown")),
1022
1089
  ("Coverage", _coverage_text(plan)),
1023
1090
  ]
1024
- if expected:
1091
+ quoted = render.screens.expected_costs(quote)
1092
+ if quoted is not None and (quoted[3] in {"measured", "planned"} or not expected):
1093
+ # The quote's own expected charge (measured usage) wins over the
1094
+ # derived figure from one earlier run.
1095
+ estimate, p50, p90, _ = quoted
1096
+ fmt = render.screens.format_cents
1097
+ rows.append(("Expected", f"~{fmt(estimate)} p50–p90 {fmt(p50)}–{fmt(p90)}"))
1098
+ elif expected:
1025
1099
  rows.append(
1026
1100
  (
1027
1101
  "Expected",
@@ -1062,6 +1136,9 @@ def quote_rows(
1062
1136
  concurrency = _concurrency_text(plan)
1063
1137
  if concurrency:
1064
1138
  rows.append(("Concurrency", concurrency))
1139
+ output_format = _format_text(plan)
1140
+ if output_format:
1141
+ rows.append(("Output format", output_format))
1065
1142
  rows.append(("Expires", _expires_text(quote.get("expires_at"))))
1066
1143
  return rows
1067
1144
 
@@ -1443,6 +1520,8 @@ def _request(client, args, prompt: bool) -> tuple[dict, dict]:
1443
1520
  }
1444
1521
  if args.concurrency is not None:
1445
1522
  request["concurrency"] = args.concurrency
1523
+ if getattr(args, "output_format", None) is not None:
1524
+ request["output_format"] = args.output_format
1446
1525
  labels = {"benchmark": benchmark_label(record), "slug": record.get("slug"), "model": model_text}
1447
1526
  return request, labels
1448
1527