manager: match a sibling config by its alias, not through the alias map

Third attempt at this, and the first two failed for the same reason: they asked
_config_for_model(requested_id) to find the sibling, but that helper resolves an
alias THROUGH self.model_aliases to the shared weights path — landing right back on
the wrong sibling. So the comparison was always "same object", the swap never
happened, and 0.1.94 still logged

  [vram-est][debug] key='…/gemma-4-26B-A4B-…gguf' -> 51.97 GB | measured_cfg=51.969
  Loading '…gguf': need 52.0 GB VRAM — evicting
  On-request VRAM eviction: unloading active model 'lisa-32k' (measured 22.47 GB)

The estimator now scans self.config for an entry whose `alias` field IS the
requested id. Aliases are unique per entry, so it needs no path comparison and
doesn't depend on how self.config is keyed — which is what the earlier attempts
got wrong. The path-based rule stays as a fallback for entries without an alias.
Co-Authored-By: 's avatarClaude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0182DhR1eFNPQyGmDrpHbedY
parent ee73a01d
...@@ -3988,6 +3988,18 @@ class MultiModelManager: ...@@ -3988,6 +3988,18 @@ class MultiModelManager:
# 12.6 GB free" evicted the very model that was already serving, then # 12.6 GB free" evicted the very model that was already serving, then
# reloaded it at 18 of 65 layers. Prefer the config of the name actually # reloaded it at 18 of 65 layers. Prefer the config of the name actually
# REQUESTED whenever it names a same-path sibling. # REQUESTED whenever it names a same-path sibling.
# First, the reliable discriminator: an entry whose `alias` IS the id the
# caller asked for. Aliases are unique per entry, so this needs no path
# comparison and does not care how self.config happens to be keyed —
# _config_for_model() resolves an alias THROUGH the alias map to the shared
# path, which lands on the sibling and is exactly what went wrong here.
if requested_id:
for _k, _c in (self.config or {}).items():
if isinstance(_c, dict) and _c.get('alias') == requested_id and _c is not cfg:
print(f" [vram-est] sizing '{requested_id}' by its own config "
f"(shares a weights file with '{str(model_key).split('/')[-1]}')")
cfg = _c
break
for _cand in (requested_id, resolved_name): for _cand in (requested_id, resolved_name):
if not _cand or _cand == model_key: if not _cand or _cand == model_key:
continue continue
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment