Files
LLM-Server/scripts/switch-model.sh
haylanandClaude-Bot 5d6a17fd9b feat: remove llama-server-fast (Qwen3-4B classifier model)
Drops the second always-resident llama.cpp instance, its downloader,
and the omniroute depends_on entry. Also strips the now-dead
LLAMA_FAST_* block from .env.example and the stale VRAM-budget comment
in scripts/switch-model.sh that assumed this service was always up.

Note: this was qwen-code's Auto Mode Stage 1 classifier (fastModel) —
see docs/research/fast-model-choice.md and issue #44. Auto Mode will
lose that classifier until/unless it's reconfigured to route
elsewhere or fall back to prompt-only classification.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DjhxWirQepKFEQj1huXNJR
2026-09-07 19:33:50 +02:00

51 lines
1.4 KiB
Bash

#!/usr/bin/env bash
# Swap GPU residency between llama-server (Qwen) and comfyui — they never
# run concurrently, VRAM doesn't fit both (see issue #38's map). Manual
# invocation only, no auto-switching.
#
# Bypasses lazytainer entirely and drives docker compose directly — its
# idle-stop can't be used for this. Root cause (see
# docs/research/lazytainer-omniroute-idle-stop.md, issue #40): lazytainer's
# packet-threshold detector is source-blind and can't tell OmniRoute's
# periodic health-check pings apart from real traffic on the same port, so
# it never reliably sleeps a service on its own. A scripted swap always
# knows which service should go up/down, so it doesn't need that heuristic.
#
# OmniRoute may show the just-stopped provider as errored/offline in its
# dashboard for up to CREDENTIAL_HEALTH_CHECK_INTERVAL (default 5 min) after
# a swap — cosmetic, not a functional problem (see the research doc above).
set -euo pipefail
cd "$(dirname "$0")/.."
usage() {
echo "Usage: $0 {qwen|comfyui}" >&2
echo " qwen - stop comfyui, start llama-server" >&2
echo " comfyui - stop llama-server, start comfyui" >&2
exit 1
}
[ $# -eq 1 ] || usage
case "$1" in
qwen)
from=comfyui
to=llama-server
;;
comfyui)
from=llama-server
to=comfyui
;;
*)
usage
;;
esac
echo "==> stopping $from"
docker compose stop "$from"
echo "==> starting $to"
docker compose up -d "$to"
echo "==> status"
docker compose ps