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