MCPcopy
hub / github.com/Andyyyy64/whichllm / _resolve_moe_active_params

Function _resolve_moe_active_params

src/whichllm/models/fetcher.py:171–187  ·  view source on GitHub ↗

Resolve active params from curated data or A*B naming hints.

(
    total_params: int,
    *model_refs: str | None,
)

Source from the content-addressed store, hash-verified

169
170
171def _resolve_moe_active_params(
172 total_params: int,
173 *model_refs: str | None,
174) -> int | None:
175 """Resolve active params from curated data or A*B naming hints."""
176 for ref in model_refs:
177 if not ref:
178 continue
179 active = _lookup_curated_count(_KNOWN_MOE_ACTIVE_PARAMS, ref)
180 if active and active > 0:
181 return active
182
183 for ref in model_refs:
184 active = _extract_active_size_hint_from_id(ref)
185 if active and active > 0 and (total_params <= 0 or active < total_params):
186 return active
187 return None
188
189
190# Sliding-window-attention (SWA) registry. We only model SWA KV-cache savings

Callers 2

_parse_modelFunction · 0.85
dicts_to_modelsFunction · 0.85

Calls 2

_lookup_curated_countFunction · 0.85

Tested by

no test coverage detected