From 3139d1ac6576392ce550dfbda94f0de6b48fca89 Mon Sep 17 00:00:00 2001 From: jaakko Date: Tue, 7 Apr 2026 07:29:09 +0300 Subject: [PATCH] =?UTF-8?q?kpn=20models:=20n=C3=A4ytt=C3=A4=C3=A4=20Ollama?= =?UTF-8?q?sta=20ladatut=20mallit=20+=20WASM-tilan?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Hakee Ollaman /api/tags-endpointista ladatut mallit kokoneen, parametreineen ja kvantisointitasoineen. WASM-tila näkyy myös. Co-Authored-By: Claude Opus 4.6 (1M context) --- network-poc/static/index.html | 36 ++++++++++++++++++++++++++++------- 1 file changed, 29 insertions(+), 7 deletions(-) diff --git a/network-poc/static/index.html b/network-poc/static/index.html index e6d2cf2..0050770 100644 --- a/network-poc/static/index.html +++ b/network-poc/static/index.html @@ -2493,14 +2493,36 @@ Files: ${Object.keys(generatedFiles).join(', ')}`; } if (sub === 'models') { - termLog(' Selain (kpn load):', '#c9d1d9'); - termLog(' qwen-coder:0.5b ~990 MB | WASM ~0.4 tok/s'); + termLog(' Selain (kpn load 1):', '#c9d1d9'); + const btn = document.getElementById('agent-compute-btn'); + const wasmLoaded = btn?.dataset.state === 'ready'; + termLog(` qwen-coder:0.5b ~990 MB | WASM ~0.4 tok/s${wasmLoaded ? ' ✓ ladattu' : ''}`); termLog(' Natiivi (Ollama + GPU):', '#c9d1d9'); - termLog(' qwen2.5-coder:7b ~4.7 GB | NVIDIA ~80 tok/s | AMD ~40 tok/s | Apple ~30 tok/s'); - termLog(' qwen2.5-coder:3b ~1.9 GB | NVIDIA ~120 tok/s'); - termLog(' qwen2.5-coder:1.5b ~1 GB | NVIDIA ~150 tok/s'); - termLog(' Vaihda malli: OLLAMA_MODEL=qwen2.5-coder:7b', '#8b949e'); - termLog(' Hub reitittää automaattisesti nopeimmalle solmulle', '#8b949e'); + // Haetaan Ollamasta ladatut mallit + fetch('/api/v1/hardware').then(r => r.json()).then(hw => { + if (hw.gpu_name && hw.gpu_name !== 'ei natiivisolmua') { + termLog(` GPU: ${hw.gpu_name} | VRAM: ${Math.round((hw.vram_mb||0)/1024)} GB`); + } + }).catch(() => {}); + fetch('http://' + window.location.hostname + ':11434/api/tags').then(r => r.json()).then(data => { + const models = data.models || []; + if (models.length === 0) { + termLog(' Ei ladattuja malleja — kpn load <numero>'); + } else { + for (const m of models) { + const sizeGB = (m.size / 1024 / 1024 / 1024).toFixed(1); + const params = m.details?.parameter_size || '?'; + const quant = m.details?.quantization_level || ''; + termLog(` ${m.name} ${sizeGB} GB | ${params} ${quant}`); + } + } + termLog(' Vaihda: kpn load <numero>', '#8b949e'); + }).catch(() => { + termLog(' qwen2.5-coder:7b ~4.7 GB'); + termLog(' qwen2.5-coder:3b ~1.9 GB'); + termLog(' qwen2.5-coder:1.5b ~1 GB'); + termLog(' Ollama ei saatavilla — näytetään oletuslista'); + }); return; }