Fix: Modell-Manager Rollen-Taxonomie vereinheitlicht (5 Rollen) + echter Vocab-Check

- Rollen ueberall = fast/heavy/coder/vision/scout (eine Quelle der Wahrheit):
  sources.py CATEGORIES (agent/reasoning raus, fast/heavy rein), llamaswap.ROLE_IDS,
  maintenance ROLE_MAP entfernt (Discover-Rollen == Serving-Rollen), Discover.tsx
  ROLE_METADATA, ModelBadges.ROLES, ActiveModelsCard (stale reasoning-Farbe raus).
  Behebt: Discover zeigte "Reasoning"/"agent"; aus Discover installierte Modelle
  landeten in keinem Cockpit-Slot.
- gguf_meta: Vocab-Check jetzt ECHT - sha256 ueber die vollstaendige Token-Liste statt
  nur Metadaten. Familienunabhaengig (Qwen/Llama/Mistral/...). Verifiziert: Coder + Qwen3-0.6B
  byte-identisch (kompatibel), Qwen3.6 abweichend (inkompatibel), 0.11s/Scan.
- RolesCard SPEC-Badge -> spec_active (Konsistenz mit Cockpit).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Hitonabi
2026-06-27 02:26:27 +02:00
parent 65d8ab5fe3
commit 38f0394166
10 changed files with 76 additions and 62 deletions
+4 -12
View File
@@ -168,19 +168,11 @@ def model_upgrades() -> list[dict]:
cmds = " ".join(str(s.get("cmd", "")).lower()
for s in (llamaswap.read_config().get("models") or {}).values())
out = []
ROLE_MAP = {
"agent": "fast",
"scout": "fast",
"coder": "coder",
"vision": "vision"
}
# Discover-Rollen == Serving-Rollen (fast/heavy/coder/vision/scout) → kein Mapping mehr.
for c in disc.get("categories", []):
disc_role = c["role"]
mapped_role = ROLE_MAP.get(disc_role, disc_role)
if mapped_role not in active_roles:
role = c["role"]
if role not in active_roles: # nur Rollen, die bereits ein Modell haben
continue
rec = c.get("recommended")
@@ -190,7 +182,7 @@ def model_upgrades() -> list[dict]:
stem = base[:-5] if base.endswith("-gguf") else base
if base in cmds or (stem and stem in cmds):
continue
out.append({"role": mapped_role, "title": c["title"], "repo": rec})
out.append({"role": role, "title": c["title"], "repo": rec})
return out