Quellcode durchsuchen

fix(llm): use LLM_MODEL env var instead of hardcoded 'default'

wenhongquan vor 3 Wochen
Ursprung
Commit
2478295a00
1 geänderte Dateien mit 3 neuen und 2 gelöschten Zeilen
  1. 3 2
      asr_agent/conversation_worker.py

+ 3 - 2
asr_agent/conversation_worker.py

@@ -50,6 +50,7 @@ MIN_SILENCE_S = 0.8           # silence to end utterance
 MAX_SPEECH_S = 8.0           # force transcribe after this much continuous speech
 
 # ── LLM ──
+LLM_MODEL = os.environ.get("LLM_MODEL", "qwen3.6-35b-awq")
 LLM_MAX_TOKENS = 128
 LLM_TEMPERATURE = 0.7
 
@@ -72,7 +73,7 @@ async def _llm_stream(prompt: str, hist: list[dict]):
     async with aiohttp.ClientSession() as s:
         async with s.post(
             f"{VLLM_URL}/chat/completions",
-            json={"model": "default", "messages": msgs, "max_tokens": LLM_MAX_TOKENS,
+            json={"model": LLM_MODEL, "messages": msgs, "max_tokens": LLM_MAX_TOKENS,
                   "temperature": LLM_TEMPERATURE, "stream": True},
             timeout=aiohttp.ClientTimeout(total=20),
         ) as r:
@@ -103,7 +104,7 @@ async def _llm(prompt: str, hist: list[dict]) -> str:
     async with aiohttp.ClientSession() as s:
         async with s.post(
             f"{VLLM_URL}/chat/completions",
-            json={"model": "default", "messages": msgs, "max_tokens": LLM_MAX_TOKENS,
+            json={"model": LLM_MODEL, "messages": msgs, "max_tokens": LLM_MAX_TOKENS,
                   "temperature": LLM_TEMPERATURE},
             timeout=aiohttp.ClientTimeout(total=15),
         ) as r: