modelsaar 0.2.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.
- modelsaar/__init__.py +13 -0
- modelsaar/adapters/__init__.py +27 -0
- modelsaar/adapters/base.py +274 -0
- modelsaar/adapters/ollama.py +317 -0
- modelsaar/adapters/openai_compat.py +296 -0
- modelsaar/catalogue/__init__.py +72 -0
- modelsaar/catalogue/starter.yaml +435 -0
- modelsaar/cli.py +880 -0
- modelsaar/clientconfig/__init__.py +364 -0
- modelsaar/config.py +631 -0
- modelsaar/doctor.py +233 -0
- modelsaar/evaluation/__init__.py +1 -0
- modelsaar/evaluation/fixtures/tasks.jsonl +47 -0
- modelsaar/evaluation/harness.py +768 -0
- modelsaar/evaluation/judge.py +173 -0
- modelsaar/evaluation/sandbox.py +341 -0
- modelsaar/evaluation/scoring.py +233 -0
- modelsaar/learning.py +227 -0
- modelsaar/lifecycle.py +208 -0
- modelsaar/pipelines.py +439 -0
- modelsaar/probes.py +526 -0
- modelsaar/protocol/__init__.py +1 -0
- modelsaar/protocol/anthropic.py +401 -0
- modelsaar/protocol/decisions.py +229 -0
- modelsaar/protocol/openai.py +322 -0
- modelsaar/protocol/responses.py +560 -0
- modelsaar/protocol/sse.py +181 -0
- modelsaar/registry.py +229 -0
- modelsaar/responses_store.py +117 -0
- modelsaar/routing/__init__.py +1 -0
- modelsaar/routing/admission.py +359 -0
- modelsaar/routing/affinity.py +131 -0
- modelsaar/routing/cascade.py +53 -0
- modelsaar/routing/classifier.py +298 -0
- modelsaar/routing/decision.py +85 -0
- modelsaar/routing/eligibility.py +158 -0
- modelsaar/routing/requirements.py +290 -0
- modelsaar/routing/router.py +1026 -0
- modelsaar/routing/scoring.py +179 -0
- modelsaar/routing/tokens.py +114 -0
- modelsaar/runtime.py +82 -0
- modelsaar/security.py +63 -0
- modelsaar/server.py +1546 -0
- modelsaar/static/status.html +95 -0
- modelsaar/store.py +208 -0
- modelsaar/testing/__init__.py +1 -0
- modelsaar/testing/fakebackend.py +661 -0
- modelsaar-0.2.0.dist-info/METADATA +285 -0
- modelsaar-0.2.0.dist-info/RECORD +54 -0
- modelsaar-0.2.0.dist-info/WHEEL +5 -0
- modelsaar-0.2.0.dist-info/entry_points.txt +2 -0
- modelsaar-0.2.0.dist-info/licenses/LICENSE +202 -0
- modelsaar-0.2.0.dist-info/licenses/NOTICE +18 -0
- modelsaar-0.2.0.dist-info/top_level.txt +1 -0
modelsaar/doctor.py
ADDED
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
"""`modelsaar doctor`: practical diagnostics with actionable messages."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import asyncio
|
|
6
|
+
import os
|
|
7
|
+
import socket
|
|
8
|
+
import stat
|
|
9
|
+
from dataclasses import dataclass, field
|
|
10
|
+
from pathlib import Path
|
|
11
|
+
from typing import Any
|
|
12
|
+
from urllib.parse import urlsplit
|
|
13
|
+
|
|
14
|
+
import httpx
|
|
15
|
+
|
|
16
|
+
from .config import Config, read_keys
|
|
17
|
+
from .routing.router import Router
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
@dataclass
|
|
21
|
+
class Finding:
|
|
22
|
+
level: str # ok | warn | fail
|
|
23
|
+
area: str
|
|
24
|
+
message: str
|
|
25
|
+
remedy: str = ""
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
@dataclass
|
|
29
|
+
class DoctorReport:
|
|
30
|
+
findings: list[Finding] = field(default_factory=list)
|
|
31
|
+
|
|
32
|
+
def add(self, level: str, area: str, message: str, remedy: str = "") -> None:
|
|
33
|
+
self.findings.append(Finding(level, area, message, remedy))
|
|
34
|
+
|
|
35
|
+
@property
|
|
36
|
+
def failures(self) -> int:
|
|
37
|
+
return sum(1 for f in self.findings if f.level == "fail")
|
|
38
|
+
|
|
39
|
+
def as_dict(self) -> dict[str, Any]:
|
|
40
|
+
return {"findings": [f.__dict__ for f in self.findings], "failures": self.failures}
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
def _in_container() -> bool:
|
|
44
|
+
return Path("/.dockerenv").exists() or os.environ.get("MODELSAAR_IN_CONTAINER") == "1"
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
def _port_in_use(host: str, port: int) -> bool:
|
|
48
|
+
s = socket.socket()
|
|
49
|
+
s.settimeout(0.5)
|
|
50
|
+
try:
|
|
51
|
+
return s.connect_ex((host, port)) == 0
|
|
52
|
+
finally:
|
|
53
|
+
s.close()
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
async def run_doctor(cfg: Config | None, cfg_error: str | None, path: Path) -> DoctorReport:
|
|
57
|
+
rep = DoctorReport()
|
|
58
|
+
if cfg is None:
|
|
59
|
+
rep.add("fail", "config", f"cannot load {path}: {cfg_error}", "run `modelsaar init` or fix the YAML")
|
|
60
|
+
return rep
|
|
61
|
+
rep.add("ok", "config", f"loaded {path} (version {cfg.version}, hash {cfg.config_hash})")
|
|
62
|
+
|
|
63
|
+
# Keys & file permissions
|
|
64
|
+
for label, p in (("api keys", cfg.resolve(cfg.server.api_keys_file)), ("admin key", cfg.resolve(cfg.server.admin_key_file))):
|
|
65
|
+
if not p.exists() or not read_keys(p):
|
|
66
|
+
rep.add("fail", "auth", f"{label} file missing or empty: {p}", "run `modelsaar keys rotate` or `modelsaar init`")
|
|
67
|
+
continue
|
|
68
|
+
mode = stat.S_IMODE(p.stat().st_mode)
|
|
69
|
+
if mode & 0o077:
|
|
70
|
+
rep.add("warn", "auth", f"{label} file {p} is readable by other users (mode {oct(mode)})", f"chmod 600 {p}")
|
|
71
|
+
else:
|
|
72
|
+
rep.add("ok", "auth", f"{label} present ({p})")
|
|
73
|
+
|
|
74
|
+
# Bind / exposure
|
|
75
|
+
if cfg.server.host not in ("127.0.0.1", "localhost", "::1"):
|
|
76
|
+
rep.add(
|
|
77
|
+
"warn",
|
|
78
|
+
"network",
|
|
79
|
+
f"gateway binds to {cfg.server.host} (LAN exposure enabled: allow_lan={cfg.security.allow_lan})",
|
|
80
|
+
"ensure TLS termination or a trusted private tunnel; keys travel in cleartext over plain HTTP",
|
|
81
|
+
)
|
|
82
|
+
else:
|
|
83
|
+
rep.add("ok", "network", f"gateway binds to loopback {cfg.server.host}:{cfg.server.port}")
|
|
84
|
+
if _port_in_use(cfg.server.host if cfg.server.host != "0.0.0.0" else "127.0.0.1", cfg.server.port):
|
|
85
|
+
rep.add(
|
|
86
|
+
"warn",
|
|
87
|
+
"network",
|
|
88
|
+
f"port {cfg.server.port} is already accepting connections (a running gateway or another service)",
|
|
89
|
+
"stop the other service or change server.port",
|
|
90
|
+
)
|
|
91
|
+
if cfg.security.log_prompts:
|
|
92
|
+
rep.add("warn", "privacy", "security.log_prompts is enabled: raw prompts/responses will be logged", "disable unless debugging")
|
|
93
|
+
if cfg.security.locality_mode == "allow_remote":
|
|
94
|
+
rep.add("warn", "privacy", "locality_mode=allow_remote: remote/cloud-forwarded deployments are eligible")
|
|
95
|
+
|
|
96
|
+
# Backends
|
|
97
|
+
for b in cfg.backends:
|
|
98
|
+
parts = urlsplit(b.base_url)
|
|
99
|
+
host = parts.hostname or ""
|
|
100
|
+
if _in_container() and host in ("127.0.0.1", "localhost"):
|
|
101
|
+
rep.add(
|
|
102
|
+
"fail",
|
|
103
|
+
f"backend:{b.id}",
|
|
104
|
+
f"base_url {b.base_url} points at the container's own loopback; the host's inference server is not reachable there",
|
|
105
|
+
"use http://host.docker.internal:<port> (macOS/Windows; Linux needs --add-host=host.docker.internal:host-gateway)",
|
|
106
|
+
)
|
|
107
|
+
try:
|
|
108
|
+
async with httpx.AsyncClient(timeout=b.connect_timeout_s, follow_redirects=False) as c:
|
|
109
|
+
probe_path = "/api/version" if b.type == "ollama" else "/models"
|
|
110
|
+
r = await c.get(b.base_url + probe_path, headers=_auth_headers(b))
|
|
111
|
+
if r.status_code == 200:
|
|
112
|
+
rep.add("ok", f"backend:{b.id}", f"{b.type} reachable at {b.base_url}")
|
|
113
|
+
elif r.status_code in (401, 403):
|
|
114
|
+
rep.add("fail", f"backend:{b.id}", f"{b.base_url} rejects the gateway's credentials ({r.status_code})", f"set api_key_env for backend {b.id}")
|
|
115
|
+
else:
|
|
116
|
+
rep.add("warn", f"backend:{b.id}", f"{b.base_url}{probe_path} returned {r.status_code}")
|
|
117
|
+
except httpx.HTTPError as e:
|
|
118
|
+
rep.add(
|
|
119
|
+
"fail",
|
|
120
|
+
f"backend:{b.id}",
|
|
121
|
+
f"cannot reach {b.base_url}: {e.__class__.__name__}",
|
|
122
|
+
"start the inference server (e.g. `ollama serve`) or fix base_url; from Docker use host.docker.internal",
|
|
123
|
+
)
|
|
124
|
+
|
|
125
|
+
# Deployments (discovery-level checks)
|
|
126
|
+
try:
|
|
127
|
+
from .store import Store
|
|
128
|
+
|
|
129
|
+
db = cfg.resolve(cfg.server.state_db)
|
|
130
|
+
router = Router(cfg, Store(db) if db.exists() else None)
|
|
131
|
+
await router.refresh()
|
|
132
|
+
except Exception as e:
|
|
133
|
+
rep.add("fail", "discovery", f"discovery failed: {e}")
|
|
134
|
+
return rep
|
|
135
|
+
deps = router.registry.all()
|
|
136
|
+
if router.store:
|
|
137
|
+
inv = router.store.invalidated_counts()
|
|
138
|
+
if inv["probes"] or inv["measurements"]:
|
|
139
|
+
rep.add(
|
|
140
|
+
"warn",
|
|
141
|
+
"evidence",
|
|
142
|
+
f"{inv['probes']} probe row(s) and {inv['measurements']} measurement row(s) were written under an older "
|
|
143
|
+
f"evidence scheme (current: {inv['scheme']}) and are no longer used for routing",
|
|
144
|
+
"re-run `modelsaar probe --all` and `modelsaar eval --mode live --save-measurements`",
|
|
145
|
+
)
|
|
146
|
+
for d in deps:
|
|
147
|
+
if d.raw_metadata.get("invalidated_probe_fingerprints"):
|
|
148
|
+
rep.add(
|
|
149
|
+
"warn",
|
|
150
|
+
f"deployment:{d.id}",
|
|
151
|
+
f"stored probes exist for earlier fingerprint(s) {d.raw_metadata['invalidated_probe_fingerprints']}; the current "
|
|
152
|
+
f"fingerprint {d.fingerprint} (endpoint/identity/runtime/template/quant) has none",
|
|
153
|
+
f"run `modelsaar probe {d.id}`",
|
|
154
|
+
)
|
|
155
|
+
if not deps:
|
|
156
|
+
rep.add("fail", "discovery", "no deployments discovered", "pull a model into your runtime (e.g. `ollama pull <model>`) or declare models in config")
|
|
157
|
+
gen = [d for d in deps if d.role == "generative" and d.healthy and d.enabled]
|
|
158
|
+
local_gen = [d for d in gen if d.locality == "local"]
|
|
159
|
+
if gen and not local_gen and cfg.security.locality_mode == "local_only":
|
|
160
|
+
rep.add(
|
|
161
|
+
"fail",
|
|
162
|
+
"locality",
|
|
163
|
+
"all generative deployments are remote/cloud-forwarded; none is eligible under local_only",
|
|
164
|
+
"pull a local model, or set security.locality_mode: allow_remote deliberately",
|
|
165
|
+
)
|
|
166
|
+
for d in deps:
|
|
167
|
+
if d.locality == "remote" and cfg.security.locality_mode == "local_only":
|
|
168
|
+
rep.add("warn", f"deployment:{d.id}", "cloud/remote alias discovered; excluded under local_only", "")
|
|
169
|
+
if d.role == "generative":
|
|
170
|
+
unknown = [k for k in ("tools", "vision", "json_schema") if d.cap(k) == "unknown"]
|
|
171
|
+
if unknown:
|
|
172
|
+
rep.add(
|
|
173
|
+
"warn",
|
|
174
|
+
f"deployment:{d.id}",
|
|
175
|
+
f"capabilities unknown: {unknown} (requests needing them will not route here)",
|
|
176
|
+
f"run `modelsaar probe {d.id}` to verify",
|
|
177
|
+
)
|
|
178
|
+
src = d.raw_metadata.get("num_ctx_source", "")
|
|
179
|
+
if src.startswith("assumed"):
|
|
180
|
+
rep.add(
|
|
181
|
+
"warn",
|
|
182
|
+
f"deployment:{d.id}",
|
|
183
|
+
f"served context length is assumed ({d.context_length}); trained max is {d.raw_metadata.get('trained_context_length')}",
|
|
184
|
+
"set num_ctx in the Modelfile; or declare the runtime's server default once with backends[].default_context_length "
|
|
185
|
+
"(mirrors OLLAMA_CONTEXT_LENGTH); or add a deployments[] override with context_length",
|
|
186
|
+
)
|
|
187
|
+
elif src.startswith("remembered"):
|
|
188
|
+
rep.add(
|
|
189
|
+
"warn",
|
|
190
|
+
f"deployment:{d.id}",
|
|
191
|
+
f"served context length {d.context_length} is {src}",
|
|
192
|
+
"it is re-verified the next time the model is observed loaded; disable backends[].remember_served_context if the runtime's context settings change",
|
|
193
|
+
)
|
|
194
|
+
obs = d.raw_metadata.get("observed_served_context")
|
|
195
|
+
if isinstance(obs, int) and d.context_length and obs < d.context_length:
|
|
196
|
+
rep.add(
|
|
197
|
+
"fail",
|
|
198
|
+
f"deployment:{d.id}",
|
|
199
|
+
f"the runtime serves context {obs} (ollama /api/ps) but the gateway is configured to assume {d.context_length} ({src}): "
|
|
200
|
+
"requests between the two sizes would be truncated by the runtime",
|
|
201
|
+
"lower the declared/override context_length to the served value, or raise num_ctx on the runtime",
|
|
202
|
+
)
|
|
203
|
+
cl = cfg.routing.classifier
|
|
204
|
+
if cl.enabled:
|
|
205
|
+
cd = router.registry.get(f"{cl.backend}/{cl.model}")
|
|
206
|
+
if not cd:
|
|
207
|
+
rep.add("fail", "classifier", f"configured classifier {cl.backend}/{cl.model} not discovered", "fix routing.classifier or disable it")
|
|
208
|
+
elif cd.locality != "local" and cfg.security.locality_mode == "local_only":
|
|
209
|
+
rep.add("fail", "classifier", "classifier deployment is remote under local_only", "choose a local classifier model")
|
|
210
|
+
elif cl.mode == "decision" and cd.role != "decision":
|
|
211
|
+
rep.add("fail", "classifier", f"classifier mode 'decision' but {cd.id} has role {cd.role}", "point routing.classifier.model at a decision model (e.g. Ollama nimble/clef/laya) or use mode: chat")
|
|
212
|
+
elif cl.mode == "chat" and cd.role != "generative":
|
|
213
|
+
rep.add("fail", "classifier", f"classifier mode 'chat' but {cd.id} has role {cd.role}", "set routing.classifier.mode: decision for a decision model or choose a generative model")
|
|
214
|
+
else:
|
|
215
|
+
rep.add("ok", "classifier", f"classifier {cd.id} available (mode {cl.mode})")
|
|
216
|
+
else:
|
|
217
|
+
rep.add("ok", "classifier", "optional classifier disabled (deterministic routing only)")
|
|
218
|
+
for a, _ in cfg.aliases.items():
|
|
219
|
+
if router.alias_contract(a) is None:
|
|
220
|
+
rep.add("warn", f"alias:{a}", "not advertised: no usable deployment satisfies this alias", "")
|
|
221
|
+
else:
|
|
222
|
+
rep.add("ok", f"alias:{a}", f"advertised with {len(router.alias_contract(a)['deployments'])} deployment(s)")
|
|
223
|
+
await router.aclose()
|
|
224
|
+
return rep
|
|
225
|
+
|
|
226
|
+
|
|
227
|
+
def _auth_headers(b) -> dict[str, str]: # type: ignore[no-untyped-def]
|
|
228
|
+
key = b.api_key or (os.environ.get(b.api_key_env) if b.api_key_env else None)
|
|
229
|
+
return {"Authorization": f"Bearer {key}"} if key else {}
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
def run_doctor_sync(cfg: Config | None, cfg_error: str | None, path: Path) -> DoctorReport:
|
|
233
|
+
return asyncio.run(run_doctor(cfg, cfg_error, path))
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Evaluation harness: does intelligent routing beat good fixed policies?"""
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
{"id": "conv-01", "category": "conversation", "split": "calib", "messages": [{"role": "user", "content": "Hi! Can you suggest a name for a small grey kitten?"}], "expected": {"type": "nonempty"}}
|
|
2
|
+
{"id": "conv-02", "category": "conversation", "split": "calib", "messages": [{"role": "user", "content": "What's a polite way to decline a meeting invitation?"}], "expected": {"type": "nonempty"}}
|
|
3
|
+
{"id": "conv-03", "category": "conversation", "split": "test", "messages": [{"role": "user", "content": "Give me one sentence of encouragement before an exam."}], "expected": {"type": "nonempty"}}
|
|
4
|
+
{"id": "conv-04", "category": "conversation", "split": "test", "messages": [{"role": "user", "content": "Which is heavier, a kilogram of feathers or a kilogram of iron? Answer briefly."}], "expected": {"type": "contains_any", "value": ["same", "equal", "neither", "both"]}}
|
|
5
|
+
{"id": "conv-05", "category": "conversation", "split": "test", "messages": [{"role": "user", "content": "Reply with exactly the word: pineapple"}], "expected": {"type": "contains", "value": "pineapple"}}
|
|
6
|
+
{"id": "code-01", "category": "coding", "split": "calib", "messages": [{"role": "user", "content": "Write a Python function `is_palindrome(s)` that ignores case and non-alphanumeric characters. Return only code in a ```python block."}], "expected": {"type": "code_exec", "harness": "print(is_palindrome('A man, a plan, a canal: Panama'), is_palindrome('hello'))", "stdout": "True False"}}
|
|
7
|
+
{"id": "code-02", "category": "coding", "split": "calib", "messages": [{"role": "user", "content": "Write a Python function `fizzbuzz(n)` returning a list of strings for 1..n with the usual FizzBuzz rules. Return only code in a ```python block."}], "expected": {"type": "code_exec", "harness": "print(fizzbuzz(15)[-1], fizzbuzz(15)[2], fizzbuzz(15)[4])", "stdout": "FizzBuzz Fizz Buzz"}}
|
|
8
|
+
{"id": "code-03", "category": "coding", "split": "test", "messages": [{"role": "user", "content": "Write a Python function `word_freq(text)` that returns a dict of lowercase word counts, splitting on whitespace and stripping punctuation .,!? Return only code in a ```python block."}], "expected": {"type": "code_exec", "harness": "print(word_freq('Hi hi, you! You? me.')=={'hi':2,'you':2,'me':1})", "stdout": "True"}}
|
|
9
|
+
{"id": "code-04", "category": "coding", "split": "test", "messages": [{"role": "user", "content": "Fix the bug in this Python code and return the full corrected function in a ```python block:\n```python\ndef mean(xs):\n return sum(xs) / len(xs) + 1\n```"}], "expected": {"type": "code_exec", "harness": "print(mean([2,4,6]))", "stdout": "4.0"}}
|
|
10
|
+
{"id": "code-05", "category": "coding", "split": "test", "messages": [{"role": "user", "content": "Write a Python function `rle(s)` that run-length encodes a string: 'aaabcc' -> 'a3b1c2'. Return only code in a ```python block."}], "expected": {"type": "code_exec", "harness": "print(rle('aaabcc'), rle(''))", "stdout": "a3b1c2"}}
|
|
11
|
+
{"id": "code-06", "category": "coding", "split": "test", "messages": [{"role": "user", "content": "What does this regex match: ^\\d{3}-\\d{4}$ ? Answer in one sentence."}], "expected": {"type": "contains_any", "value": ["three digits", "3 digits", "digits"]}}
|
|
12
|
+
{"id": "agent-01", "category": "agent", "split": "calib", "messages": [{"role": "user", "content": "List the files in the current directory using the available tool."}], "expected": {"type": "tool_call", "name": "bash", "args_contains": {"command": "ls"}}, "tools": [{"type": "function", "function": {"name": "bash", "description": "Run a shell command in the repository", "parameters": {"type": "object", "properties": {"command": {"type": "string"}}, "required": ["command"]}}}]}
|
|
13
|
+
{"id": "agent-02", "category": "agent", "split": "calib", "messages": [{"role": "user", "content": "Open README.md and tell me its first heading. Use the tool."}], "expected": {"type": "tool_call", "name": "read_file", "args_contains": {"path": "README"}}, "tools": [{"type": "function", "function": {"name": "read_file", "description": "Read a file from the workspace", "parameters": {"type": "object", "properties": {"path": {"type": "string"}}, "required": ["path"]}}}]}
|
|
14
|
+
{"id": "agent-03", "category": "agent", "split": "test", "messages": [{"role": "user", "content": "Run the test suite with pytest using the tool and report the result."}], "expected": {"type": "tool_call", "name": "bash", "args_contains": {"command": "pytest"}}, "tools": [{"type": "function", "function": {"name": "bash", "description": "Run a shell command in the repository", "parameters": {"type": "object", "properties": {"command": {"type": "string"}}, "required": ["command"]}}}]}
|
|
15
|
+
{"id": "agent-04", "category": "agent", "split": "test", "messages": [{"role": "user", "content": "Read pyproject.toml via the tool and tell me the project name."}], "expected": {"type": "tool_call", "name": "read_file", "args_contains": {"path": "pyproject"}}, "tools": [{"type": "function", "function": {"name": "read_file", "description": "Read a file from the workspace", "parameters": {"type": "object", "properties": {"path": {"type": "string"}}, "required": ["path"]}}}]}
|
|
16
|
+
{"id": "agent-05", "category": "agent", "split": "test", "messages": [{"role": "user", "content": "Check git status in the repo using the tool."}], "expected": {"type": "tool_call", "name": "bash", "args_contains": {"command": "git"}}, "tools": [{"type": "function", "function": {"name": "bash", "description": "Run a shell command in the repository", "parameters": {"type": "object", "properties": {"command": {"type": "string"}}, "required": ["command"]}}}]}
|
|
17
|
+
{"id": "math-01", "category": "math", "split": "calib", "messages": [{"role": "user", "content": "What is 17 * 23? Reply with just the number."}], "expected": {"type": "number", "value": 391}}
|
|
18
|
+
{"id": "math-02", "category": "math", "split": "calib", "messages": [{"role": "user", "content": "If a train travels 180 km in 2.5 hours, what is its average speed in km/h? Reply with just the number."}], "expected": {"type": "number", "value": 72}}
|
|
19
|
+
{"id": "math-03", "category": "math", "split": "test", "messages": [{"role": "user", "content": "Solve for x: 3x + 7 = 25. Reply with just the number."}], "expected": {"type": "number", "value": 6}}
|
|
20
|
+
{"id": "math-04", "category": "math", "split": "test", "messages": [{"role": "user", "content": "What is the sum of the first 10 positive integers? Reply with just the number."}], "expected": {"type": "number", "value": 55}}
|
|
21
|
+
{"id": "math-05", "category": "math", "split": "test", "messages": [{"role": "user", "content": "A rectangle has perimeter 30 and width 5. What is its area? Reply with just the number."}], "expected": {"type": "number", "value": 50}}
|
|
22
|
+
{"id": "math-06", "category": "math", "split": "test", "messages": [{"role": "user", "content": "Is 97 a prime number? Answer yes or no."}], "expected": {"type": "contains_any", "value": ["yes"]}}
|
|
23
|
+
{"id": "extract-01", "category": "extraction", "split": "calib", "messages": [{"role": "user", "content": "Extract the contact: 'Priya Natarajan, 34, can be reached at priya.n@example.org.'"}], "expected": {"type": "json_schema", "schema": {"type": "object", "properties": {"name": {"type": "string"}, "email": {"type": "string"}, "age": {"type": "integer"}}, "required": ["name", "email", "age"], "additionalProperties": false}, "checks": {"email": "priya.n@example.org", "age": 34}}, "response_format": {"type": "json_schema", "json_schema": {"name": "contact", "strict": true, "schema": {"type": "object", "properties": {"name": {"type": "string"}, "email": {"type": "string"}, "age": {"type": "integer"}}, "required": ["name", "email", "age"], "additionalProperties": false}}}}
|
|
24
|
+
{"id": "extract-02", "category": "extraction", "split": "calib", "messages": [{"role": "user", "content": "Extract the contact: 'Contact Marco Rossi (age 41) via marco@example.com'"}], "expected": {"type": "json_schema", "schema": {"type": "object", "properties": {"name": {"type": "string"}, "email": {"type": "string"}, "age": {"type": "integer"}}, "required": ["name", "email", "age"], "additionalProperties": false}, "checks": {"email": "marco@example.com", "age": 41}}, "response_format": {"type": "json_schema", "json_schema": {"name": "contact", "strict": true, "schema": {"type": "object", "properties": {"name": {"type": "string"}, "email": {"type": "string"}, "age": {"type": "integer"}}, "required": ["name", "email", "age"], "additionalProperties": false}}}}
|
|
25
|
+
{"id": "extract-03", "category": "extraction", "split": "test", "messages": [{"role": "user", "content": "Extract the contact: 'Lin Wei, 29 years old, email lin.wei@example.net'"}], "expected": {"type": "json_schema", "schema": {"type": "object", "properties": {"name": {"type": "string"}, "email": {"type": "string"}, "age": {"type": "integer"}}, "required": ["name", "email", "age"], "additionalProperties": false}, "checks": {"email": "lin.wei@example.net", "age": 29}}, "response_format": {"type": "json_schema", "json_schema": {"name": "contact", "strict": true, "schema": {"type": "object", "properties": {"name": {"type": "string"}, "email": {"type": "string"}, "age": {"type": "integer"}}, "required": ["name", "email", "age"], "additionalProperties": false}}}}
|
|
26
|
+
{"id": "extract-04", "category": "extraction", "split": "test", "messages": [{"role": "user", "content": "Extract the contact: 'Reach Aisha Bello at aisha@example.co; she is 52.'"}], "expected": {"type": "json_schema", "schema": {"type": "object", "properties": {"name": {"type": "string"}, "email": {"type": "string"}, "age": {"type": "integer"}}, "required": ["name", "email", "age"], "additionalProperties": false}, "checks": {"email": "aisha@example.co", "age": 52}}, "response_format": {"type": "json_schema", "json_schema": {"name": "contact", "strict": true, "schema": {"type": "object", "properties": {"name": {"type": "string"}, "email": {"type": "string"}, "age": {"type": "integer"}}, "required": ["name", "email", "age"], "additionalProperties": false}}}}
|
|
27
|
+
{"id": "sum-01", "category": "summarization", "split": "calib", "messages": [{"role": "user", "content": "Summarize in one sentence: The town council met on Tuesday to discuss the new bicycle lane proposal. Supporters argued it would reduce traffic and improve safety for children cycling to school. Opponents raised concerns about lost parking spaces for shops on Main Street. After two hours of debate, the council voted 5-2 to approve a six-month trial starting in March, with a review of parking impact in June."}], "expected": {"type": "contains_any", "value": ["trial", "approve", "bicycle", "bike"]}}
|
|
28
|
+
{"id": "sum-02", "category": "summarization", "split": "test", "messages": [{"role": "user", "content": "TL;DR in under 20 words: The town council met on Tuesday to discuss the new bicycle lane proposal. Supporters argued it would reduce traffic and improve safety for children cycling to school. Opponents raised concerns about lost parking spaces for shops on Main Street. After two hours of debate, the council voted 5-2 to approve a six-month trial starting in March, with a review of parking impact in June."}], "expected": {"type": "contains_any", "value": ["trial", "approved", "bicycle", "bike", "lane"]}}
|
|
29
|
+
{"id": "sum-03", "category": "summarization", "split": "test", "messages": [{"role": "user", "content": "Give the key points as 3 bullets: The town council met on Tuesday to discuss the new bicycle lane proposal. Supporters argued it would reduce traffic and improve safety for children cycling to school. Opponents raised concerns about lost parking spaces for shops on Main Street. After two hours of debate, the council voted 5-2 to approve a six-month trial starting in March, with a review of parking impact in June."}], "expected": {"type": "contains_any", "value": ["parking", "trial", "5-2", "safety"]}}
|
|
30
|
+
{"id": "trans-01", "category": "translation", "split": "calib", "messages": [{"role": "user", "content": "Translate to French: 'The library opens at nine tomorrow.'"}], "expected": {"type": "contains_any", "value": ["bibliothèque", "bibliotheque"]}}
|
|
31
|
+
{"id": "trans-02", "category": "translation", "split": "test", "messages": [{"role": "user", "content": "Translate into Spanish: 'Where is the nearest train station?'"}], "expected": {"type": "contains_any", "value": ["estación", "estacion"]}}
|
|
32
|
+
{"id": "trans-03", "category": "translation", "split": "test", "messages": [{"role": "user", "content": "Übersetze ins Englische: 'Der Zug hat zwanzig Minuten Verspätung.'"}], "expected": {"type": "contains_any", "value": ["twenty minutes", "20 minutes"]}}
|
|
33
|
+
{"id": "multi-01", "category": "conversation", "split": "test", "messages": [{"role": "user", "content": "¿Puedes explicarme brevemente qué es la fotosíntesis?"}], "expected": {"type": "contains_any", "value": ["luz", "planta", "energía", "energia", "sol"]}}
|
|
34
|
+
{"id": "multi-02", "category": "math", "split": "test", "messages": [{"role": "user", "content": "計算:12 × 12 = ? 只回答数字。"}], "expected": {"type": "number", "value": 144}}
|
|
35
|
+
{"id": "ambig-01", "category": "coding", "split": "test", "messages": [{"role": "user", "content": "it keeps saying undefined is not a function"}], "expected": {"type": "contains_any", "value": ["javascript", "function", "undefined", "call"]}}
|
|
36
|
+
{"id": "ambig-02", "category": "conversation", "split": "test", "messages": [{"role": "user", "content": "thoughts?"}], "expected": {"type": "nonempty"}}
|
|
37
|
+
{"id": "ambig-03", "category": "math", "split": "test", "messages": [{"role": "user", "content": "prove it"}], "expected": {"type": "nonempty"}}
|
|
38
|
+
{"id": "rag-01", "category": "rag", "split": "calib", "messages": [{"role": "user", "content": "Context: The Meridian Bridge was completed in 1932 and spans 410 metres. It was repainted in 2019 in a shade called 'harbour blue'.\n\nQuestion: When was the bridge repainted? Use only the context."}], "expected": {"type": "contains", "value": "2019"}}
|
|
39
|
+
{"id": "rag-02", "category": "rag", "split": "test", "messages": [{"role": "user", "content": "Context: The Meridian Bridge was completed in 1932 and spans 410 metres. It was repainted in 2019 in a shade called 'harbour blue'.\n\nQuestion: How long is the bridge? Use only the context."}], "expected": {"type": "contains", "value": "410"}}
|
|
40
|
+
{"id": "rag-03", "category": "rag", "split": "test", "messages": [{"role": "user", "content": "Context: The Meridian Bridge was completed in 1932 and spans 410 metres. It was repainted in 2019 in a shade called 'harbour blue'.\n\nQuestion: What colour was used in the repaint? Use only the context."}], "expected": {"type": "contains_any", "value": ["harbour blue", "blue"]}}
|
|
41
|
+
{"id": "dec-01", "category": "decision", "split": "calib", "messages": [{"role": "user", "content": "Classify the sentiment of 'This update broke everything and support ignored me' as positive, negative, or neutral. One word."}], "expected": {"type": "contains", "value": "negative"}}
|
|
42
|
+
{"id": "dec-02", "category": "decision", "split": "test", "messages": [{"role": "user", "content": "Which category fits 'How do I reset my password?': billing, account, or shipping? One word."}], "expected": {"type": "contains", "value": "account"}}
|
|
43
|
+
{"id": "dec-03", "category": "decision", "split": "test", "messages": [{"role": "user", "content": "Is the following statement about weather or sports? 'The striker scored twice in the second half.' One word."}], "expected": {"type": "contains", "value": "sports"}}
|
|
44
|
+
{"id": "vis-01", "category": "document_vision", "split": "calib", "messages": [{"role": "user", "content": [{"type": "text", "text": "What single colour is this image? One word."}, {"type": "image_url", "image_url": {"url": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAADElEQVR4nGP4z8AAAAMBAQDJ/pLvAAAAAElFTkSuQmCC"}}]}], "expected": {"type": "contains", "value": "red"}}
|
|
45
|
+
{"id": "vis-02", "category": "document_vision", "split": "test", "messages": [{"role": "user", "content": [{"type": "text", "text": "Describe the dominant colour of this image in one word."}, {"type": "image_url", "image_url": {"url": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAADElEQVR4nGP4z8AAAAMBAQDJ/pLvAAAAAElFTkSuQmCC"}}]}], "expected": {"type": "contains", "value": "red"}}
|
|
46
|
+
{"id": "cont-01", "category": "agent", "split": "test", "messages": [{"role": "user", "content": "List files in the repo with the tool, then tell me how many there are."}, {"role": "assistant", "content": null, "tool_calls": [{"id": "call_eval_1", "type": "function", "function": {"name": "bash", "arguments": "{\"command\":\"ls\"}"}}]}, {"role": "tool", "tool_call_id": "call_eval_1", "content": "README.md\npyproject.toml\nsrc\ntests"}], "tools": [{"type": "function", "function": {"name": "bash", "description": "Run a shell command in the repository", "parameters": {"type": "object", "properties": {"command": {"type": "string"}}, "required": ["command"]}}}], "expected": {"type": "contains_any", "value": ["4", "four"]}}
|
|
47
|
+
{"id": "long-01", "category": "summarization", "split": "test", "messages": [{"role": "user", "content": "Convert the following text to uppercase and return only the first 5 words:\nline 0: the quick brown fox jumps over the lazy dog line 1: the quick brown fox jumps over the lazy dog line 2: the quick brown fox jumps over the lazy dog line 3: the quick brown fox jumps over the lazy dog line 4: the quick brown fox jumps over the lazy dog line 5: the quick brown fox jumps over the lazy dog line 6: the quick brown fox jumps over the lazy dog line 7: the quick brown fox jumps over the lazy dog line 8: the quick brown fox jumps over the lazy dog line 9: the quick brown fox jumps over the lazy dog line 10: the quick brown fox jumps over the lazy dog line 11: the quick brown fox jumps over the lazy dog line 12: the quick brown fox jumps over the lazy dog line 13: the quick brown fox jumps over the lazy dog line 14: the quick brown fox jumps over the lazy dog line 15: the quick brown fox jumps over the lazy dog line 16: the quick brown fox jumps over the lazy dog line 17: the quick brown fox jumps over the lazy dog line 18: the quick brown fox jumps over the lazy dog line 19: the quick brown fox jumps over the lazy dog line 20: the quick brown fox jumps over the lazy dog line 21: the quick brown fox jumps over the lazy dog line 22: the quick brown fox jumps over the lazy dog line 23: the quick brown fox jumps over the lazy dog line 24: the quick brown fox jumps over the lazy dog line 25: the quick brown fox jumps over the lazy dog line 26: the quick brown fox jumps over the lazy dog line 27: the quick brown fox jumps over the lazy dog line 28: the quick brown fox jumps over the lazy dog line 29: the quick brown fox jumps over the lazy dog line 30: the quick brown fox jumps over the lazy dog line 31: the quick brown fox jumps over the lazy dog line 32: the quick brown fox jumps over the lazy dog line 33: the quick brown fox jumps over the lazy dog line 34: the quick brown fox jumps over the lazy dog line 35: the quick brown fox jumps over the lazy dog line 36: the quick brown fox jumps over the lazy dog line 37: the quick brown fox jumps over the lazy dog line 38: the quick brown fox jumps over the lazy dog line 39: the quick brown fox jumps over the lazy dog line 40: the quick brown fox jumps over the lazy dog line 41: the quick brown fox jumps over the lazy dog line 42: the quick brown fox jumps over the lazy dog line 43: the quick brown fox jumps over the lazy dog line 44: the quick brown fox jumps over the lazy dog line 45: the quick brown fox jumps over the lazy dog line 46: the quick brown fox jumps over the lazy dog line 47: the quick brown fox jumps over the lazy dog line 48: the quick brown fox jumps over the lazy dog line 49: the quick brown fox jumps over the lazy dog line 50: the quick brown fox jumps over the lazy dog line 51: the quick brown fox jumps over the lazy dog line 52: the quick brown fox jumps over the lazy dog line 53: the quick brown fox jumps over the lazy dog line 54: the quick brown fox jumps over the lazy dog line 55: the quick brown fox jumps over the lazy dog line 56: the quick brown fox jumps over the lazy dog line 57: the quick brown fox jumps over the lazy dog line 58: the quick brown fox jumps over the lazy dog line 59: the quick brown fox jumps over the lazy dog"}], "expected": {"type": "contains", "value": "LINE 0: THE QUICK BROWN"}}
|