From 0c3303a640c9918aecfc57682eb0e053827601cc Mon Sep 17 00:00:00 2001 From: jaakko Date: Tue, 14 Apr 2026 14:00:38 +0300 Subject: [PATCH] =?UTF-8?q?CodeBench:=20tyhjenn=C3=A4=20VRAM=20automaattis?= =?UTF-8?q?esti=20ennen=20testiajoa?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kipina-codebench/benchmark.mjs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/kipina-codebench/benchmark.mjs b/kipina-codebench/benchmark.mjs index 712a7c5..30132c1 100644 --- a/kipina-codebench/benchmark.mjs +++ b/kipina-codebench/benchmark.mjs @@ -482,6 +482,20 @@ async function main() { process.exit(1); } + // Tyhjennä VRAM — vapauta kaikki ladatut mallit + try { + const psResp = await fetch(`${OLLAMA_URL}/api/ps`); + const psData = await psResp.json(); + for (const m of (psData.models || [])) { + await fetch(`${OLLAMA_URL}/api/generate`, { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify({ model: m.name, keep_alive: 0 }), + }); + console.log(` ♻ Vapautettu: ${m.name}`); + } + } catch (e) { /* ei kriittinen */ } + if (FILTER_MODELS) { const filter = FILTER_MODELS.split(',').map(s => s.trim()); models = models.filter(m => filter.some(f => m.includes(f)));