@wendellresearch-ai/benchwarmers 0.2.1 → 0.3.0
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.
- package/AGENTS.md +6 -1
- package/GATEWAY.md +306 -6
- package/README.md +53 -3
- package/USAGE.md +31 -0
- package/VERSION +1 -1
- package/cli.py +10 -2
- package/gateway.py +619 -93
- package/metrics/bench_collections.py +7 -3
- package/metrics/catalog.py +10 -1
- package/metrics/client.py +764 -131
- package/metrics/cost.py +38 -19
- package/metrics/endpoints.py +25 -2
- package/metrics/formats.py +1584 -0
- package/metrics/guard.py +37 -7
- package/metrics/learn.py +19 -6
- package/metrics/ledger.py +148 -0
- package/metrics/model_roles.py +13 -3
- package/metrics/pacing.py +248 -0
- package/metrics/quota.py +383 -0
- package/metrics/route.py +5 -3
- package/package.json +2 -1
- package/perf/run.py +30 -7
- package/scripts/check.py +7 -0
- package/scripts/onboard.py +10 -1
- package/scripts/test_auth.py +2 -1
- package/scripts/test_client.py +50 -6
- package/scripts/test_formats.py +558 -0
- package/scripts/test_merged.py +6 -5
- package/scripts/test_native.py +188 -0
- package/scripts/test_quota.py +334 -0
- package/scripts/test_route.py +429 -0
- package/scripts/test_serve_edit.py +10 -5
- package/scripts/test_server_json.py +79 -0
- package/scripts/test_verdict.py +5 -1
- package/scripts/test_vision.py +6 -3
- package/serve.py +170 -44
- package/ui/bench.js +6 -3
|
@@ -15,8 +15,11 @@ the same collection is called every day:
|
|
|
15
15
|
seats; empty means a decision model labels each prompt, or `general` without
|
|
16
16
|
one. `reply` is what the caller reads: `all` (every answer, the default) or
|
|
17
17
|
`merged` (one answer a `merger` model writes from them; empty means chosen by
|
|
18
|
-
verdict record, gateway.py)
|
|
19
|
-
|
|
18
|
+
verdict record, gateway.py) or `route` (no panel: one member, picked by its
|
|
19
|
+
record, gets the request as sent, tools and all, for agent clients;
|
|
20
|
+
GATEWAY.md "Route mode"). A request may override it with a `:merged`,
|
|
21
|
+
`:all` or `:route` suffix on the model name, or `"bench": {"reply": ...}`
|
|
22
|
+
in the body.
|
|
20
23
|
Named `bench_collections` because `collections` would shadow the standard
|
|
21
24
|
library for everything importing from metrics/.
|
|
22
25
|
"""
|
|
@@ -34,7 +37,7 @@ SETTINGS_FILE = DATA / "config" / "gateway.json"
|
|
|
34
37
|
DEFAULTS = {"max_calls": 5, "max_explorers": 2}
|
|
35
38
|
NAME = re.compile(r"^[a-z0-9][a-z0-9-]{1,31}$")
|
|
36
39
|
PREFIX = "bench/"
|
|
37
|
-
REPLIES = ("all", "merged")
|
|
40
|
+
REPLIES = ("all", "merged", "route")
|
|
38
41
|
|
|
39
42
|
|
|
40
43
|
def _read(path: pathlib.Path) -> dict:
|
|
@@ -135,6 +138,7 @@ if __name__ == "__main__":
|
|
|
135
138
|
assert explorers_for(3, {"max_calls": 4, "max_explorers": 2}) == 1
|
|
136
139
|
assert resolve("bench/") is None and resolve("bench/no-such") is None and resolve("") is None
|
|
137
140
|
assert split_reply("bench/core:merged") == ("bench/core", "merged") and split_reply("core:all") == ("core", "all")
|
|
141
|
+
assert split_reply("bench/core:route") == ("bench/core", "route")
|
|
138
142
|
assert split_reply("bench/core") == ("bench/core", "") and split_reply("bench/core:x") == ("bench/core:x", "")
|
|
139
143
|
assert not reply_errors("merged", "", []) and not reply_errors("all", "m", ["m"])
|
|
140
144
|
assert len(reply_errors("", "m", [])) == 2
|
package/metrics/catalog.py
CHANGED
|
@@ -11,7 +11,11 @@ THREE FILES, ONE RECORD
|
|
|
11
11
|
config/model-overrides.json WRITTEN BY YOU (the model popup). Per alias,
|
|
12
12
|
any field, including its own rate limits.
|
|
13
13
|
config/connection-limits.json WRITTEN BY YOU (the Endpoints dialog). Per
|
|
14
|
-
connection: rpm, rpd, tpm, tpd
|
|
14
|
+
connection: rpm, rpd, tpm, tpd, and rpmo
|
|
15
|
+
(calls a calendar month).
|
|
16
|
+
|
|
17
|
+
Since Phase 2b the built-in client enforces these, a model's own limits and
|
|
18
|
+
the learned ones (metrics/pacing.py); before, they were only shown.
|
|
15
19
|
|
|
16
20
|
`info(alias)` merges them: an override beats the refresh, a model's own limits
|
|
17
21
|
beat its connection's. Rate limits are kept per CONNECTION (nvidia-api, groq,
|
|
@@ -52,6 +56,11 @@ FIELDS = ("context_window", "max_output", "vision", "tools", "structured_output"
|
|
|
52
56
|
"release_date", "open_weights", "description")
|
|
53
57
|
CAPS = ("tools", "vision", "structured_output", "reasoning")
|
|
54
58
|
LIMIT_KEYS = ("rpm", "rpd", "tpm", "tpd")
|
|
59
|
+
# A connection's limits add a monthly cap: calls a calendar month (UTC), as a
|
|
60
|
+
# trial key has (Cohere's: 1,000). Per key, so not among a model's own limits.
|
|
61
|
+
CONNECTION_LIMIT_KEYS = LIMIT_KEYS + ("rpmo",)
|
|
62
|
+
LIMIT_LABELS = {"rpm": "requests per minute", "rpd": "requests per day", "tpm": "tokens per minute",
|
|
63
|
+
"tpd": "tokens per day", "rpmo": "requests per calendar month (UTC)"}
|
|
55
64
|
|
|
56
65
|
|
|
57
66
|
def _read(path: pathlib.Path) -> dict:
|