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

Method fetch

uncommon_route/benchmark.py:195–217  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

193 return 300
194
195 async def fetch(self) -> dict[str, ModelBenchmarkEntry]:
196 if not self._path.exists():
197 return {}
198 try:
199 raw = json.loads(self._path.read_text(encoding="utf-8"))
200 entries: dict[str, ModelBenchmarkEntry] = {}
201 now = time.time()
202 for model_id, values in raw.items():
203 if isinstance(values, dict):
204 entries[model_id] = ModelBenchmarkEntry(
205 overall=float(values.get("overall", values.get("avg", 0.5))),
206 categories=dict(values.get("categories", {})),
207 raw=dict(values.get("raw", {})),
208 fetched_at=now,
209 )
210 elif isinstance(values, (int, float)):
211 entries[model_id] = ModelBenchmarkEntry(
212 overall=float(values), fetched_at=now,
213 )
214 return entries
215 except Exception as exc:
216 logger.warning("Local benchmark file load failed: %s", exc)
217 return {}
218
219
220def _load_seed_data() -> dict[str, float]:

Callers

nothing calls this directly

Calls 2

ModelBenchmarkEntryClass · 0.85
getMethod · 0.45

Tested by

no test coverage detected