From e2547ec301ab5f09480a21f8a596fda1617a7c68 Mon Sep 17 00:00:00 2001 From: Hitonabi Date: Fri, 26 Jun 2026 15:21:02 +0200 Subject: [PATCH] =?UTF-8?q?Fix:=20ung=C3=BCltige=20--prompt-cache-Flags=20?= =?UTF-8?q?entfernen=20(blockierten=20llama-server-Start)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit llama-server lehnt --prompt-cache/--prompt-cache-all ab ("invalid argument") und startet dann nicht — dadurch ließ sich KEIN Modell mehr wecken (u.a. das Hermes-WebUI bekam "empty stream"). Die Flags gehören zu llama-cli, nicht zum Server; Prompt-Caching macht llama-server automatisch pro Slot (KV-Reuse). - config.py: Flags aus _DEFAULT_CMD_TEMPLATE entfernt (+ Warnhinweis). - migrate_config.py: statt die Flags hinzuzufügen, entfernt es sie nun aus bestehenden cmds (Reparatur-Migration). Box-config.yaml wurde bereits direkt korrigiert (alle 7 Modelle); verifiziert: Hermes lädt + streamt wieder sauber. Co-Authored-By: Claude Opus 4.8 --- backend/config.py | 5 ++++- backend/migrate_config.py | 13 ++++++------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/backend/config.py b/backend/config.py index e5732ee..660ed10 100644 --- a/backend/config.py +++ b/backend/config.py @@ -22,9 +22,12 @@ DISCOVER_TTL = int(os.environ.get("MC_DISCOVER_TTL", "43200")) # 12 h # Geteiltes Gedächtnis (SQLite, WAL). Persistent neben den Modellen. MEMORY_DB = Path(os.environ.get("MC_MEMORY_DB", str(MODELS_DIR / "mc2-memory.db"))) # Befehl-Vorlage für llama-swap: {model}=GGUF-Pfad, {ctx}=Kontext, ${PORT} bleibt stehen. +# Hinweis: --prompt-cache/--prompt-cache-all sind llama-CLI-Flags, NICHT llama-server — +# llama-server lehnt sie ab ("invalid argument") und startet dann nicht. Prompt-Caching +# macht llama-server ohnehin automatisch pro Slot (KV-Reuse). _DEFAULT_CMD_TEMPLATE = ( "llama-server -m {model} --host 127.0.0.1 --port ${PORT} " - "-c {ctx} -ngl 999 -fa 1 --no-mmap --prompt-cache --prompt-cache-all" + "-c {ctx} -ngl 999 -fa 1 --no-mmap" ) CMD_TEMPLATE = os.environ.get("MC_CMD_TEMPLATE", _DEFAULT_CMD_TEMPLATE) if "{model}" not in CMD_TEMPLATE: diff --git a/backend/migrate_config.py b/backend/migrate_config.py index 74b6af3..86c2930 100644 --- a/backend/migrate_config.py +++ b/backend/migrate_config.py @@ -26,13 +26,12 @@ def migrate(): continue print(f"Migrating model: {name}") - - # 1. Ensure prompt caching flags exist - if "--prompt-cache " not in cmd and not cmd.endswith("--prompt-cache") and not cmd.endswith("--prompt-cache\n"): - cmd = cmd.strip() + " --prompt-cache" - if "--prompt-cache-all" not in cmd: - cmd = cmd.strip() + " --prompt-cache-all" - + + # 1. Defektes --prompt-cache/--prompt-cache-all entfernen (llama-CLI-Flags, + # die llama-server ablehnt → Start scheitert). Caching macht llama-server + # automatisch pro Slot. + cmd = cmd.replace(" --prompt-cache-all", "").replace(" --prompt-cache", "") + # 2. Extract aliases/role aliases = spec.get("aliases", []) role = aliases[0] if aliases else None