Files
Mikei386 c0bc5d3a1b Integrate Basalt telemetry and shared GPU speech runtimes
Publish the reviewed accumulated runtime, scheduler, profile, UI, native recipes and historical maintenance evidence. Includes Qwen GPU ASR correction and shared Anna/atelier ownership. Validated with 784 local tests, Python/JSON parsing and eight JavaScript syntax checks. Live GPU acceptance and full fresh-host restore limits remain documented.
2026-11-03 21:16:41 +01:00

27 lines
6.4 KiB
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
const StrataUI=(()=>{
const esc=v=>String(v??'').replace(/[&<>"']/g,c=>({'&':'&amp;','<':'&lt;','>':'&gt;','"':'&quot;',"'":'&#39;'}[c]));
function render(){document.querySelector('#view').innerHTML='<h1>Strata</h1><p>Flash-Next als native Chat-Laufzeit hinter dem bestehenden Athena-Endpunkt. Zwei GPUs, Experten in RAM/SSD, MTP auf der zweiten GPU. Kein zusätzlicher öffentlicher API-Port.</p><section class="card" id="strata-state"></section><p id="strata-message" role="status"></p><a href="#chat" class="link">Chat-Profile öffnen →</a>';refresh();}
async function api(path='',body){const r=await fetch('/api/v1/strata-runtime'+path,body!==undefined?{method:'POST',headers:{'Content-Type':'application/json','X-Athena-Deck':'1'},body:JSON.stringify(body)}:{});const d=await r.json();if(!r.ok)throw Error(d.error);return d;}
async function refresh(){const root=document.querySelector('#strata-state');if(!root)return;try{
const [d,c]=await Promise.all([api(),fetch('/api/v1/catalog').then(r=>r.json())]);if(!root.isConnected)return;
root.innerHTML=`<h2>Strata ${esc(d.version)}</h2><p>${d.installed?'Installiert':'Einrichtung erforderlich'} · ${esc(d.revision?.slice(0,12))}</p><p>${esc(d.job?.phase||'Kein Einrichtungsauftrag aktiv.')}</p><p>CPU-Vision: ${d.vision?'bereit':'Encoder unter CPU-Vision vorbereiten installieren'}. Ein Slot bis 524288 (oberhalb 262144 mit YaRN ×2) oder zwei Slots mit je maximal 262144. Große Kontexte benötigen zusätzlichen RAM.</p><p>${Object.entries(d.models).map(([q,ready])=>`${esc(q)}: ${ready?'vorbereitet':'Paket fehlt'}`).join(' · ')}</p><button id="strata-install" ${d.installed||d.job?.state==='running'?'disabled':''}>Native Laufzeit installieren</button><button id="strata-vision" ${!d.installed||d.vision||d.job?.state==='running'?'disabled':''}>CPU-Vision vorbereiten</button><label>Modellpaket<select id="strata-model">${(c.entries||[]).filter(m=>m.file.includes('Flash-Next-GSQ-RCO')&&m.file.includes('-00001-of-')&&/IQ[23]_/.test(m.file)).map(m=>`<option value="${esc(m.id)}">${esc(m.file)}</option>`).join('')}</select></label><button id="strata-prepare" ${!d.installed||d.job?.state==='running'?'disabled':''}>Expertenpaket vorbereiten</button>${d.job?.state==='running'?'<button class="secondary" id="strata-cancel">Einrichtung abbrechen</button>':''}`;
for(const [id,path,body] of [['strata-install','/install',()=>({})],['strata-prepare','/prepare',()=>({model_id:document.querySelector('#strata-model').value})],['strata-vision','/vision',()=>({})],['strata-cancel','/cancel',()=>({})]])document.querySelector('#'+id)?.addEventListener('click',async event=>{event.target.disabled=true;try{await api(path,body());refresh();}catch(e){document.querySelector('#strata-message').textContent=e.message;event.target.disabled=false;}});
}catch(e){if(root.isConnected)root.textContent=e.message;}finally{setTimeout(()=>{if(root.isConnected)refresh();},4000);}}
return {render};
})();
const BasaltUI=(()=>{
const esc=v=>String(v??'').replace(/[&<>"']/g,c=>({'&':'&amp;','<':'&lt;','>':'&gt;','"':'&quot;',"'":'&#39;'}[c]));
function render(){document.querySelector('#view').innerHTML='<h1>Basalt</h1><p>Flash-Next: Text-Engine auf RTX 5080 mit RAM-Experten. Optionaler separater Vision-Encoder auf RTX 3060; passender BF16-Projektor und GPU im Chatprofil. Strata bleibt als eigene Laufzeit verfügbar. TTS wird nicht verändert.</p><section class="card" id="basalt-state"></section><p id="basalt-message" role="status"></p><a href="#chat" class="link">Chat-Profile öffnen →</a>';refresh();}
async function api(path='',body){const r=await fetch('/api/v1/basalt-runtime'+path,body===undefined?{}:{method:'POST',headers:{'Content-Type':'application/json','X-Athena-Deck':'1'},body:JSON.stringify(body)});const d=await r.json();if(!r.ok)throw Error(d.error||'Basalt-Anfrage fehlgeschlagen');return d;}
async function refresh(){const root=document.querySelector('#basalt-state');if(!root)return;try{
const [d,c]=await Promise.all([api(),fetch('/api/v1/catalog').then(r=>r.json())]);if(!root.isConnected)return;
const model=(c.entries||[]).find(m=>m.repo===d.model.repo&&m.revision===d.model.revision&&m.file===d.model.file&&m.sha256===d.model.sha256);
const downloading=(c.downloads||[]).some(j=>['queued','downloading'].includes(j.state)&&j.repo===d.model.repo&&j.file===d.model.file&&j.revision===d.model.revision);
root.innerHTML=`<h2>Basalt ${esc(d.version)}</h2><p>${d.installed?'Laufzeit installiert':'Einrichtung erforderlich'} · ${esc(d.revision.slice(0,12))}</p><p>${esc(d.job?.phase||'Kein Einrichtungsauftrag aktiv.')}</p><p>Ein oder zwei Slots, jeweils bis ${esc(d.context_per_slot)} Kontexttokens. Experten RAM-resident, int8-KV, automatischer GPU-Cache und MTP aus dem Modellpaket. Genau eine explizite SM120-GPU; kein zweiter öffentlicher API-Port.</p><button id="basalt-install" ${d.installed||d.job?.state==='running'?'disabled':''}>Native Laufzeit installieren</button>${d.job?.state==='running'?'<button class="secondary" id="basalt-cancel">Build abbrechen</button>':''}<h3>Geprüftes Modellpaket</h3><p>${esc(d.model.file)} · ${(d.model.size/1024**3).toFixed(2)} GiB · ${model?'in der Bibliothek':downloading?'Download vorgemerkt oder aktiv':'noch nicht vorhanden'}</p><p><a class="link" href="https://huggingface.co/${esc(d.model.repo)}/tree/${esc(d.model.revision)}" target="_blank" rel="noopener noreferrer">Originalquelle und Lizenz prüfen ↗</a> · feste Revision und vollständige SHA-256-Prüfung.</p><button id="basalt-model" ${model||downloading?'disabled':''}>Geprüftes Paket herunterladen</button>${model?'<button id="basalt-profile">Chat-Profil anlegen</button>':''}<p>Installation und Download starten kein Modell und ändern weder vorhandene Profile noch deren API-Freigaben. Fortschritt und Download-Abbruch stehen unter Downloads. Aktivierung erst über ein neues Basalt-Chatprofil; nicht parallel zu Strata auf derselben GPU.</p>`;
for(const [id,path] of [['basalt-install','/install'],['basalt-cancel','/cancel'],['basalt-model','/model']])root.querySelector('#'+id)?.addEventListener('click',async event=>{event.target.disabled=true;try{await api(path,{});await refresh();}catch(e){document.querySelector('#basalt-message').textContent=e.message;event.target.disabled=false;}});
root.querySelector('#basalt-profile')?.addEventListener('click',()=>Studio.openProfile('chat',model.id));
}catch(e){if(root.isConnected)root.textContent=e.message;}finally{setTimeout(()=>{if(root.isConnected)refresh();},4000);}}
return {render};
})();