[object Object]

← back to Rentv

5x sweep 1: enhance endpoint — disable qwen3 think pass (16s->0.5s) + 30s graceful timeout

2a7f90c6a41a4217fb600106d6003debeda6e604 · 2026-08-13 14:53:40 -0700 · Steve

Files touched

Diff

commit 2a7f90c6a41a4217fb600106d6003debeda6e604
Author: Steve <steve@designerwallcoverings.com>
Date:   Thu Aug 13 14:53:40 2026 -0700

    5x sweep 1: enhance endpoint — disable qwen3 think pass (16s->0.5s) + 30s graceful timeout
---
 server.js | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/server.js b/server.js
index e9b8b1ae..768e222d 100644
--- a/server.js
+++ b/server.js
@@ -2844,8 +2844,11 @@ app.post('/api/live/enhance', adminOnly, async (q, r) => {
   try {
     const resp = await fetch(OLLAMA_URL + '/api/generate', {
       method: 'POST', headers: { 'Content-Type': 'application/json' },
-      body: JSON.stringify({ model: DRAFT_MODEL, prompt: (q.body || {}).prompt || '', stream: false, options: { temperature: 0.5 } }),
-      signal: AbortSignal.timeout(60000),
+      // think:false disables qwen3's hidden reasoning pass — without it a draft polish takes
+      // ~16s (cold: longer) because the model "thinks" first; with it, sub-second. 30s abort is
+      // ample headroom yet still degrades gracefully (ok:false) if Ollama stalls, never hanging the UI.
+      body: JSON.stringify({ model: DRAFT_MODEL, prompt: (q.body || {}).prompt || '', stream: false, think: false, options: { temperature: 0.5 } }),
+      signal: AbortSignal.timeout(30000),
     });
     if (!resp.ok) return r.json({ ok: false, error: 'local model unavailable (' + resp.status + ')' });
     let out = String((await resp.json()).response || '').trim();

← abae928b auto-data-snapshot: 2026-08-13T14:34:02 (7 data files) — dat  ·  back to Rentv  ·  auto-data-snapshot: 2026-08-13T15:04:38 (8 data files) — 5x/ 4bef0d4a →