From 76e8b8e04c2a586c4c7246b928cfff623a445977 Mon Sep 17 00:00:00 2001 From: duffyduck Date: Sat, 19 Sep 2026 11:45:45 +0200 Subject: [PATCH] fix(llm): Test-Chat-Timeout 15s -> 120s fuer kalten Modell-Swap MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit qwen3-8b antwortete in ~13s (unter 15s) und kam durch; qwen3-4b lief in "Timeout", obwohl kleiner. Ursache ist nicht die Modellgroesse, sondern der KALTE Modell-Swap: beim ersten Wechsel entlaedt llama-swap das alte Modell und laedt das neue GGUF frisch in den VRAM (+ erste Inferenz) — das dauert laenger als die 15s, die sendToRVS_withResponse hart als Timeout hatte. sendToRVS_withResponse nimmt jetzt ein optionales timeoutMs (Default 15s unveraendert fuer Voice-List etc.); llm_test uebergibt 120s. Der Adapter selbst deckt den Swap mit LLM_TIMEOUT_SEC=60 ab und meldet waehrenddessen llm_status "loading". Co-Authored-By: Claude Opus 4.8 --- diagnostic/server.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/diagnostic/server.js b/diagnostic/server.js index 71a6898..34968a6 100644 --- a/diagnostic/server.js +++ b/diagnostic/server.js @@ -1246,7 +1246,7 @@ function connectRVS(forcePlain) { }); } -function sendToRVS_withResponse(sendType, sendPayload, expectType, clientWs) { +function sendToRVS_withResponse(sendType, sendPayload, expectType, clientWs, timeoutMs = 15000) { if (!RVS_HOST || !RVS_TOKEN) return; const proto = RVS_TLS === "true" ? "wss" : "ws"; const url = `${proto}://${RVS_HOST}:${RVS_PORT}?token=${RVS_TOKEN}`; @@ -1254,7 +1254,7 @@ function sendToRVS_withResponse(sendType, sendPayload, expectType, clientWs) { const timeout = setTimeout(() => { try { freshWs.close(); } catch (_) {} clientWs.send(JSON.stringify({ type: expectType, payload: { voices: [], error: "Timeout" }, timestamp: Date.now() })); - }, 15000); + }, timeoutMs); freshWs.on("open", () => { freshWs.send(JSON.stringify({ type: sendType, payload: sendPayload, timestamp: Date.now() })); }); @@ -2948,7 +2948,7 @@ wss.on("connection", (ws) => { messages: [{ role: "user", content: String(msg.text || "Sag kurz Hallo.") }], max_tokens: 256, temperature: 0.5, model: msg.model || "", targetInstance: msg.targetInstance || "", - }, "llm_response", ws); + }, "llm_response", ws, 120000); // 2min: erster Modell-Swap laedt das GGUF kalt (mehrere GB) — 15s reichen dann nicht log("info", "llm", `Test-Chat → ${msg.model || "?"} @ ${msg.targetInstance || "(broadcast)"}`); } else if (msg.action === "node_stats_stream_start" || msg.action === "node_stats_stream_stop" || msg.action === "node_stats_history_request" || msg.action === "node_stats_reset") {