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

Method _build_index

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

Source from the content-addressed store, hash-verified

505 return f"{provider}/{name}" if provider else name
506
507 def _build_index(self) -> None:
508 self._normalized_index: dict[str, tuple[str, str]] = {}
509 self._family_index: dict[str, list[tuple[str, str, float]]] = {}
510 for source_name, entries in self._sources.items():
511 for model_id, entry in entries.items():
512 norm = model_id.lower().replace(".", "-").replace("_", "-")
513 core = model_id.split("/", 1)[-1].lower() if "/" in model_id else model_id.lower()
514 self._normalized_index[norm] = (source_name, model_id)
515 self._normalized_index[core] = (source_name, model_id)
516 family = self._extract_model_family(model_id)
517 self._family_index.setdefault(family, []).append(
518 (source_name, model_id, entry.overall)
519 )
520
521 @staticmethod
522 def _sample_count(entry: ModelBenchmarkEntry) -> int:

Calls 2

_extract_model_familyMethod · 0.95
appendMethod · 0.45