MCPcopy Create free account
hub / github.com/CommonstackAI/UncommonRoute / _load_seed_data

Function _load_seed_data

uncommon_route/benchmark.py:220–244  ·  view source on GitHub ↗

Load seed benchmark data. Checks two locations in order: 1. User data dir: ~/.uncommon-route/benchmark_seed.json (user overrides) 2. Package data: uncommon_route/router/benchmark_seed.json (shipped default) Seed data bootstraps quality estimation before the first API fetch.

()

Source from the content-addressed store, hash-verified

218
219
220def _load_seed_data() -> dict[str, float]:
221 """Load seed benchmark data.
222
223 Checks two locations in order:
224 1. User data dir: ~/.uncommon-route/benchmark_seed.json (user overrides)
225 2. Package data: uncommon_route/router/benchmark_seed.json (shipped default)
226
227 Seed data bootstraps quality estimation before the first API fetch.
228 The package ships with PinchBench baseline data so routing works
229 correctly from the first request.
230 """
231 for path in [
232 _DATA_DIR / "benchmark_seed.json",
233 Path(__file__).parent / "router" / "benchmark_seed.json",
234 ]:
235 if path.exists():
236 try:
237 raw = json.loads(path.read_text(encoding="utf-8"))
238 if isinstance(raw, dict):
239 result = {str(k): float(v) for k, v in raw.items() if isinstance(v, (int, float))}
240 if result:
241 return result
242 except Exception:
243 continue
244 return {}
245
246
247_PINCHBENCH_SEED: dict[str, float] = _load_seed_data()

Callers 1

benchmark.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected