perf(brain): env to disable pre-loop planner; cut voice latency
Warm per-turn timing showed STT 0.1s, TTS ~1-3s, but the reply engine (LLM) was 8-17s — even a simple "고마워" took 16.7s — because it makes multiple model calls per turn. Add a PLANNER_ENABLED env override (config.py) and default it to 0 in the userbot compose so the pre-loop planner's extra LLM round-trip is dropped on this latency-sensitive voice deployment. Also pins STT_LANGUAGE=ko in compose. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -69,6 +69,11 @@ services:
|
||||
WHISPER_COMPUTE_TYPE: ${WHISPER_COMPUTE_TYPE:-float16}
|
||||
# Optional single-language lock for replies (empty = user's own language).
|
||||
OUTPUT_LANGUAGE: ${OUTPUT_LANGUAGE:-}
|
||||
# Drop the pre-loop planner LLM call to cut voice-reply latency on small
|
||||
# hardware (the planner adds a full model round-trip per turn).
|
||||
PLANNER_ENABLED: ${PLANNER_ENABLED:-0}
|
||||
# Lock STT to Korean (skip Whisper auto-detect).
|
||||
STT_LANGUAGE: ${STT_LANGUAGE:-ko}
|
||||
BRIDGE_URL: http://127.0.0.1:8765
|
||||
depends_on:
|
||||
- ollama
|
||||
|
||||
@@ -710,7 +710,15 @@ def load_settings() -> Settings:
|
||||
else:
|
||||
evaluator_enabled = bool(_eval_raw)
|
||||
planner_model = str(merged.get("planner_model", "") or "").strip()
|
||||
planner_enabled = bool(merged.get("planner_enabled", True))
|
||||
# Env override (PLANNER_ENABLED=0/1) so a latency-sensitive voice deployment
|
||||
# can drop the pre-loop planner LLM call without editing the config file.
|
||||
_planner_env = os.environ.get("PLANNER_ENABLED", "").strip().lower()
|
||||
if _planner_env in ("0", "false", "no", "off"):
|
||||
planner_enabled = False
|
||||
elif _planner_env in ("1", "true", "yes", "on"):
|
||||
planner_enabled = True
|
||||
else:
|
||||
planner_enabled = bool(merged.get("planner_enabled", True))
|
||||
try:
|
||||
planner_timeout_sec = float(merged.get("planner_timeout_sec", 6.0))
|
||||
except (TypeError, ValueError):
|
||||
|
||||
Reference in New Issue
Block a user