fix(llm): Test-Chat-Timeout 15s -> 120s fuer kalten Modell-Swap

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 <noreply@anthropic.com>
This commit is contained in:
2026-09-19 11:45:45 +02:00
co-authored by Claude Opus 4.8
parent 6918ddca61
commit 76e8b8e04c
+3 -3
View File
@@ -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") {