[object Object]

← back to Enrich Local Hybrid

enrich-local: raise VL timeout 120s→300s + keep_alive 15m to absorb Mac1 cold-load

79237c91bf6c6be8b57f8390525f84acd18f9a1c · 2026-06-24 10:46:25 -0700 · Steve

Files touched

Diff

commit 79237c91bf6c6be8b57f8390525f84acd18f9a1c
Author: Steve <steve@designerwallcoverings.com>
Date:   Wed Jun 24 10:46:25 2026 -0700

    enrich-local: raise VL timeout 120s→300s + keep_alive 15m to absorb Mac1 cold-load
---
 enrich-local.js | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/enrich-local.js b/enrich-local.js
index 0d261e9..5d49240 100644
--- a/enrich-local.js
+++ b/enrich-local.js
@@ -42,12 +42,15 @@ function ollamaVL(imageB64, palette) {
     physicalWidthInches: { type: 'number' }, physicalHeightInches: { type: 'number' },
     usable: { type: 'boolean' }, rejectionReason: { type: 'string' }, description: { type: 'string' },
   }, required: ['colorNames','backgroundIndex','styles','patterns','material','imageType','physicalWidthInches','description','usable'] };
-  const body = JSON.stringify({ model: VL_MODEL, prompt, images: [imageB64], stream: false, format: schema, options: { temperature: 0.1 } });
+  // keep_alive holds the 7B model resident on Mac1 between calls so only the FIRST
+  // request pays the cold-load (which over the Kamatera→Mac1 tailnet exceeded the old
+  // 120s ceiling and timed out). 300s timeout absorbs that first cold load.
+  const body = JSON.stringify({ model: VL_MODEL, prompt, images: [imageB64], stream: false, format: schema, keep_alive: '15m', options: { temperature: 0.1 } });
   return new Promise((resolve, reject) => {
     const u = new URL(OLLAMA_URL + '/api/generate');
     const req = http.request(
       { hostname: u.hostname, port: u.port || 11434, path: u.pathname, method: 'POST',
-        headers: { 'Content-Type': 'application/json', 'Content-Length': Buffer.byteLength(body) }, timeout: 120000 },
+        headers: { 'Content-Type': 'application/json', 'Content-Length': Buffer.byteLength(body) }, timeout: 300000 },
       res => { let raw = ''; res.on('data', c => raw += c); res.on('end', () => {
         try { resolve(JSON.parse(JSON.parse(raw).response)); } catch (e) { reject(new Error('VL parse: ' + e.message)); }
       }); });

← 204b3e2 fix: normalize image through Pillow→JPEG before VL (catalog  ·  back to Enrich Local Hybrid  ·  palette: make vl_max env-tunable via ENRICH_VL_MAX (default 029e667 →