Skip to content

Qwen3.8-Flash-Next on any consumer hardware: one-click install for Windows / Linux. Strata inference engine, OpenAI/Anthropic API on localhost, optional image input.

C++

owner feedback round: unified local-GGUF page and Manage models, no Tune model, Engine settings reduced with working Save logs, update buttons only when available, GPU data in Monitor with no model, thinking dots stop, Latest spacing, calmer native status reads, local GGUF adoption via --gguf-dir, no Contrast option or request-log button

Niko12218e2460d18c23
diff --git a/apps/desktop/scripts/ui-flows.mjs b/apps/desktop/scripts/ui-flows.mjs
index 0edb6534a..87235e511 100644
--- a/apps/desktop/scripts/ui-flows.mjs
+++ b/apps/desktop/scripts/ui-flows.mjs
@@ -30,7 +30,7 @@ const nodeExe = resolve(args.node ?? join(staged, 'node', process.platform === '
const work = mkdtempSync(join(tmpdir(), 'strata-ui-flows-'));
const shots = resolve(args.shots ?? join(work, 'shots'));
mkdirSync(shots, { recursive: true });
-const only = new Set(String(args.only ?? 'download,models,tune,fail,delete,theme,restart').split(','));
+const only = new Set(String(args.only ?? 'download,models,tune,fail,delete,theme,restart,perf,polish,stop,latest').split(','));
const isWin = process.platform === 'win32';
const { chromium } = await import(pathToFileURL(join(repoHost, 'node_modules/playwright-core/index.mjs')).href).catch(() => import('playwright-core'));
const CHROME = process.env.CHROME ?? ['C:/Program Files/Google/Chrome/Application/chrome.exe', '/usr/bin/google-chrome'].find(existsSync);
@@ -130,7 +130,7 @@ async function scenario(name, { installed = false, env = {} } = {}, body) {
const dir = join(work, name);
const dirs = { home: join(dir, 'home'), appdata: join(dir, 'appdata'), local: join(dir, 'local'), components: join(dir, 'local', 'Strata', 'components'), install: join(dir, 'local', 'Strata', 'install'), state: join(dir, 'fake-state'), profiles: join(dir, 'profiles'), runtime: join(dir, 'runtime') };
for (const d of [dirs.home, dirs.appdata, dirs.local, dirs.components, dirs.install, dirs.state, join(dir, 'models')]) mkdirSync(d, { recursive: true });
- const baseEnv = { ...process.env, STRATA_COMPONENTS_DIR: dirs.components, STRATA_PROFILE_DIR: dirs.profiles, STRATA_RUNTIME_DIR: dirs.runtime, STRATA_HOME: dirs.home, STRATA_MODELS_DIR: join(dir, 'models'), APPDATA: dirs.appdata, LOCALAPPDATA: dirs.local, XDG_CONFIG_HOME: join(dir, 'xdg'), XDG_DATA_HOME: join(dir, 'xdgdata'), PYTHONDONTWRITEBYTECODE: '1', STRATA_ENGINE_BACKEND: 'cuda', FAKE_STATE: dirs.state, ...env };
+ const baseEnv = { ...process.env, STRATA_COMPONENTS_DIR: dirs.components, STRATA_PROFILE_DIR: dirs.profiles, STRATA_RUNTIME_DIR: dirs.runtime, STRATA_HOME: dirs.home, STRATA_MODELS_DIR: join(dir, 'models'), APPDATA: dirs.appdata, LOCALAPPDATA: dirs.local, USERPROFILE: dirs.home, XDG_CONFIG_HOME: join(dir, 'xdg'), XDG_DATA_HOME: join(dir, 'xdgdata'), PYTHONDONTWRITEBYTECODE: '1', STRATA_ENGINE_BACKEND: 'cuda', FAKE_STATE: dirs.state, ...env };
delete baseEnv.STRATA_API_KEY; delete baseEnv.STRATA_INSTALL_DIR;
if (installed) {
const platform = isWin ? 'windows-x86_64' : 'linux-x86_64';
@@ -168,7 +168,7 @@ async function scenario(name, { installed = false, env = {} } = {}, body) {
}
}
const newPage = async (browser, base, options = {}) => {
- const context = await browser.newContext({ viewport: { width: 1400, height: 950 }, ...options });
+ const context = await browser.newContext({ viewport: { width: 1400, height: 950 }, ...(process.env.SCHEME ? { colorScheme: process.env.SCHEME } : {}), ...options });
const page = await context.newPage();
const problems = [];
page.on('pageerror', e => problems.push(e.message));
@@ -374,6 +374,130 @@ await scenario('delete', { installed: true }, async ({ base, api, browser, dirs,
await shot(page, '2-after-delete');
});
+// ------------------------------------------------------------------------------------------------ perf
+await scenario('perf', { installed: true }, async ({ base, api, browser, shot }) => {
+ const page = await newPage(browser, base);
+ await clickText(page, /Go straight to the app/i);
+ await page.waitForURL(/#\/models/, { timeout: 15000 }).catch(() => {});
+ await page.getByRole('button', { name: /^Load model$/ }).first().click();
+ let ready = false;
+ for (let i = 0; i < 90 && !ready; i++) { ready = (await api('/api/native')).body.instances.some(x => x.status === 'ready'); await delay(1000); }
+ check(ready, 'a model is loaded');
+ await delay(2500);
+ const requests = [];
+ const started = new Map();
+ page.on('request', r => started.set(r, Date.now()));
+ page.on('requestfinished', r => requests.push([r.url().replace(base, '').slice(0, 60), Date.now() - (started.get(r) ?? Date.now())]));
+ await page.evaluate(() => { window.__long = []; new PerformanceObserver(l => { for (const e of l.getEntries()) window.__long.push(Math.round(e.duration)); }).observe({ entryTypes: ['longtask'] }); });
+ const t0 = Date.now();
+ await page.evaluate(() => { location.hash = '#/chat'; });
+ await page.getByRole('textbox', { name: /Message Strata/i }).waitFor({ timeout: 30000 });
+ const open = Date.now() - t0;
+ await delay(1500);
+ const long = await page.evaluate(() => window.__long);
+ console.log('info chat opened in', open, 'ms; long tasks', JSON.stringify(long), 'requests', JSON.stringify(requests.filter(r => r[1] > 100)), 'all', requests.length);
+ check(open < 1500 && Math.max(0, ...long) < 300, 'Models to Chat opens at once, with no long block', open + ' ms, longest task ' + Math.max(0, ...long) + ' ms');
+});
+
+// ------------------------------------------------------------------------------------------------ polish
+await scenario('polish', { installed: true }, async ({ base, api, browser, dirs, shot }) => {
+ const page = await newPage(browser, base);
+ await clickText(page, /Go straight to the app/i);
+ await page.waitForURL(/#\/models/, { timeout: 15000 }).catch(() => {});
+ await page.getByText(/Conversation context/i).first().waitFor({ timeout: 30000 });
+ check(await page.getByRole('button', { name: /Tune model/i }).count() === 0, 'the Models tab has no "Tune model" button');
+ await clickText(page, /Manage models/i);
+ await delay(500);
+ const rows = await page.locator('.native-manage-row').count();
+ check(rows === 1, 'Manage models lists only the downloaded model, not the catalog', rows + ' row(s)');
+ await shot(page, '1-manage-models');
+ await page.getByRole('button', { name: /^Done$/ }).click();
+ await page.getByRole('button', { name: /Other local models/i }).click().catch(async () => { await clickText(page, /Manage models/i); await clickText(page, /Use a local GGUF/i); });
+ await page.getByText(/Folder with the GGUF files/i).first().waitFor({ timeout: 15000 }).catch(() => {});
+ await shot(page, '2-local-gguf');
+ check(await page.getByText(/Folder with the GGUF files/i).count() > 0, 'the local GGUF page opens in the same design as Models');
+ await page.getByPlaceholder(/Full path to the folder/i).fill(join(dirs.install, 'does-not-exist'));
+ await page.getByRole('button', { name: /^Check files$/ }).click();
+ await delay(3000);
+ check(await page.locator('.error-notice').count() > 0, 'a folder that cannot be used says so in words');
+ await shot(page, '2b-local-gguf-problem');
+ await page.evaluate(() => { location.hash = '#/chat?settings=1'; });
+ await delay(1500);
+ const text = await page.locator('body').innerText();
+ check(!/Contrast/.test(text), 'Settings has no Contrast option');
+ check(!/View request log/.test(text), 'and no "View request log" button');
+ await page.getByText(/^Engine$/).first().click().catch(() => {});
+ await delay(1500);
+ await shot(page, '3-settings-engine');
+ const engine = await page.locator('body').innerText();
+ check(/Update component/.test(engine) && /Diagnostics/.test(engine), 'Settings > Engine has Update component and Diagnostics');
+ check(!/Performance|Model settings|Calibrate|Engine installation/.test(engine), 'and nothing else');
+ await page.getByRole('button', { name: /^Save logs$/ }).click();
+ await page.getByText(/Saved to/).first().waitFor({ timeout: 15000 }).catch(() => {});
+ const savedText = await page.getByText(/Saved to/).first().innerText().catch(() => '');
+ const savedPath = savedText.replace(/^Saved to\s*/, '').trim();
+ check(!!savedPath && existsSync(savedPath), 'Save logs writes a file to Downloads and says where', savedPath);
+ await shot(page, '4-logs-saved');
+ await page.evaluate(() => { location.hash = '#/monitor'; });
+ await delay(6000);
+ await shot(page, '5-monitor');
+ const mon = await page.locator('body').innerText();
+ check(/°C/.test(mon), 'the Monitor shows GPU data with no model loaded', (mon.match(/.{0,30}°C.{0,20}/)?.[0] ?? 'no temperature text').replace(/\s+/g, ' '));
+});
+
+// ------------------------------------------------------------------------------------------------ stop
+await scenario('stop', { installed: true, env: { FAKE_TOKEN_DELAY: '0.1', FAKE_REPLY: 'thinking '.repeat(30) } }, async ({ base, api, browser, shot }) => {
+ const page = await newPage(browser, base);
+ await clickText(page, /Go straight to the app/i);
+ await page.waitForURL(/#\/models/, { timeout: 15000 }).catch(() => {});
+ await page.getByRole('button', { name: /^Load model$/ }).first().click();
+ let ready = false;
+ for (let i = 0; i < 90 && !ready; i++) { ready = (await api('/api/native')).body.instances.some(x => x.status === 'ready'); await delay(1000); }
+ if (!ready) { const st = (await api('/api/native')).body; console.log('info jobs', JSON.stringify(st.jobs.map(j => [j.kind, j.state, j.error ?? j.summary])), JSON.stringify(st.instances.map(i => [i.status, i.error]))); await shot(page, '0-stop-notloaded'); }
+ check(ready, 'a model is loaded');
+ await page.evaluate(() => { location.hash = '#/chat'; });
+ const box = page.getByRole('textbox', { name: /Message Strata/i });
+ await box.waitFor({ timeout: 30000 });
+ await box.fill('hello');
+ await page.keyboard.press('Enter');
+ await page.locator('.typing').first().waitFor({ timeout: 30000 });
+ await delay(1500);
+ await page.getByRole('button', { name: /^Stop/i }).first().click().catch(async () => { await page.keyboard.press('Escape'); });
+ await delay(4000);
+ const dots = await page.locator('.typing').count();
+ await shot(page, '1-after-stop');
+ check(dots === 0, 'after Stop in the middle of thinking the three dots are gone', dots + ' left');
+});
+
+// ------------------------------------------------------------------------------------------------ latest
+await scenario('latest', {}, async ({ base, browser, shot }) => {
+ const page = await newPage(browser, base);
+ const now = Date.now();
+ await page.evaluate(now => {
+ const messages = [];
+ for (let i = 0; i < 40; i++) { messages.push({ id: 'u' + i, role: 'user', content: 'question ' + i, at: now }, { id: 'a' + i, role: 'assistant', content: 'answer number ' + i + ' with some text to fill the line and more of it.', at: now, tokens: 20, inputTokens: 5 }); }
+ localStorage.setItem('strata.sessions.v1', JSON.stringify([{ id: 's_latest', title: 'long', updatedAt: now, createdAt: now, messages }]));
+ localStorage.setItem('strata.active-session.v1', 's_latest');
+ }, now);
+ await page.reload({ waitUntil: 'domcontentloaded' });
+ await delay(1500);
+ if (await page.getByRole('button', { name: /Go straight to the app/i }).count()) { await clickText(page, /Go straight to the app/i); await delay(1500); }
+ await page.goto(base + '/#/chat', { waitUntil: 'domcontentloaded' });
+ await page.getByRole('textbox', { name: /Message Strata/i }).waitFor({ timeout: 30000 });
+ await delay(800);
+ await page.locator('.main__body.chat').first().waitFor({ timeout: 15000 }).catch(async () => { await shot(page, '0-latest-missing'); console.log('info body', JSON.stringify((await page.locator('body').innerText()).slice(0, 300))); });
+ await page.locator('.main__body.chat').first().evaluate(el => { el.scrollTop = 3000; });
+ await delay(600);
+ await page.mouse.wheel(0, -400);
+ await delay(600);
+ await page.locator('.main__body.chat').first().evaluate(el => { el.scrollTop = 0; });
+ await delay(800);
+ const gaps = await page.evaluate(() => { const b = document.querySelector('.jumplatest'), c = document.querySelector('.main__body.chat'); if (!b || !c) return null; const r = b.getBoundingClientRect(), cr = c.getBoundingClientRect(); return { top: Math.round(r.top - cr.top), bottom: Math.round(cr.bottom - r.bottom) }; });
+ console.log('info chat dom', JSON.stringify(await page.evaluate(() => { const c = document.querySelector('.main__body.chat'); return { msgs: document.querySelectorAll('.st-msg').length, scrollH: c?.scrollHeight, clientH: c?.clientHeight, top: c?.scrollTop, jump: document.querySelectorAll('.jumplatest').length }; })));
+ await shot(page, '1-latest-button');
+ check(!!gaps && gaps.top >= 12 && gaps.bottom >= 12, 'the Latest button keeps a gap from the top navigation and from the bottom', JSON.stringify(gaps));
+});
+
// ------------------------------------------------------------------------------------------------ fail
await scenario('fail', { installed: true, env: { FAKE_ENGINE_FAIL: '1' } }, async ({ base, api, browser, shot }) => {
const page = await newPage(browser, base);
diff --git a/apps/host/server/control-runtime.mjs b/apps/host/server/control-runtime.mjs
index d163f9283..e07da9af4 100644
--- a/apps/host/server/control-runtime.mjs
+++ b/apps/host/server/control-runtime.mjs
@@ -123,6 +123,12 @@ export function createControl({ control = findControl(), env = process.env, run
if (result.code !== 0 || !result.json) throw failure(result, 'The installed models could not be read.');
return result.json;
},
+ /** What a local GGUF folder or file holds, without touching it: the model it is, and why it cannot be used when it cannot. */
+ async importPlan(path) {
+ const result = await call(['models', 'import', path, '--plan', '--output', 'json'], { timeoutMs: 120_000 });
+ if (result.json && result.code === 0) return result.json.plan ?? result.json;
+ throw failure(result, 'The files could not be checked.');
+ },
async saveProfile(name, configPath) {
const listed = await call(['profile', 'list', '--output', 'json'], { timeoutMs: 20_000 });
const known = (listed.json?.profiles ?? []).some(p => p.id === name);
diff --git a/apps/host/server/index.mjs b/apps/host/server/index.mjs
index 3756bc7f3..a84b0f409 100644
--- a/apps/host/server/index.mjs
+++ b/apps/host/server/index.mjs
@@ -22,11 +22,12 @@ import { createAgentBridge } from './agent/agent-bridge.mjs';
* live metrics and the local inference API. No runtime dependencies.
*/
import http from 'node:http';
+import { homedir } from 'node:os';
import { cpSync, createReadStream, existsSync, mkdirSync, readFileSync, readdirSync, statSync, writeFileSync } from 'node:fs';
import { spawn } from 'node:child_process';
import { execFile } from 'node:child_process';
import { promisify } from 'node:util';
-import { basename, extname, isAbsolute, join, normalize, resolve } from 'node:path';
+import { basename, dirname, extname, isAbsolute, join, normalize, resolve } from 'node:path';
import { fileURLToPath } from 'node:url';
import * as hardware from './hardware.mjs';
@@ -772,6 +773,24 @@ async function api(req, res, path, method, url) {
if(path==='/api/native/plan'&&method==='POST')return json(res,200,await native.plan(await readBody(req)));
if(path==='/api/native/operations'&&method==='POST'){if(storageChanging)return error(res,409,'Wait for the model folder check to finish.');const body=await readBody(req);return json(res,202,native.operation(body.kind,body.args));}
if(path==='/api/native/logs'&&method==='GET')return json(res,200,{logs:native.logs()});
+ if(path==='/api/native/logs/save'&&method==='POST'){
+ /* Diagnostics to a file: the engine messages the app kept, failed operations, and the tail of each model's server log under Control.
+ Written to the user's Downloads folder (the window cannot save a download); the path is returned to show. */
+ const NL=String.fromCharCode(10);
+ const lines=[`Strata diagnostics ${new Date().toISOString()}`,`Version ${native.state().version??'unknown'}`,'','== Engine messages =='];
+ for(const l of native.logs())lines.push(`${l.at} ${l.instanceId}: ${l.line}`);
+ lines.push('','== Operations ==');for(const j of native.state().jobs)lines.push(`${j.startedAt} ${j.kind} ${j.state}${j.error?`: ${j.error}`:''}${j.details?`${NL} ${j.details}`:''}`);
+ try{const runtime=process.env.STRATA_RUNTIME_DIR??join(dirname(componentsDirectory()),'runtime');for(const name of readdirSync(runtime).filter(n=>n.endsWith('.server.log'))){lines.push('',`== ${name} (last lines) ==`,...readFileSync(join(runtime,name),'utf8').split(NL).slice(-200));}}catch{/* no server logs yet */}
+ const folder=join(process.env.USERPROFILE??process.env.HOME??homedir(),'Downloads');mkdirSync(folder,{recursive:true});
+ const file=join(folder,`strata-diagnostics-${new Date().toISOString().replace(/[:.]/g,'-').slice(0,19)}.txt`);writeFileSync(file,lines.join(NL),'utf8');
+ return json(res,200,{path:file});}
+ if(path==='/api/native/local/preview'&&method==='POST'){
+ /* "Use a local GGUF": pick (or type) the folder, and Control says what is in it. Nothing is copied or changed. */
+ const typed=await typedFolder((await readBody(req)).path,{isAbsolute});
+ const picked=typed?{path:typed}:await chooseFolder('Choose the folder that holds your GGUF files');
+ if(picked.unavailable)return error(res,501,`${TYPE_A_PATH} ${picked.reason}`);
+ if(picked.cancelled)return json(res,200,{cancelled:true});
+ return json(res,200,{path:picked.path,preview:await native.localPreview(picked.path)});}
if(path==='/api/native/benchmark'&&method==='GET')return json(res,200,native.benchmarkReport());
const nativeOperation=/^\/api\/native\/operations\/([a-z0-9-]+)\/cancel$/.exec(path);
if(nativeOperation&&method==='POST')return json(res,200,await native.cancel(nativeOperation[1]));
diff --git a/apps/host/server/native-control.mjs b/apps/host/server/native-control.mjs
index 02e0bf1f7..1a4afeb87 100644
--- a/apps/host/server/native-control.mjs
+++ b/apps/host/server/native-control.mjs
@@ -39,7 +39,8 @@ export function createNativeControl({directory,requests=()=>[],changed=()=>{},sp
const emit=()=>{const value=state();writeFileSync(join(directory,'native-jobs.json'),JSON.stringify(value.jobs),{mode:0o600});changed(value);};
const append=(instanceId,line)=>{logs.push({at:new Date().toISOString(),instanceId,line:String(line).slice(0,2000)});if(logs.length>400)logs.shift();};
function state(){return {...snapshot,downloadDirectory:preferences.downloadDirectory??(modelsDirectory?modelsDirectory():snapshot.installed?.data_folder),fields:nativeFields(),instances:[...instances.values()].map(({key,configPath,fingerprint,...i})=>structuredClone(i)),defaultId,jobs:[...jobs.values()].slice(-12).map(({process,abort,...j})=>j),capabilities:{responses:sourceText().includes('/v1/responses'),updates:!!snapshot.available,rollback:previousEngine(),calibration:packaged?false:snapshot.hardware?.gpus?.some(g=>/nvidia/i.test(g.name??''))??false}};}
- function sourceText(){try{return readFileSync(join(packaged?control.control.dir:preferences.repo,'serve/server.py'),'utf8');}catch{return '';}}
+ let sourceCache={path:'',time:0,text:''};
+ function sourceText(){try{const path=join(packaged?control.control.dir:preferences.repo,'serve/server.py'),time=statSync(path).mtimeMs;if(sourceCache.path===path&&sourceCache.time===time)return sourceCache.text;sourceCache={path,time,text:readFileSync(path,'utf8')};return sourceCache.text;}catch{return '';}}
function nativeFields(){const source=sourceText();return NATIVE_FIELDS.map(field=>({...field,supported:field.id.startsWith('vision_')||field.id.startsWith('mcp_')||field.id==='vram_reserve_mib'||source.includes(field.id)}));}
const modelArena=id=>({arenaGb:(snapshot.catalog?.families??[]).flatMap(f=>f.sizes??[]).find(s=>s.id===id)?.experts_gb});
/* A start that ends with `server_exited` carries the engine's last log line with it; the app turns the code into words and
@@ -99,8 +100,10 @@ export function createNativeControl({directory,requests=()=>[],changed=()=>{},sp
async function mcpCall(name,args={}){await connect();if(!definitions.some(d=>d.name===name))throw new Error(`This Strata installation does not support ${name}. Update the installation first.`);const result=await send('tools/call',{name,arguments:args},120000);let value=result.structuredContent;if(!value){const text=result.content?.find(c=>c.type==='text')?.text;try{value=JSON.parse(text);}catch{value={summary:text};}}if(result.isError)throw new Error(value?.error??value?.summary??'Native operation failed.');return value;}
async function refresh(force=false){
if(closing)return state();
- if(refreshing)return refreshing;if(!force&&Date.now()-lastRead<15000)return state();
- refreshing=(async()=>{try{const [catalog,status]=packaged?await (async()=>{const s=await tool('strata_status',{hardware:true});const c=await tool('strata_models').catch(error=>({families:[],contexts:[],recommendation:{family:null,model:null},context_note:'',error:error.message}));return [c,s];})():await Promise.all([tool('strata_models'),tool('strata_status',{hardware:true})]);const noImages=c=>c&&Array.isArray(c.families)?{...c,families:c.families.map(f=>({...f,images:false,sizes:(f.sizes??[]).map(s=>({...s,images:false}))}))}:c;snapshot={available:true,repo:packaged?status.installDir:repo(),version:packaged?(control.version??null):await execute('git',['describe','--tags','--always'],repo()).then(s=>s.trim()).catch(()=>null),summary:status.summary,catalog:packaged?noImages(catalog):catalog,installed:installedInfo(status.installed),hardware:status.hardware,error:null,install:status.install,external:status.running??null,...(packaged?{packaged:true,installDir:status.installDir,engine:status.engine,installerError:status.installerError}:{})};lastRead=Date.now();if(status.install?.running&&![...jobs.values()].some(j=>j.state==='running'))begin('install',j=>watchInstall(j,status.install));}catch(error){snapshot={...snapshot,available:false,error:error.message};lastRead=Date.now();}emit();return state();})().finally(()=>{refreshing=null;});return refreshing;
+ /* A read that is not forced never makes the window wait for the (slow) status of Control: it gets the last state at once, and a stale one
+ is refreshed in the background. Only the first read, and a forced one after an operation, waits. */
+ if(refreshing)return !force&&snapshot.available?state():refreshing;if(!force&&Date.now()-lastRead<45000)return state();
+ refreshing=(async()=>{try{const [catalog,status]=packaged?await (async()=>{const s=await tool('strata_status',{hardware:true});const c=await tool('strata_models').catch(error=>({families:[],contexts:[],recommendation:{family:null,model:null},context_note:'',error:error.message}));return [c,s];})():await Promise.all([tool('strata_models'),tool('strata_status',{hardware:true})]);const noImages=c=>c&&Array.isArray(c.families)?{...c,families:c.families.map(f=>({...f,images:false,sizes:(f.sizes??[]).map(s=>({...s,images:false}))}))}:c;snapshot={available:true,repo:packaged?status.installDir:repo(),version:packaged?(control.version??null):await execute('git',['describe','--tags','--always'],repo()).then(s=>s.trim()).catch(()=>null),summary:status.summary,catalog:packaged?noImages(catalog):catalog,installed:installedInfo(status.installed),hardware:status.hardware,error:null,install:status.install,external:status.running??null,...(packaged?{packaged:true,installDir:status.installDir,engine:status.engine,installerError:status.installerError}:{})};lastRead=Date.now();if(status.install?.running&&![...jobs.values()].some(j=>j.state==='running'))begin('install',j=>watchInstall(j,status.install));}catch(error){snapshot={...snapshot,available:false,error:error.message};lastRead=Date.now();}emit();return state();})().finally(()=>{refreshing=null;});const run=refreshing;if(!force&&snapshot.available){run.catch(()=>{});return state();}return run;
}
function configure({repository}){if(packaged){if(instances.size||[...jobs.values()].some(j=>j.state==='running'))throw new Error('Unload models and finish operations before changing the installation.');const next=realpathSync(String(repository));if(!statSync(next).isDirectory())throw new Error('Choose the folder that holds your Strata model configurations.');preferences={...preferences,installDir:next};packagedInstall=null;disconnect();writeFileSync(settingsPath,JSON.stringify(preferences,null,2),{mode:0o600});lastRead=0;return refresh(true);}if(instances.size||[...jobs.values()].some(j=>j.state==='running'))throw new Error('Unload models and finish operations before changing the installation.');const next=realpathSync(String(repository));const old=preferences;preferences={...preferences,repo:next};try{repo();}catch(e){preferences=old;throw e;}disconnect();writeFileSync(settingsPath,JSON.stringify(preferences,null,2),{mode:0o600});lastRead=0;return refresh(true);}
function setDownloadDirectory(input){if([...jobs.values()].some(j=>j.state==='running'))throw new Error('Finish the current operation before changing the folder.');if(typeof input!=='string'||!input.trim()||/[\r\n\0]/.test(input))throw new Error('Choose a model folder.');const path=realpathSync(input.trim());if(!statSync(path).isDirectory())throw new Error('Choose a folder, not a file.');accessSync(path,constants.R_OK|constants.W_OK);preferences={...preferences,downloadDirectory:path};writeFileSync(settingsPath,JSON.stringify(preferences,null,2),{mode:0o600});emit();return state();}
@@ -109,7 +112,7 @@ export function createNativeControl({directory,requests=()=>[],changed=()=>{},sp
function save(model,{values,mcp}){if([...jobs.values()].some(j=>j.state==='running'))throw new Error('Finish the current operation before saving native settings.');const {path,config}=record(model);if(busy(requests().filter(r=>instances.get(r.instanceId)?.model===model)))throw new Error('Finish this model’s requests before saving its settings.');const patch=validateNativeSettings(values??{}),next={...config};for(const field of nativeFields())if(field.supported===false&&patch[field.id]!=null&&JSON.stringify(patch[field.id])!==JSON.stringify(config[field.id]))throw new Error(`${field.label} needs a newer native Strata installation. Update it in Settings → About.`);for(const [key,value] of Object.entries(patch)){if(key==='env')next.env=restoreNativeEnv(value,config.env??{});else if(value===null)delete next[key];else next[key]=value;}if(mcp!==undefined){next.mcp_servers=validateMcpServers(mcp,config.mcp_servers??config.mcpServers??{});delete next.mcpServers;}copyFileSync(path,path+'.bak');chmodSync(path+'.bak',0o600);const temp=path+'.ui-tmp';writeFileSync(temp,JSON.stringify(next,null,2)+'\n',{mode:0o600});renameSync(temp,path);return settings(model);}
function previousEngine(){try{const data=snapshot.installed?.data_dir??snapshot.installed?.data_folder;return [join(preferences.repo,'engine/.previous'),data&&join(data,'engine/.previous')].filter(Boolean).some(existsSync)&&readFileSync(join(preferences.repo,'setup.py'),'utf8').includes('--rollback-engine');}catch{return false;}}
async function plan(args){await refresh();if(!snapshot.available)throw new Error(snapshot.error);return tool('strata_install',installArgs(args,false));}
- function installArgs(args,confirm){const allowed=['family','model','context','vision','kv','gpu','gpus','backend','low_ram','port'];const size=snapshot.catalog?.families?.find(f=>f.family===args.family)?.sizes.find(s=>s.model===args.model);const existing=snapshot.installed?.models?.find(m=>m.model===size?.id);const data=nativeDataDirectory(args.data_dir??existing?.dataFolder??preferences.downloadDirectory??modelsDirectory?.());return {...(data?{data_dir:data}:{}),...Object.fromEntries(allowed.filter(k=>args[k]!==undefined).map(k=>[k,args[k]])),...(packaged?{vision:'no'}:{}),confirm};}
+ function installArgs(args,confirm){const allowed=['family','model','context','vision','kv','gpu','gpus','backend','low_ram','port','gguf_dir'];const size=snapshot.catalog?.families?.find(f=>f.family===args.family)?.sizes.find(s=>s.model===args.model);const existing=snapshot.installed?.models?.find(m=>m.model===size?.id);const data=nativeDataDirectory(args.data_dir??existing?.dataFolder??preferences.downloadDirectory??modelsDirectory?.());return {...(data?{data_dir:data}:{}),...Object.fromEntries(allowed.filter(k=>args[k]!==undefined).map(k=>[k,args[k]])),...(packaged?{vision:'no'}:{}),confirm};}
function begin(kind,run,metadata={}){if([...jobs.values()].some(j=>j.state==='running'))throw new Error('Finish or cancel the current engine operation first.');const job={id:randomUUID(),kind,state:'running',startedAt:new Date().toISOString(),summary:'Starting…',result:null,error:null,...metadata};for(const [id,old] of jobs)if(jobs.size>=12&&old.state!=='running')jobs.delete(id);jobs.set(job.id,job);emit();void run(job).then(result=>{if(job.state==='running'){Object.assign(job,{state:'done',summary:result?.summary??'Complete',result,finishedAt:new Date().toISOString()});}}).catch(error=>{if(job.state==='running')Object.assign(job,{state:'error',error:error.message,summary:error.message,finishedAt:new Date().toISOString()});}).finally(()=>{if(job.kind.startsWith('update')||job.kind==='rollback')disconnect();lastRead=0;emit();void refresh(true);});return state().jobs.find(j=>j.id===job.id);}
async function watchInstall(job,current){job.summary=current.step??'Resuming preparation status…';job.result={install:current};while(job.state==='running'){await new Promise(r=>setTimeout(r,1500));const result=await tool('strata_install');job.summary=result.summary;job.result=result;emit();if(!result.install?.running){if(result.install?.exit_code!==0)throw new Error(result.install?.error??'Preparation did not finish. Retry to reuse completed files.');return {summary:'Model preparation complete. Load it from Models.'};}}}
@@ -176,7 +179,10 @@ export function createNativeControl({directory,requests=()=>[],changed=()=>{},sp
if(instance.profile)await control.stop(instance.profile).catch(()=>{});else await stopProcess(proc);instance.status='error';instance.error='Loading took more than five minutes. Check the engine log and free memory.';throw new Error(instance.error);
}
async function freePort(requested){for(let port=Number(requested??18500);port<=Number(requested??18500)+20;port++){if(!Number.isInteger(port)||port<1024||port>65535)throw new Error('Choose a port from 1024 to 65535.');if([...instances.values()].some(i=>i.port===port)){if(requested)throw new Error('This private engine port is already in use.');continue;}const available=await new Promise(resolve=>{const probe=createServer();probe.once('error',()=>resolve(false));probe.listen(port,'127.0.0.1',()=>probe.close(()=>resolve(true)));});if(available)return port;if(requested)throw new Error('This private engine port is already in use.');}throw new Error('No free private engine port was found.');}
- async function poll(){if(polling||closing)return;polling=true;try{await Promise.all([...instances.values()].map(async instance=>{if(instance.status!=='ready')return;try{const response=await fetcher(`http://127.0.0.1:${instance.port}/metrics?requests=all`,{headers:{authorization:`Bearer ${instance.key}`},signal:AbortSignal.timeout(1500)});if(!response.ok)throw new Error('Metrics unavailable');instance.metrics=await response.json();const tools=await fetcher(`http://127.0.0.1:${instance.port}/mcp`,{headers:{authorization:`Bearer ${instance.key}`},signal:AbortSignal.timeout(1500)});if(tools.ok)instance.metrics.mcp=await tools.json();instance.phase=instance.metrics.live?.state??'idle';}catch{instance.metrics=null;instance.phase='unavailable';}}));emit();}finally{polling=false;}}
+ let pollCount=0;
+ /* The engine's metrics carry every finished request with `?requests=all`: a long session makes that a large JSON that the host parses and
+ pushes to the window every 2 s. The last dozen is what the app shows live; the full list is refreshed every tenth poll. */
+ async function poll(){if(polling||closing)return;polling=true;const full=pollCount++%10===0;try{await Promise.all([...instances.values()].map(async instance=>{if(instance.status!=='ready')return;try{const response=await fetcher(`http://127.0.0.1:${instance.port}/metrics${full?'?requests=all':''}`,{headers:{authorization:`Bearer ${instance.key}`},signal:AbortSignal.timeout(1500)});if(!response.ok)throw new Error('Metrics unavailable');const fresh=await response.json();const older=instance.metrics?.requests,recent=fresh.requests;instance.metrics=full||!Array.isArray(older)||!Array.isArray(recent)||!recent.length?fresh:{...fresh,requests:[...recent,...older.filter(r=>Number(r.time)<Math.min(...recent.map(x=>Number(x.time))))]};const tools=await fetcher(`http://127.0.0.1:${instance.port}/mcp`,{headers:{authorization:`Bearer ${instance.key}`},signal:AbortSignal.timeout(1500)});if(tools.ok)instance.metrics.mcp=await tools.json();instance.phase=instance.metrics.live?.state??'idle';}catch{instance.metrics=null;instance.phase='unavailable';}}));emit();}finally{polling=false;}}
function ensurePoll(){if(!timer){timer=setInterval(()=>void poll(),2000);timer.unref?.();}void poll();}
async function benchmark(job,args){const instance=resolveInstance(args.instanceId);job.instanceId=instance.id;if(busy(requests().filter(r=>r.instanceId===instance.id)))throw new Error('Wait for this model to finish before benchmarking.');const started=Date.now();job.abort=new AbortController();const response=await fetcher(`http://127.0.0.1:${instance.port}/v1/chat/completions`,{method:'POST',headers:{'content-type':'application/json',authorization:`Bearer ${instance.key}`},signal:AbortSignal.any([job.abort.signal,AbortSignal.timeout(180000)]),body:JSON.stringify({model:instance.apiModelId,messages:[{role:'user',content:'Explain how a rainbow forms in clear, simple language.'}],temperature:0,reasoning_effort:'none',max_tokens:200,stream:false})});const body=await response.json();if(!response.ok)throw new Error(body.error?.message??'Benchmark failed.');if(job.state!=='running')return;const result={summary:'Measured benchmark complete.',at:new Date().toISOString(),model:instance.apiModelId,durationMs:Date.now()-started,tokensIn:body.usage?.prompt_tokens??null,tokensOut:body.usage?.completion_tokens??null,outputTps:body.timings?.predicted_per_second??null,promptTps:body.timings?.prompt_per_second??null,source:'engine',settings:'Greedy · thinking off · up to 200 output tokens'};writeFileSync(join(directory,'native-benchmark.json'),JSON.stringify(result,null,2),{mode:0o600});return result;}
function resolveInstance(id){const aliases=[...instances.values()].filter(i=>i.aliases?.includes(id));if(aliases.length>1&&!instances.has(id)&&![...instances.values()].some(i=>i.apiModelId===id))throw new Error('This alias matches more than one instance. Choose its exact model ID.');const i=instances.get(id)??[...instances.values()].find(i=>i.apiModelId===id)??aliases[0]??(!id&&instances.size===1?[...instances.values()][0]:undefined);if(!i)throw new Error('Choose a loaded model ID.');if(i.status!=='ready')throw new Error('This model is not ready.');return i;}
@@ -216,5 +222,6 @@ export function createNativeControl({directory,requests=()=>[],changed=()=>{},sp
async function close(){closing=true;clearInterval(timer);const installing=packaged&&child&&[...jobs.values()].some(j=>j.kind==='install'&&j.state==='running');if(installing)await send('tools/call',{name:'strata_install',arguments:{cancel:true}},15000).catch(()=>{});const operations=[];for(const job of jobs.values()){job.abort?.abort();if(job.process)operations.push(stopProcess(job.process));if(job.state==='running')job.state='cancelled';}await Promise.all(operations);await Promise.all([...instances.keys()].map(id=>unload(id,true).catch(()=>{})));disconnect();}
// Remove nonserializable process references from public jobs.
const publicState=()=>{const value=state();value.jobs=value.jobs.map(({process,...job})=>job);return value;};
- return {state:publicState,refresh,configure,setDownloadDirectory,plan,settings,save,operation,cancel,unload,resolveInstance,poll,logs:()=>logs.slice(),benchmarkReport:()=>readJson(join(directory,'native-benchmark.json'),null),setDefault(id){defaultId=resolveInstance(id).id;emit();return publicState();},hasLive:()=>[...instances.values()].some(i=>i.status==='ready'),readyInstances:()=>[...instances.values()].filter(i=>i.status==='ready'),close};
+ async function localPreview(path){if(!packaged)throw new Error('Checking local model files is part of the Strata app.');if(typeof path!=='string'||!path.trim()||[...path].some(c=>c.charCodeAt(0)<32))throw new Error('Choose a folder.');return control.importPlan(path.trim());}
+ return {state:publicState,refresh,localPreview,configure,setDownloadDirectory,plan,settings,save,operation,cancel,unload,resolveInstance,poll,logs:()=>logs.slice(),benchmarkReport:()=>readJson(join(directory,'native-benchmark.json'),null),setDefault(id){defaultId=resolveInstance(id).id;emit();return publicState();},hasLive:()=>[...instances.values()].some(i=>i.status==='ready'),readyInstances:()=>[...instances.values()].filter(i=>i.status==='ready'),close};
}
diff --git a/apps/host/src/components/NativeLocalModel.tsx b/apps/host/src/components/NativeLocalModel.tsx
new file mode 100644
index 000000000..f2d05aaa9
--- /dev/null
+++ b/apps/host/src/components/NativeLocalModel.tsx
@@ -0,0 +1,85 @@
+import { tr } from '../lib/i18n';
+import { useState } from 'react';
+import { Screen } from './layout';
+import { Btn, ErrorNotice, Icon } from './ui';
+import { api } from '../lib/client';
+import { nativeAction, useNative, type NativeJob } from '../lib/native';
+import { nativeCatalogModels, catalogVersionLabel } from '../lib/native-catalog';
+import { sizeGb } from '../lib/format';
+import { NativeProgress } from './NativeModels';
+
+interface Preview { path: string; preview: { file_count: number; total_bytes: number; file_set_status: string; issues: string[]; candidate_selection: { family: string; model: string } | null } }
+
+/** The words for why a folder of GGUF files cannot be used: a sentence and what to do, the checker's own codes under Details. */
+function problem(issues: string[]): { message: string; next: string } {
+ const has = (re: RegExp) => issues.some(i => re.test(i));
+ if (has(/incomplete_or_invalid_shard_set|multiple_model_groups/))
+ return { message: 'Some parts of this model are missing, or the folder holds more than one model.', next: 'Put every part of one model in one folder, then check again.' };
+ if (has(/unrecognized_or_unsupported_model_variant|unsupported_architecture|unsupported_or_missing_architecture|expert_quantization|tokenizer/))
+ return { message: 'Strata can’t run these files yet.', next: 'Strata runs the Qwen3.8-Flash-Next models. Download one from Models, or choose a folder with its files.' };
+ return { message: 'These files could not be checked.', next: 'Check that the folder holds complete GGUF files, then try again.' };
+}
+
+/** "Use a local GGUF": choose the folder of a model you already have, Strata checks it, and prepares and loads it without copying
+ * or downloading the model files. The same page layout and cards as the optimized models page. */
+export function NativeLocalModel({ onBack }: { onBack: () => void }) {
+ const native = useNative();
+ const [typed, setTyped] = useState(''), [checked, setChecked] = useState<Preview | null>(null), [pending, setPending] = useState(false), [error, setError] = useState(''), [jobId, setJobId] = useState('');
+ const job = native?.jobs.find(j => j.id === jobId);
+ const active = native?.jobs.find(j => j.state === 'running');
+ const selection = checked?.preview.candidate_selection;
+ const usable = !!checked && checked.preview.file_set_status === 'plausible' && !!selection;
+ const version = selection ? nativeCatalogModels(native?.catalog?.families ?? []).flatMap(f => f.sizes).find(s => s.sourceFamily === selection.family && s.model === selection.model) : undefined;
+ const family = selection ? nativeCatalogModels(native?.catalog?.families ?? []).find(f => f.sizes.some(s => s.sourceFamily === selection.family && s.model === selection.model)) : undefined;
+ async function check(path: string) {
+ setPending(true);
+ setError('');
+ setChecked(null);
+ try {
+ const result = await api.post<Preview & { cancelled?: boolean }>('/api/native/local/preview', { path });
+ if (!result.cancelled) {
+ setChecked(result);
+ setTyped(result.path);
+ }
+ }
+ catch (e) { setError(e instanceof Error ? e.message : String(e)); }
+ finally { setPending(false); }
+ }
+ async function prepare() {
+ if (!usable || !selection || !checked)
+ return;
+ setPending(true);
+ setError('');
+ try {
+ const result = await nativeAction<NativeJob>('operations', { kind: 'install', args: { family: selection.family, model: selection.model, gguf_dir: checked.path, context: native?.catalog?.recommendation?.context ?? 32768, vision: 'no', kv: 'int8', loadAfter: true } });
+ setJobId(result.id);
+ }
+ catch (e) { setError(e instanceof Error ? e.message : String(e)); }
+ finally { setPending(false); }
+ }
+ const found = checked ? problem(checked.preview.issues) : null;
+ return <Screen plainHeader title={tr("Model")} actions={<Btn onClick={onBack}>{tr("Strata optimized models")}</Btn>}>
+ <div className="native-model-layout">
+ <div className="stack stack--lg">
+ <section className="st-card native-choice"><h2 className="h3">{tr("Use a local GGUF…")}</h2>
+ <p className="small muted">{tr("Already have a supported model on this computer? Choose the folder that holds its files. Strata checks them, prepares the model and loads it. Nothing is copied or downloaded.")}</p>
+ <label className="input-field"><span>{tr("Folder with the GGUF files")}</span><input className="st-input" value={typed} placeholder={tr("Full path to the folder")} spellCheck={false} onChange={e => setTyped(e.target.value)} onKeyDown={e => { if (e.key === 'Enter' && typed.trim()) void check(typed); }}/></label>
+ <div className="native-settings-actions"><Btn icon="folder" disabled={pending || !!active} onClick={() => void check('')}>{tr("Choose folder")}</Btn><Btn disabled={pending || !typed.trim() || !!active} onClick={() => void check(typed)}>{tr(pending && !jobId ? 'Checking…' : 'Check files')}</Btn></div>
+ </section>
+ {tr(checked ? <section className="st-card native-choice">{tr(usable ? <>
+ <h2 className="h3">{tr(family ? family.title : 'Model found')}</h2>
+ <p><strong>{tr(version ? catalogVersionLabel(version) : selection?.model ?? '')}</strong> · {tr(selection?.model ?? '')}</p>
+ <p className="small muted">{tr("{0} files · {1}", [checked.preview.file_count, sizeGb(checked.preview.total_bytes / 1024 ** 3)])}</p>
+ <div className="native-model-actions"><Btn variant="primary" icon="models" disabled={pending || !!active} onClick={() => void prepare()}>{tr(pending ? 'Checking…' : 'Prepare and load')}</Btn></div>
+ </> : <>
+ <h2 className="h3">{tr(found!.message)}</h2>
+ <p className="small muted">{tr(found!.next)}</p>
+ {tr(checked.preview.issues.length ? <details><summary className="small">{tr("Details")}</summary><pre className="small muted error-detail-text">{checked.preview.issues.join(String.fromCharCode(10))}</pre></details> : null)}
+ </>)}</section> : null)}
+ {tr(active ? <NativeProgress job={active}/> : job?.state === 'error' ? <ErrorNotice message={job.error ?? job.summary} detail={job.details}/> : job?.state === 'done' ? <p className="small" role="status"><Icon name="check" size={15}/> {tr(job.summary)}</p> : null)}
+ {tr(error ? <ErrorNotice message={error}/> : null)}
+ </div>
+ <aside className="stack stack--lg"><section className="st-card"><h2 className="h4">{tr("This computer")}</h2><p>{tr(native?.hardware?.ram_gb || '—')}{tr(" GB RAM")}</p>{tr(native?.hardware?.gpus.length ? native.hardware.gpus.map(g => <p className="small" key={g.index}>{tr(g.name)} · {tr(g.vram_gb)}{tr(" GB")}</p>) : null)}</section></aside>
+ </div>
+ </Screen>;
+}
diff --git a/apps/host/src/components/NativeModels.tsx b/apps/host/src/components/NativeModels.tsx
index a251f0730..07625d162 100644
--- a/apps/host/src/components/NativeModels.tsx
+++ b/apps/host/src/components/NativeModels.tsx
@@ -3,6 +3,7 @@ import { useEffect, useMemo, useRef, useState } from 'react';
import { Screen } from './layout';
import { Btn, Dialog, ErrorNotice, Icon, Select } from './ui';
import { installProgress, useDownloadEta } from '../lib/download-eta';
+import { sizeGb } from '../lib/format';
import { NativeDeleteDialog } from './NativeDelete';
import { plainFailureText } from '../lib/plain-errors';
import { api } from '../lib/client';
@@ -12,7 +13,6 @@ import { NativeSettings } from './NativeSettings';
import { RunImageModel } from './RunImageModel';
import { useStore } from '../lib/store';
import { NativePresets } from './NativePresets';
-import { NativeBenchmark } from './NativeOperations';
import { nativeCatalogModels, catalogVersionLabel } from '../lib/native-catalog';
export function NativeModels({ onOtherModels, onReady, onImport, onConnectEngine }: {
onOtherModels: () => void;
@@ -25,7 +25,7 @@ export function NativeModels({ onOtherModels, onReady, onImport, onConnectEngine
const manual = useStore(s => s.setup?.choices?.onboarding?.manual ?? false);
const [expert, setExpert] = useState(manual), [multiple, setMultiple] = useState(false), [gpus, setGpus] = useState<number[]>([]), [kv, setKv] = useState('int8'), [lowRam, setLowRam] = useState('auto'), [split, setSplit] = useState('auto'), [deviceChoice, setDeviceChoice] = useState('auto');
const [resourceProfile, setResourceProfile] = useState<'work' | 'performance'>('work');
- const [pending, setPending] = useState(false), [error, setError] = useState(''), [plan, setPlan] = useState<Record<string, any> | null>(null), [benchmark, setBenchmark] = useState(false), [jobId, setJobId] = useState(''), [manage, setManage] = useState(false);
+ const [pending, setPending] = useState(false), [error, setError] = useState(''), [plan, setPlan] = useState<Record<string, any> | null>(null), [jobId, setJobId] = useState(''), [manage, setManage] = useState(false);
const presetPending = useRef(false);
const [deleting, setDeleting] = useState<string | null>(null);
const families = nativeCatalogModels(native?.catalog?.families ?? []);
@@ -35,6 +35,7 @@ export function NativeModels({ onOtherModels, onReady, onImport, onConnectEngine
const selectedFamily = families.find(f => f.family === family || f.sizes.some(size => size.sourceFamily === family)) ?? families[0], selectedSize = selectedFamily?.sizes.find(s => s.id === size) ?? selectedFamily?.sizes[0];
const installed = native?.installed?.models.find(m => m.model === selectedSize?.id);
// The model that is running is shown as running, with Unload: not offered for loading again.
+ const downloaded = native?.installed?.models ?? [], allSizes = families.flatMap(f => f.sizes);
const loadedSelected = native?.instances.find(i => i.model === selectedSize?.id && i.status === 'ready');
// A model that is already on this PC loads as it was prepared: the page shows its settings, so loading it never asks to download.
useEffect(() => { if (installed?.ready) {
@@ -105,14 +106,20 @@ export function NativeModels({ onOtherModels, onReady, onImport, onConnectEngine
{tr(active ? <NativeProgress job={active}/> : null)}
{tr(job?.state === 'error' ? <ErrorNotice message={job.error ?? job.summary} action={tr("Retry")} onRetry={() => void load()}/> : null)}
{tr(error ? <ErrorNotice message={error}/> : null)}
- <div className="native-model-actions">{tr(loadedSelected ? <><Btn icon="gauge" disabled={!!active} onClick={() => setBenchmark(true)}>{tr("Tune model")}</Btn><Btn disabled={pending || !!active} onClick={() => void perform(() => nativeAction(`instances/${loadedSelected.id}/unload`))}>{tr("Unload")}</Btn>{tr(onReady ? <Btn variant="primary" onClick={onReady}>{tr("Start chatting")}</Btn> : <span className="native-ready">{tr("Ready")}</span>)}</> : onReady && native?.instances.some(i => i.status === 'ready') ? <Btn variant="primary" onClick={onReady}>{tr("Start chatting")}</Btn> : <><Btn icon="gauge" disabled={!native?.instances.some(i => i.status === 'ready') || !!active} onClick={() => setBenchmark(true)}>{tr("Tune model")}</Btn><Btn variant="primary" icon="models" disabled={pending || !native?.available || !!active || !selectedSize || expert && deviceChoice === 'split' && gpus.length < 2} onClick={() => void load()}>{tr(pending ? 'Checking…' : installed?.ready ? 'Load model' : 'Download & load')}</Btn></>)}</div>
+ <div className="native-model-actions">{tr(loadedSelected ? <><Btn disabled={pending || !!active} onClick={() => void perform(() => nativeAction(`instances/${loadedSelected.id}/unload`))}>{tr("Unload")}</Btn>{tr(onReady ? <Btn variant="primary" onClick={onReady}>{tr("Start chatting")}</Btn> : <span className="native-ready">{tr("Ready")}</span>)}</> : onReady && native?.instances.some(i => i.status === 'ready') ? <Btn variant="primary" onClick={onReady}>{tr("Start chatting")}</Btn> : <><Btn variant="primary" icon="models" disabled={pending || !native?.available || !!active || !selectedSize || expert && deviceChoice === 'split' && gpus.length < 2} onClick={() => void load()}>{tr(pending ? 'Checking…' : installed?.ready ? 'Load model' : 'Download & load')}</Btn></>)}</div>
</div>
<aside className="stack stack--lg"><section className="st-card"><h2 className="h4">{tr("This computer")}</h2><p>{tr(native?.hardware?.ram_gb || hardware?.memory.totalGb || '—')}{tr(" GB RAM")}</p>{tr(native?.hardware?.gpus.length ? native.hardware.gpus.map(g => <p className="small" key={g.index}>{tr(g.name)} · {tr(g.vram_gb)}{tr(" GB")}</p>) : <p className="small muted">{tr("No supported GPU reported by this installation.")}</p>)}<p className="small muted">{tr("Compatibility and sizes come from your installed Strata version.")}</p></section><section className="st-card"><h2 className="h4">{tr("Model files")}</h2><p className="small muted">{tr("Strata prepares all shards, the draft layer and shared files. Completed downloads are reused.")}</p><code className="native-path">{installed?.dataFolder ?? native?.downloadDirectory ?? native?.installed?.data_folder ?? 'Choose an installation'}</code><Btn size="sm" variant="ghost" onClick={() => { setSettingsSection('Storage'); go('settings'); }}>{tr("Storage settings")}</Btn></section><Btn size="sm" variant="ghost" onClick={onOtherModels}>{tr("Other local models\u2026")}</Btn></aside>
</div>
<Dialog open={!!plan} title={tr("Download and prepare")} compact onClose={() => !pending && setPlan(null)} actions={<><Btn disabled={pending} onClick={() => setPlan(null)}>{tr("Cancel")}</Btn><Btn variant="primary" disabled={pending || !!plan?.plan?.disk_short} onClick={() => void download()}>{tr("Download & load")}</Btn></>}><p><strong>{tr(plan?.plan?.title ?? selectedFamily?.title)}</strong>{tr(" \u00B7 approximately ")}{tr(plan?.plan?.download_gb ?? selectedSize?.download_gb)}{tr(" GB")}</p>{tr(plan?.plan?.disk_short ? <ErrorNotice message={plan.plan.disk_short}/> : null)}<p className="small muted">{tr("Existing files are checked and reused. Any currently loaded native models will be unloaded before preparing files.")}</p><p className="small muted">{tr("Your computer may feel slower while weights load. You can stop the download and resume later.")}</p>{tr(selectedSize?.images ? <p className="small muted">{tr("Vision encoder files are included. Picture reading loads only when enabled.")}</p> : null)}</Dialog>
<NativeDeleteDialog id={deleting} onClose={() => setDeleting(null)}/>
- <Dialog open={manage} title={tr("Manage models")} onClose={() => setManage(false)} actions={<Btn onClick={() => setManage(false)}>{tr("Done")}</Btn>}><div className="stack"><p className="strong">{tr(selectedFamily?.title)}</p><div className="st-tablewrap"><table className="st-table"><thead><tr><th>{tr("Version")}</th><th>{tr("Download")}</th><th>{tr("Status")}</th><th></th></tr></thead><tbody>{tr(selectedFamily?.sizes.map(v => <tr key={v.id}><td><strong>{tr(catalogVersionLabel(v))}</strong><small>{tr(v.model)} · {tr(v.about)}</small></td><td>{tr(v.download_gb.toFixed(1))}{tr(" GB")}</td><td>{tr(native?.instances.some(i => i.model === v.id) ? 'Loaded' : v.installed ? 'Downloaded' : 'Available')}</td><td><Btn size="sm" disabled={!!active} onClick={() => { setSize(v.id); setManage(false); }}>{tr(selectedSize?.id === v.id ? 'Selected' : 'Use version')}</Btn>{tr(native?.installed?.models.some(m => m.model === v.id) ? <> <Btn size="sm" variant="danger" disabled={!!active} onClick={() => setDeleting(v.id)}>{tr("Delete")}</Btn></> : null)}</td></tr>))}</tbody></table></div><Btn variant="ghost" icon="folder" onClick={() => { setManage(false); (onImport ?? onOtherModels)(); }}>{tr("Use a local GGUF\u2026")}</Btn><p className="xs muted">{tr("Choose a version, then load it from Models. Shared native files are kept together in Storage.")}</p></div></Dialog>
- <NativeBenchmark open={benchmark} onClose={() => setBenchmark(false)}/>
+ <Dialog open={manage} title={tr("Manage models")} onClose={() => setManage(false)} actions={<Btn onClick={() => setManage(false)}>{tr("Done")}</Btn>}><div className="native-manage">
+ {tr(downloaded.length ? <div className="native-manage-list" role="list">{tr(downloaded.map(m => { const v = allSizes.find(x => x.id === m.model), loaded = native?.instances.some(i => i.model === m.model && i.status === 'ready'); return <div className="native-manage-row" role="listitem" key={m.model} data-selected={selectedSize?.id === m.model || undefined}>
+ <span className="native-manage-name"><strong>{tr(v ? `${catalogVersionLabel(v)}` : m.model_name ?? m.model)}</strong><small>{tr(v ? v.model : m.model)}{tr(m.diskGb ? ` · ${sizeGb(m.diskGb)}` : '')}</small></span>
+ <span className={loaded ? 'st-pill st-pill--accent' : 'st-pill'}>{tr(loaded ? 'Loaded' : 'Downloaded')}</span>
+ <span className="native-manage-actions"><Btn size="sm" disabled={!!active || !v} onClick={() => { if (v) setSize(v.id); setManage(false); }}>{tr(selectedSize?.id === m.model ? 'Selected' : 'Use version')}</Btn><Btn size="sm" variant="danger" disabled={!!active} onClick={() => setDeleting(m.model)}>{tr("Delete")}</Btn></span>
+ </div>; }))}</div> : <p className="small muted native-manage-empty">{tr("No downloaded models")}</p>)}
+ <div className="native-manage-foot"><Btn variant="ghost" icon="folder" onClick={() => { setManage(false); (onImport ?? onOtherModels)(); }}>{tr("Use a local GGUF…")}</Btn></div>
+ </div></Dialog>
</Screen>;
}
/** setup's "5/7: downloading …" as a sentence a person can read. */
diff --git a/apps/host/src/components/NativeOperations.tsx b/apps/host/src/components/NativeOperations.tsx
index 1857b7478..f058becc4 100644
--- a/apps/host/src/components/NativeOperations.tsx
+++ b/apps/host/src/components/NativeOperations.tsx
@@ -2,8 +2,7 @@ import {localeTag} from '../lib/i18n';
import { tr } from '../lib/i18n';
import { useEffect, useState } from 'react';
import { api } from '../lib/client';
-import { nativeAction, refreshNative, useNative, type NativeJob } from '../lib/native';
-import { NativeSettings } from './NativeSettings';
+import { nativeAction, useNative, type NativeJob } from '../lib/native';
import { Btn, Dialog, ErrorNotice, Select } from './ui';
import { NativeProgress } from './NativeModels';
export function NativeBenchmark({ open, onClose }: {
@@ -48,57 +47,60 @@ export function NativeBenchmark({ open, onClose }: {
}
export function NativeOperations() {
const native = useNative();
- const [repository, setRepository] = useState(''), [model, setModel] = useState(''), [error, setError] = useState(''), [pending, setPending] = useState(false), [benchmark, setBenchmark] = useState(false), [logs, setLogs] = useState<{
+ const [error, setError] = useState(''), [saved, setSaved] = useState(''), [saving, setSaving] = useState(false);
+ const [logs, setLogs] = useState<{
at: string;
instanceId: string;
line: string;
- }[]>([]), [showLogs, setShowLogs] = useState(false), [confirm, setConfirm] = useState('');
- const installed = native?.installed?.models ?? [], selected = installed.find(i => i.model === model) ?? installed[0], active = native?.jobs.find(j => j.state === 'running');
- useEffect(() => { setRepository(native?.repo ?? ''); }, [native?.repo]);
+ }[]>([]), [showLogs, setShowLogs] = useState(false), [confirm, setConfirm] = useState(false);
+ const [update, setUpdate] = useState<'checking' | 'available' | 'current' | 'unknown'>('checking');
+ const active = native?.jobs.find(j => j.state === 'running');
+ // The engine's update is offered only when the update check says there is one.
+ useEffect(() => {
+ let alive = true;
+ void api.get<{ engine?: { status?: string } }>('/api/updates/check').then(r => { if (alive) setUpdate(r.engine?.status === 'available' ? 'available' : r.engine?.status === 'current' ? 'current' : 'unknown'); }).catch(() => { if (alive) setUpdate('unknown'); });
+ return () => { alive = false; };
+ }, []);
useEffect(() => {
if (!showLogs)
return;
- let current = true;
- const load = () => void api.get<{
+ const read = () => void api.get<{
logs: typeof logs;
- }>('/api/native/logs').then(value => {
- if (current)
- setLogs(value.logs);
- }).catch(e => setError(e.message));
- load();
- const timer = setInterval(load, 2500);
- return () => { current = false; clearInterval(timer); };
+ }>('/api/native/logs').then(value => { setLogs(value.logs); }).catch(() => { });
+ read();
+ const timer = setInterval(read, 2000);
+ return () => clearInterval(timer);
}, [showLogs]);
- async function connect() {
- setPending(true);
+ async function updateEngine() {
setError('');
try {
- await api.patch('/api/native', { repository });
- await refreshNative(true);
+ await nativeAction('operations', { kind: 'update-engine' });
+ setConfirm(false);
}
catch (e) {
setError(e instanceof Error ? e.message : String(e));
}
- finally {
- setPending(false);
- }
}
- async function operate(kind: string) {
+ // The window cannot save a download, so the host writes the file to Downloads and says where.
+ async function saveLogs() {
+ setSaving(true);
+ setSaved('');
setError('');
try {
- await nativeAction('operations', { kind, args: { model: selected?.model } });
- setConfirm('');
+ const result = await api.post<{ path: string }>('/api/native/logs/save', {});
+ setSaved(result.path);
}
catch (e) {
setError(e instanceof Error ? e.message : String(e));
}
+ finally {
+ setSaving(false);
+ }
}
- function exportLogs() { const url = URL.createObjectURL(new Blob([logs.map(l => `${l.at} ${l.instanceId}: ${l.line}`).join('\n')], { type: 'text/plain' })); const a = document.createElement('a'); a.href = url; a.download = 'strata-engine.log'; a.click(); URL.revokeObjectURL(url); }
- return <div className="stack stack--lg native-engine-settings"><section className="st-card"><div className="section-toolbar"><h2 className="h3">{tr("Engine installation")}</h2><span className="st-pill">{tr(native?.available ? 'Connected' : 'Setup needed')}</span></div><p className="small muted">{tr("Your local Strata installation handles optimized models, companion files and engine updates.")}</p><details open={!native?.available}><summary className="small">{tr("Installation folder")}</summary><label className="input-field"><span>{tr("Strata folder")}</span><input className="st-input" aria-label={tr("Strata installation folder")} placeholder={tr("Folder containing setup.py")} value={repository} onChange={e => setRepository(e.target.value)}/></label><div className="native-settings-actions"><Btn disabled={pending || !repository.trim() || !!active} onClick={() => void connect()}>{tr(pending ? 'Connecting…' : 'Connect installation')}</Btn><Btn disabled={!!active} onClick={() => void refreshNative(true)}>{tr("Check again")}</Btn><a className="st-btn st-btn--ghost" href="https://github.com/Niko1221/Strata" target="_blank" rel="noreferrer">{tr("Get Strata")}</a></div></details>{tr(native?.error ? <p className="small inline-error">{tr(native.error)}</p> : <p className="small muted">{tr(native?.summary)}</p>)}</section>
- {tr(installed.length ? <section className="st-card"><h2 className="h3">{tr("Model settings & tools")}</h2><Select ariaLabel={tr("Native settings model")} value={selected?.model ?? ''} options={installed.map(m => ({ value: m.model, label: m.model_name ?? m.model }))} onChange={setModel}/>{tr(selected ? <NativeSettings model={selected.model}/> : null)}</section> : <p className="small muted">{tr("Prepare a model in Models to configure its engine parameters and MCP tools.")}</p>)}
- <section className="st-card"><h2 className="h3">{tr("Performance")}</h2><p className="small muted">{tr("Measure speed with a short test. Expert calibration tries engine settings and saves the fastest measured configuration.")}</p><div className="native-settings-actions"><Btn icon="gauge" disabled={!native?.instances.some(i => i.status === 'ready') || !!active} onClick={() => setBenchmark(true)}>{tr("Measure speed")}</Btn><Btn disabled={!native?.capabilities.calibration || !selected?.ready || !!active} onClick={() => setConfirm('calibrate')}>{tr("Calibrate engine\u2026")}</Btn></div>{tr(!native?.capabilities.calibration ? <p className="xs muted">{tr("Calibration is available on NVIDIA hardware supported by the installed version. Short benchmarks work with any running native instance.")}</p> : null)}</section>
- <section className="st-card"><div className="section-toolbar"><h2 className="h3">{tr("Diagnostics")}</h2><Btn size="sm" onClick={() => setShowLogs(v => !v)}>{tr(showLogs ? 'Hide logs' : 'View engine logs')}</Btn></div><p className="small muted">{tr("Downloads, preparation and engine failures include their original messages here.")}</p>{tr(showLogs ? <><pre className="native-log" aria-label={tr("Engine log")}>{logs.length ? logs.map(l => `${l.at} · ${l.line}`).join('\n') : 'No engine messages yet.'}</pre><Btn size="sm" icon="download" onClick={exportLogs}>{tr("Save logs")}</Btn></> : null)}{tr(native?.jobs.filter(j => j.state === 'error').slice(-3).map(j => <ErrorNotice key={j.id} message={j.error ?? j.summary}/>))}</section>
+ return <div className="stack stack--lg native-engine-settings">
+ <section className="st-card"><div className="section-toolbar"><h2 className="h3">{tr("Update component")}</h2>{tr(update === 'available' ? <Btn size="sm" variant="primary" disabled={!!active || (native?.instances.length ?? 0) > 0} onClick={() => setConfirm(true)}>{tr("Update available")}</Btn> : null)}</div><p className="small muted">{tr("Update the engine for this computer. Your models and settings are kept.")}</p>{tr(update === 'current' ? <p className="small muted">{tr("Up to date")}</p> : null)}{tr(update === 'available' && (native?.instances.length ?? 0) > 0 ? <p className="small muted">{tr("Open Models and unload the running native models first.")}</p> : null)}</section>
+ <section className="st-card"><div className="section-toolbar"><h2 className="h3">{tr("Diagnostics")}</h2><Btn size="sm" onClick={() => setShowLogs(v => !v)}>{tr(showLogs ? 'Hide logs' : 'View engine logs')}</Btn></div><p className="small muted">{tr("Downloads, preparation and engine failures include their original messages here.")}</p>{tr(showLogs ? <pre className="native-log" aria-label={tr("Engine log")}>{logs.length ? logs.map(l => `${l.at} · ${l.line}`).join(String.fromCharCode(10)) : 'No engine messages yet.'}</pre> : null)}<div className="native-settings-actions"><Btn size="sm" icon="download" disabled={saving} onClick={() => void saveLogs()}>{tr(saving ? 'Working…' : 'Save logs')}</Btn></div>{tr(saved ? <p className="small" role="status">{tr("Saved to {0}", [saved])}</p> : null)}{tr(native?.jobs.filter(j => j.state === 'error').slice(-3).map(j => <ErrorNotice key={j.id} message={j.error ?? j.summary} detail={j.details}/>))}</section>
{tr(active ? <NativeProgress job={active}/> : null)}{tr(error ? <ErrorNotice message={error}/> : null)}
- <NativeBenchmark open={benchmark} onClose={() => setBenchmark(false)}/><Dialog open={!!confirm} compact title={tr("Calibrate this computer?")} onClose={() => setConfirm('')} actions={<><Btn onClick={() => setConfirm('')}>{tr("Cancel")}</Btn><Btn variant="primary" disabled={!!active || (native?.instances.length ?? 0) > 0} onClick={() => void operate('calibrate')}>{tr("Start calibration")}</Btn></>}><p>{tr("The computer will be busy for about 5–15 minutes. Unload models first.")} {tr("Strata will calibrate {0} and save the fastest measured settings.", [selected?.model_name ?? tr("The selected model")])}</p></Dialog>
+ <Dialog open={confirm} compact title={tr("Update engine?")} onClose={() => setConfirm(false)} actions={<><Btn onClick={() => setConfirm(false)}>{tr("Cancel")}</Btn><Btn variant="primary" disabled={!!active || (native?.instances.length ?? 0) > 0} onClick={() => void updateEngine()}>{tr("Update")}</Btn></>}><p>{tr("The native installer updates the installation. Model files and settings are kept. Unload native models before updating.")}</p></Dialog>
</div>;
}
diff --git a/apps/host/src/components/SettingsUpdates.tsx b/apps/host/src/components/SettingsUpdates.tsx
index 49d4217d2..052526ccc 100644
--- a/apps/host/src/components/SettingsUpdates.tsx
+++ b/apps/host/src/components/SettingsUpdates.tsx
@@ -63,14 +63,13 @@ export function SettingsUpdates() {
return <div className="settings-version" data-update={update?.status}>
<Icon name={name === 'Strata' ? 'layers' : 'engine'} size={20}/>
<span><strong>{tr(name)}</strong><small>{tr(version ?? 'Version unavailable')}</small>{tr(!checking && update ? <small className="settings-version__message">{tr(update.message)}</small> : null)}</span>
- {tr(!checking && update?.status === 'available' && update.releaseUrl ? <a className="st-btn st-btn--secondary st-btn--sm" href={update.releaseUrl} target="_blank" rel="noreferrer" title={tr("Open the release page to update this installation")}>{tr("Get update")}<Icon name="download" size={15}/></a> : <span className="settings-version__label">{tr(checking ? 'Checking…' : update ? labels[update.status] : version === 'Not installed' ? 'Not installed' : 'Installed')}</span>)}
+ {tr(!checking && update?.status === 'available' ? (native?.available ? <Btn size="sm" variant="primary" disabled={!!active || (name === 'Engine' && !native.installed?.models.length)} onClick={() => setConfirm(name === 'Strata' ? 'update-strata' : 'update-engine')}>{tr("Update available")}</Btn> : update.releaseUrl ? <a className="st-btn st-btn--secondary st-btn--sm" href={update.releaseUrl} target="_blank" rel="noreferrer" title={tr("Open the release page to update this installation")}>{tr("Update available")}<Icon name="download" size={15}/></a> : <span className="settings-version__label">{tr(labels[update.status])}</span>) : <span className="settings-version__label">{tr(checking ? 'Checking…' : update ? labels[update.status] : version === 'Not installed' ? 'Not installed' : 'Installed')}</span>)}
</div>;
}
return <>
<div className="settings-versions" aria-busy={checking}>
{tr(versionRow('Strata', native?.version ?? appVersion, result?.strata))}
{tr(versionRow('Engine', native?.available ? (native.installed?.engine?.version ?? 'Not installed') : engineVersion, result?.engine))}
- {tr(native?.available ? <div className="settings-update-actions"><Btn size="sm" disabled={!!active} onClick={() => setConfirm('update-strata')}>{tr("Update Strata")}</Btn><Btn size="sm" disabled={!!active || !native.installed?.models.length} onClick={() => setConfirm('update-engine')}>{tr("Update engine")}</Btn></div> : null)}
<div className="settings-update-actions"><Btn size="sm" icon="refresh" disabled={checking} className={checking ? 'settings-update-checking' : undefined} onClick={() => void check()}>{tr(checking ? 'Checking…' : error || result?.strata.status === 'error' ? 'Try again' : result ? 'Check again' : 'Check for updates')}</Btn><Btn size="sm" variant="ghost" onClick={() => setRollback(true)}>{tr("Roll back\u2026")}</Btn></div>
<div className="settings-update-inline" role="status" aria-live="polite">{tr(checking ? 'Checking for new versions…' : error ? <span className="inline-error">{tr(error)}</span> : result ? <><span className="sr-only">{tr(result.strata.message)} {tr(result.engine.message)} </span>{tr("Checked at ")}{tr(new Date(result.checkedAt).toLocaleTimeString(localeTag(), { hour: '2-digit', minute: '2-digit' }))}</> : null)}</div>
</div>
diff --git a/apps/host/src/lib/native-monitor.ts b/apps/host/src/lib/native-monitor.ts
index 29f9e2061..f2c4bf5b0 100644
--- a/apps/host/src/lib/native-monitor.ts
+++ b/apps/host/src/lib/native-monitor.ts
@@ -46,3 +46,15 @@ export function nativeMonitorData(native:NativeState,inventory:Hardware|null,sel
totals:{tokensIn:tokenTotal('prompt_tokens'),tokensOut:tokenTotal('output_tokens'),requests:tokenTotal('requests'),avgTps:NaN,since:selected?.loadedAt??instances[0]?.loadedAt??new Date().toISOString(),ttftMs:NaN,cachedTokens:tokenTotal('reused'),uncachedTokens:tokenTotal('prompt_tokens')-tokenTotal('reused'),promptMs:hasReading(tokenTotal('prompt_ms'))?tokenTotal('prompt_ms'):undefined,decodeMs:hasReading(tokenTotal('decode_ms'))?tokenTotal('decode_ms'):undefined}
};
}
+
+/** GPU temperature, load, VRAM, power and PCIe come from the engine's metrics while a model runs. With no model loaded (or an engine that
+ * reports none of them) the host's own sensors fill in: nvidia-smi, or the AMD/Intel sysfs readings the host probes itself. */
+export function withHostSensors(live:MonitorState,host:MonitorState|null):MonitorState{
+ const s=host?.hardware,h=live.hardware;if(!s||!h)return live;
+ const empty=(g:GpuReading)=>![g.utilizationPct,g.temperatureC,g.memoryUsedGb,g.powerW].some(hasReading);
+ const pick=<T,>(a:T,b:T)=>hasReading(a as unknown)?a:b;
+ return {...live,hardware:{...h,
+ gpus:(h.gpus??[]).map(g=>{const sensor=s.gpus?.find(x=>x.id===g.id);return sensor&&empty(g)?{...g,...sensor}:g;}),
+ gpuLoad:pick(h.gpuLoad,s.gpuLoad),vramUsedGb:pick(h.vramUsedGb,s.vramUsedGb),vramTotalGb:pick(h.vramTotalGb,s.vramTotalGb),gpuTempC:pick(h.gpuTempC,s.gpuTempC),
+ powerW:pick(h.powerW,s.powerW),powerLimitW:pick(h.powerLimitW,s.powerLimitW),pcieRxMbs:pick(h.pcieRxMbs,s.pcieRxMbs)}};
+}
diff --git a/apps/host/src/locales/de.json b/apps/host/src/locales/de.json
index a794146f2..54031b6af 100644
--- a/apps/host/src/locales/de.json
+++ b/apps/host/src/locales/de.json
@@ -2594,5 +2594,21 @@
"s2593": "Ihr Computer wird geprüft …",
"s2594": "Alles wird vorbereitet …",
"s2595": "Ihr Modell wird heruntergeladen …",
- "s2596": "Ihr Modell wird für Strata vorbereitet …"
+ "s2596": "Ihr Modell wird für Strata vorbereitet …",
+ "s2597": "Komponente aktualisieren",
+ "s2598": "Aktualisiert die Engine für diesen Computer. Ihre Modelle und Einstellungen bleiben erhalten.",
+ "s2599": "Gespeichert unter {0}",
+ "s2600": "Haben Sie bereits ein unterstütztes Modell auf diesem Computer? Wählen Sie den Ordner mit seinen Dateien. Strata prüft sie, bereitet das Modell vor und lädt es. Es wird nichts kopiert oder heruntergeladen.",
+ "s2601": "Ordner mit den GGUF-Dateien",
+ "s2602": "Vollständiger Pfad zum Ordner",
+ "s2603": "Dateien prüfen",
+ "s2604": "Modell gefunden",
+ "s2605": "{0} Dateien · {1}",
+ "s2606": "Vorbereiten und laden",
+ "s2607": "Teile dieses Modells fehlen, oder der Ordner enthält mehr als ein Modell.",
+ "s2608": "Legen Sie alle Teile eines Modells in einen Ordner und prüfen Sie erneut.",
+ "s2609": "Strata kann diese Dateien noch nicht ausführen.",
+ "s2610": "Strata führt die Qwen3.8-Flash-Next-Modelle aus. Laden Sie eines unter „Modelle“ herunter oder wählen Sie einen Ordner mit dessen Dateien.",
+ "s2611": "Diese Dateien konnten nicht geprüft werden.",
+ "s2612": "Prüfen Sie, ob der Ordner vollständige GGUF-Dateien enthält, und versuchen Sie es erneut."
}
diff --git a/apps/host/src/locales/en.json b/apps/host/src/locales/en.json
index 349372d56..b8143341b 100644
--- a/apps/host/src/locales/en.json
+++ b/apps/host/src/locales/en.json
@@ -2594,5 +2594,21 @@
"s2593": "Checking your computer…",
"s2594": "Getting things ready…",
"s2595": "Downloading your model…",
- "s2596": "Preparing your model for Strata…"
+ "s2596": "Preparing your model for Strata…",
+ "s2597": "Update component",
+ "s2598": "Update the engine for this computer. Your models and settings are kept.",
+ "s2599": "Saved to {0}",
+ "s2600": "Already have a supported model on this computer? Choose the folder that holds its files. Strata checks them, prepares the model and loads it. Nothing is copied or downloaded.",
+ "s2601": "Folder with the GGUF files",
+ "s2602": "Full path to the folder",
+ "s2603": "Check files",
+ "s2604": "Model found",
+ "s2605": "{0} files · {1}",
+ "s2606": "Prepare and load",
+ "s2607": "Some parts of this model are missing, or the folder holds more than one model.",
+ "s2608": "Put every part of one model in one folder, then check again.",
+ "s2609": "Strata can’t run these files yet.",
+ "s2610": "Strata runs the Qwen3.8-Flash-Next models. Download one from Models, or choose a folder with its files.",
+ "s2611": "These files could not be checked.",
+ "s2612": "Check that the folder holds complete GGUF files, then try again."
}
diff --git a/apps/host/src/locales/es.json b/apps/host/src/locales/es.json
index 55cffb0d0..6ce088d56 100644
--- a/apps/host/src/locales/es.json
+++ b/apps/host/src/locales/es.json
@@ -2594,5 +2594,21 @@
"s2593": "Revisando tu equipo…",
"s2594": "Preparando todo…",
"s2595": "Descargando tu modelo…",
- "s2596": "Preparando tu modelo para Strata…"
+ "s2596": "Preparando tu modelo para Strata…",
+ "s2597": "Actualizar componente",
+ "s2598": "Actualiza el motor de este equipo. Tus modelos y ajustes se conservan.",
+ "s2599": "Guardado en {0}",
+ "s2600": "¿Ya tienes un modelo compatible en este equipo? Elige la carpeta con sus archivos. Strata los comprueba, prepara el modelo y lo carga. No se copia ni se descarga nada.",
+ "s2601": "Carpeta con los archivos GGUF",
+ "s2602": "Ruta completa de la carpeta",
+ "s2603": "Comprobar archivos",
+ "s2604": "Modelo encontrado",
+ "s2605": "{0} archivos · {1}",
+ "s2606": "Preparar y cargar",
+ "s2607": "Faltan partes de este modelo, o la carpeta contiene más de un modelo.",
+ "s2608": "Pon todas las partes de un modelo en una carpeta y vuelve a comprobar.",
+ "s2609": "Strata aún no puede ejecutar estos archivos.",
+ "s2610": "Strata ejecuta los modelos Qwen3.8-Flash-Next. Descarga uno en Modelos o elige una carpeta con sus archivos.",
+ "s2611": "No se pudieron comprobar estos archivos.",
+ "s2612": "Comprueba que la carpeta tenga archivos GGUF completos e inténtalo de nuevo."
}
diff --git a/apps/host/src/locales/ja.json b/apps/host/src/locales/ja.json
index b2b582edd..ab7e481a8 100644
--- a/apps/host/src/locales/ja.json
+++ b/apps/host/src/locales/ja.json
@@ -2594,5 +2594,21 @@
"s2593": "お使いのコンピューターを確認しています…",
"s2594": "準備をしています…",
"s2595": "モデルをダウンロードしています…",
- "s2596": "Strata 用にモデルを準備しています…"
+ "s2596": "Strata 用にモデルを準備しています…",
+ "s2597": "コンポーネントを更新",
+ "s2598": "このコンピューター用のエンジンを更新します。モデルと設定はそのまま残ります。",
+ "s2599": "{0} に保存しました",
+ "s2600": "対応モデルがすでにこのコンピューターにありますか? そのファイルがあるフォルダーを選んでください。Strata がファイルを確認し、モデルを準備して読み込みます。コピーやダウンロードは行いません。",
+ "s2601": "GGUF ファイルのフォルダー",
+ "s2602": "フォルダーのフルパス",
+ "s2603": "ファイルを確認",
+ "s2604": "モデルが見つかりました",
+ "s2605": "{0} ファイル · {1}",
+ "s2606": "準備して読み込む",
+ "s2607": "このモデルの一部が足りないか、フォルダーに複数のモデルが入っています。",
+ "s2608": "1 つのモデルのすべてのパーツを 1 つのフォルダーに入れてから、もう一度確認してください。",
+ "s2609": "Strata はこれらのファイルをまだ実行できません。",
+ "s2610": "Strata は Qwen3.8-Flash-Next のモデルを実行します。「モデル」からダウンロードするか、そのファイルのフォルダーを選んでください。",
+ "s2611": "これらのファイルを確認できませんでした。",
+ "s2612": "フォルダーに完全な GGUF ファイルがあることを確認して、もう一度お試しください。"
}
diff --git a/apps/host/src/locales/ko.json b/apps/host/src/locales/ko.json
index f305210a1..619b845ca 100644
--- a/apps/host/src/locales/ko.json
+++ b/apps/host/src/locales/ko.json
@@ -2594,5 +2594,21 @@
"s2593": "컴퓨터를 확인하는 중…",
"s2594": "준비하는 중…",
"s2595": "모델을 다운로드하는 중…",
- "s2596": "Strata용으로 모델을 준비하는 중…"
+ "s2596": "Strata용으로 모델을 준비하는 중…",
+ "s2597": "구성 요소 업데이트",
+ "s2598": "이 컴퓨터용 엔진을 업데이트합니다. 모델과 설정은 그대로 유지됩니다.",
+ "s2599": "{0}에 저장했습니다",
+ "s2600": "이 컴퓨터에 이미 지원되는 모델이 있나요? 파일이 있는 폴더를 선택하세요. Strata가 파일을 확인하고 모델을 준비한 뒤 불러옵니다. 복사하거나 다운로드하지 않습니다.",
+ "s2601": "GGUF 파일이 있는 폴더",
+ "s2602": "폴더의 전체 경로",
+ "s2603": "파일 확인",
+ "s2604": "모델을 찾았습니다",
+ "s2605": "파일 {0}개 · {1}",
+ "s2606": "준비 후 불러오기",
+ "s2607": "이 모델의 일부가 없거나 폴더에 모델이 둘 이상 들어 있습니다.",
+ "s2608": "한 모델의 모든 파일을 한 폴더에 넣은 뒤 다시 확인하세요.",
+ "s2609": "Strata가 아직 이 파일을 실행할 수 없습니다.",
+ "s2610": "Strata는 Qwen3.8-Flash-Next 모델을 실행합니다. 모델 화면에서 내려받거나 해당 파일이 있는 폴더를 선택하세요.",
+ "s2611": "이 파일을 확인할 수 없습니다.",
+ "s2612": "폴더에 완전한 GGUF 파일이 있는지 확인한 뒤 다시 시도하세요."
}
diff --git a/apps/host/src/locales/pt.json b/apps/host/src/locales/pt.json
index bed56fe32..24a0d65c0 100644
--- a/apps/host/src/locales/pt.json
+++ b/apps/host/src/locales/pt.json
@@ -2594,5 +2594,21 @@
"s2593": "Verificando seu computador…",
"s2594": "Preparando tudo…",
"s2595": "Baixando seu modelo…",
- "s2596": "Preparando seu modelo para o Strata…"
+ "s2596": "Preparando seu modelo para o Strata…",
+ "s2597": "Atualizar componente",
+ "s2598": "Atualiza o motor deste computador. Seus modelos e configurações são mantidos.",
+ "s2599": "Salvo em {0}",
+ "s2600": "Já tem um modelo compatível neste computador? Escolha a pasta com os arquivos dele. O Strata os verifica, prepara o modelo e o carrega. Nada é copiado ou baixado.",
+ "s2601": "Pasta com os arquivos GGUF",
+ "s2602": "Caminho completo da pasta",
+ "s2603": "Verificar arquivos",
+ "s2604": "Modelo encontrado",
+ "s2605": "{0} arquivos · {1}",
+ "s2606": "Preparar e carregar",
+ "s2607": "Faltam partes deste modelo, ou a pasta contém mais de um modelo.",
+ "s2608": "Coloque todas as partes de um modelo em uma pasta e verifique de novo.",
+ "s2609": "O Strata ainda não consegue executar esses arquivos.",
+ "s2610": "O Strata executa os modelos Qwen3.8-Flash-Next. Baixe um em Modelos ou escolha uma pasta com os arquivos dele.",
+ "s2611": "Não foi possível verificar esses arquivos.",
+ "s2612": "Verifique se a pasta tem arquivos GGUF completos e tente novamente."
}
diff --git a/apps/host/src/locales/ru.json b/apps/host/src/locales/ru.json
index 7690de781..48d528f65 100644
--- a/apps/host/src/locales/ru.json
+++ b/apps/host/src/locales/ru.json
@@ -2594,5 +2594,21 @@
"s2593": "Проверяем ваш компьютер…",
"s2594": "Подготовка…",
"s2595": "Загружаем вашу модель…",
- "s2596": "Готовим вашу модель для Strata…"
+ "s2596": "Готовим вашу модель для Strata…",
+ "s2597": "Обновить компонент",
+ "s2598": "Обновляет движок для этого компьютера. Ваши модели и настройки сохраняются.",
+ "s2599": "Сохранено в {0}",
+ "s2600": "Уже есть поддерживаемая модель на этом компьютере? Выберите папку с её файлами. Strata проверит их, подготовит модель и загрузит её. Ничего не копируется и не скачивается.",
+ "s2601": "Папка с файлами GGUF",
+ "s2602": "Полный путь к папке",
+ "s2603": "Проверить файлы",
+ "s2604": "Модель найдена",
+ "s2605": "Файлов: {0} · {1}",
+ "s2606": "Подготовить и загрузить",
+ "s2607": "Не хватает частей этой модели, либо в папке больше одной модели.",
+ "s2608": "Положите все части одной модели в одну папку и проверьте снова.",
+ "s2609": "Strata пока не может запустить эти файлы.",
+ "s2610": "Strata запускает модели Qwen3.8-Flash-Next. Скачайте одну в разделе «Модели» или выберите папку с её файлами.",
+ "s2611": "Не удалось проверить эти файлы.",
+ "s2612": "Убедитесь, что в папке полные файлы GGUF, и повторите попытку."
}
diff --git a/apps/host/src/locales/zh.json b/apps/host/src/locales/zh.json
index b99805b73..2b799427d 100644
--- a/apps/host/src/locales/zh.json
+++ b/apps/host/src/locales/zh.json
@@ -2594,5 +2594,21 @@
"s2593": "正在检查你的电脑…",
"s2594": "正在做准备…",
"s2595": "正在下载你的模型…",
- "s2596": "正在为 Strata 准备你的模型…"
+ "s2596": "正在为 Strata 准备你的模型…",
+ "s2597": "更新组件",
+ "s2598": "更新这台电脑的引擎。你的模型和设置会保留。",
+ "s2599": "已保存到 {0}",
+ "s2600": "这台电脑上已经有受支持的模型了吗?请选择存放其文件的文件夹。Strata 会检查文件、准备模型并加载它,不会复制或下载任何内容。",
+ "s2601": "存放 GGUF 文件的文件夹",
+ "s2602": "文件夹的完整路径",
+ "s2603": "检查文件",
+ "s2604": "找到模型",
+ "s2605": "{0} 个文件 · {1}",
+ "s2606": "准备并加载",
+ "s2607": "此模型缺少部分文件,或该文件夹里有多个模型。",
+ "s2608": "请把同一个模型的所有文件放在一个文件夹里,然后重新检查。",
+ "s2609": "Strata 暂时无法运行这些文件。",
+ "s2610": "Strata 运行 Qwen3.8-Flash-Next 模型。请在“模型”中下载其中一个,或选择存放其文件的文件夹。",
+ "s2611": "无法检查这些文件。",
+ "s2612": "请确认文件夹里是完整的 GGUF 文件,然后重试。"
}
diff --git a/apps/host/src/screens/Chat.tsx b/apps/host/src/screens/Chat.tsx
index d6253e8e0..8de861de0 100644
--- a/apps/host/src/screens/Chat.tsx
+++ b/apps/host/src/screens/Chat.tsx
@@ -566,7 +566,7 @@ function Message({ message: m, isLast, onEditPrompt, onPreview, onOpenLink, onOp
<div className="st-bubble">
{tr(m.error ? (<ErrorNotice message={m.error} next={tr("Try sending the message again.")}/>) : null)}
- {tr(m.content ? (<Markdown text={m.timeSkipId ? timeSkipDone ? tr('The result is ready. Switch between Original and Updated, or compare them side by side. This example uses sample outputs and simulated checks.') : tr('Revising the saved draft. Follow the result in the sidebar. This example uses sample outputs and simulated checks.') : m.content} onOpenLink={onOpenLink} onPreviewHtml={content => onPreview({ id: m.id + '-html', kind: 'website', title: 'HTML preview', content })}/>) : !m.error ? (<span className="typing" aria-label={tr("Generating")}>
+ {tr(m.content ? (<Markdown text={m.timeSkipId ? timeSkipDone ? tr('The result is ready. Switch between Original and Updated, or compare them side by side. This example uses sample outputs and simulated checks.') : tr('Revising the saved draft. Follow the result in the sidebar. This example uses sample outputs and simulated checks.') : m.content} onOpenLink={onOpenLink} onPreviewHtml={content => onPreview({ id: m.id + '-html', kind: 'website', title: 'HTML preview', content })}/>) : !m.error && m.streaming ? (<span className="typing" aria-label={tr("Generating")}>
<i />
<i />
<i />
diff --git a/apps/host/src/screens/ModelRun.tsx b/apps/host/src/screens/ModelRun.tsx
index fff8429e0..e2566bded 100644
--- a/apps/host/src/screens/ModelRun.tsx
+++ b/apps/host/src/screens/ModelRun.tsx
@@ -23,6 +23,7 @@ import { applyImageModel, getState, lifecycleStatus, loadRuntimeModel, loadVaria
import type { ImageModelChoice, RuntimeModels, RuntimeModel } from '../lib/types';
import { useNative } from '../lib/native';
import { NativeModels } from '../components/NativeModels';
+import { NativeLocalModel } from '../components/NativeLocalModel';
import { parseLocation } from '../lib/router';
type Issue = {
level: 'error' | 'warn';
@@ -33,6 +34,8 @@ export function ModelRunScreen() {
const native = useNative();
const location = parseLocation(window.location.hash), entry = location.param;
const [other, setOther] = useState(entry === 'local' || entry === 'local-import'), [importFirst, setImportFirst] = useState(entry === 'local-import');
+ if (native && other)
+ return <NativeLocalModel onBack={() => { setOther(false); setImportFirst(false); }}/>;
if (native && !other)
return <NativeModels onOtherModels={() => setOther(true)} onImport={() => { setImportFirst(true); setOther(true); }}/>;
return <><LegacyModelRunScreen importFirst={importFirst} initialVariant={location.query.get('variant') ?? undefined}/>{tr(other ? <button className="st-btn native-return" onClick={() => setOther(false)}>{tr("Strata optimized models")}</button> : null)}</>;
diff --git a/apps/host/src/screens/Monitor.tsx b/apps/host/src/screens/Monitor.tsx
index dc9c38234..543c78fb6 100644
--- a/apps/host/src/screens/Monitor.tsx
+++ b/apps/host/src/screens/Monitor.tsx
@@ -15,7 +15,7 @@ import { gpuCapacity, gpuId, gpuMetric, hasReading } from '../lib/monitor-hardwa
import { useStore } from '../lib/store';
import type { Hardware, MonitorState, ServeRequest } from '../lib/types';
import { useNative, nativeRouting, type NativeState } from '../lib/native';
-import { nativeMonitorData } from '../lib/native-monitor';
+import { nativeMonitorData, withHostSensors } from '../lib/native-monitor';
const number = (value: number | null | undefined, digits = 0) => hasReading(value) ? value.toLocaleString(localeTag(), { maximumFractionDigits: digits, minimumFractionDigits: digits }) : '—';
const percent = (used: number | null | undefined, total: number | null | undefined) => hasReading(used) && hasReading(total) && total > 0 ? Math.max(0, Math.min(100, used / total * 100)) : null;
const sourceLabel = (source: string | undefined) => source === 'demo' ? 'Illustrative' : source === 'sensor' || source === 'engine' || source === 'reported' ? 'Measured' : source === 'estimated' ? 'Estimated' : 'Unavailable';
@@ -65,7 +65,7 @@ function LegacyMonitorScreen({ native }: {
const [instanceSelection, setInstanceSelection] = useState('all');
const routing = native ? nativeRouting(native, inventory) : null;
const runtime = routing && native ? { ...routing, instances: routing.instances.map(instance => { const raw = native.instances.find(item => item.id === instance.id)?.metrics?.live; return { ...instance, outputTps: raw?.tok_s ?? NaN, promptTps: raw?.prefill_tok_s_mean ?? NaN, active: raw ? (raw.running ?? (['reading', 'generating'].includes(raw.state) ? 1 : 0)) : NaN, queued: raw?.queued ?? NaN }; }) } : storedRuntime;
- const live = native ? nativeMonitorData(native, inventory, instanceSelection) : storedLive;
+ const live = native ? withHostSensors(nativeMonitorData(native, inventory, instanceSelection), storedLive) : storedLive;
const multipleModels = (runtime?.instances.length ?? 0) > 1;
const selectedInstance = runtime?.instances.find(i => i.id === instanceSelection) ?? (!multipleModels ? runtime?.instances[0] : undefined);
const selection = selectedInstance?.id ?? 'all';
@@ -103,7 +103,8 @@ function LegacyMonitorScreen({ native }: {
const data = frozen?.data ?? scoped, hardware = frozen?.hardware ?? inventory;
if (!data)
return <Screen title={tr("Monitor")}><p className="muted">{tr("Waiting for engine telemetry\u2026")}</p></Screen>;
- const devices = hardware?.gpus ?? [], processors = hardware?.processors?.length ? hardware.processors : hardware ? [{ ...hardware.cpu, id: 'cpu', socket: '' }] : [];
+ // A display adapter that has no sensors and no memory of its own (an integrated one) cannot be measured; counting it would blank every total.
+ const devices = (hardware?.gpus ?? []).filter(g => g.backend !== 'vulkan' || g.vramGb > 0), processors = hardware?.processors?.length ? hardware.processors : hardware ? [{ ...hardware.cpu, id: 'cpu', socket: '' }] : [];
const gpuChoice = gpuSelection === 'assigned' && selectedInstance ? 'assigned' : devices.some(g => gpuId(g) === gpuSelection) ? gpuSelection : 'all';
const cpuChoice = processors.some(p => p.id === cpuSelection) ? cpuSelection : 'all';
const selectedGpus = gpuChoice === 'assigned' ? devices.filter(g => selectedInstance?.gpuIds.includes(gpuId(g))) : gpuChoice === 'all' ? devices : devices.filter(g => gpuId(g) === gpuChoice);
diff --git a/apps/host/src/screens/Settings.tsx b/apps/host/src/screens/Settings.tsx
index 002cd9619..66966c379 100644
--- a/apps/host/src/screens/Settings.tsx
+++ b/apps/host/src/screens/Settings.tsx
@@ -10,7 +10,7 @@ import { NativeOperations } from '../components/NativeOperations';
import { FontChoice } from '../components/FontChoice';
import { LANGUAGES } from '../lib/i18n';
import { setLanguage } from '../lib/store';
-import { CONTENT_FONT_RANGE, go, setContentFontSize, setContrast, setDensity, setFocus, setMotion, setShortcuts, setTheme, setTransparency, setUiScale, UI_SCALES, useStore, setSettingsSection } from '../lib/store';
+import { CONTENT_FONT_RANGE, setContentFontSize, setDensity, setFocus, setMotion, setShortcuts, setTheme, setTransparency, setUiScale, UI_SCALES, useStore, setSettingsSection } from '../lib/store';
const PANELS = [{ name: 'Appearance', icon: 'sun', sections: ['General', 'Reading & focus'] }, { name: 'Models', icon: 'models', sections: [] }, { name: 'Storage', icon: 'disk', sections: ['Storage'] }, { name: 'Engine', icon: 'engine', sections: [] }, { name: 'About', icon: 'info', sections: ['About', 'Update', 'Privacy'] }] as const;
export function SettingsScreen() {
const prefs = useStore(s => s);
@@ -32,9 +32,8 @@ export function SettingsScreen() {
{ section: 'Reading & focus', label: 'Spacing', hint: 'Comfortable spacing by default.', aliases: 'density comfortable compact', control: <Select value={prefs.density} ariaLabel={tr("Interface spacing")} options={[{ value: 'comfortable', label: 'Comfortable' }, { value: 'compact', label: 'Compact' }]} onChange={setDensity}/> },
{ section: 'Reading & focus', label: 'Motion', hint: 'Reduced motion also disables smooth scrolling.', aliases: 'animation system full reduced', control: <Select value={prefs.motion} ariaLabel={tr("Motion")} options={[{ value: 'system', label: 'Follow system' }, { value: 'full', label: 'Full' }, { value: 'reduced', label: 'Reduced' }]} onChange={setMotion}/> },
{ section: 'Reading & focus', label: 'Transparency', hint: 'Translucent controls or solid surfaces. Text stays opaque.', aliases: 'blur glass liquid opaque translucent', control: <Select value={prefs.transparency} ariaLabel={tr("Transparency")} options={[{ value: 'translucent', label: 'Translucent' }, { value: 'opaque', label: 'Opaque' }]} onChange={setTransparency}/> },
- { section: 'Reading & focus', label: 'Contrast', hint: 'Increase text and boundary contrast.', aliases: 'accessibility standard increased', control: <Select value={prefs.contrast} ariaLabel={tr("Contrast")} options={[{ value: 'standard', label: 'Standard / system' }, { value: 'increased', label: 'Increased' }]} onChange={setContrast}/> },
{ section: 'Reading & focus', label: 'Focus reading', hint: 'Hides navigation in chat. Settings stays open above the conversation.', aliases: 'distraction quiet', control: <button className="st-toggle" role="switch" aria-checked={prefs.focus} aria-label={tr("Focus reading")} onClick={() => setFocus(!prefs.focus)}/> },
- { section: 'Privacy', label: 'Collection and logs', hint: 'Strata sends no usage telemetry. Conversations stay in browser storage. When you choose an API model, that conversation and enabled skill instructions are sent to its provider. The UI request log keeps client, timing and token metadata in memory. Native API monitoring can retain request content in memory when enabled. Connected tools access the resources you configure.', aliases: 'telemetry reporting tracking privacy logging requests', control: <Btn size="sm" onClick={() => go('serving')}>{tr("View request log")}</Btn> },
+ { section: 'Privacy', label: 'Collection and logs', hint: 'Strata sends no usage telemetry. Conversations stay in browser storage. When you choose an API model, that conversation and enabled skill instructions are sent to its provider. The UI request log keeps client, timing and token metadata in memory. Native API monitoring can retain request content in memory when enabled. Connected tools access the resources you configure.', aliases: 'telemetry reporting tracking privacy logging requests', control: null },
];
function activate(name: typeof PANELS[number]['name']) {
setSettingsSection(name);
diff --git a/apps/host/src/styles/annotation-fixes.css b/apps/host/src/styles/annotation-fixes.css
index 902c5e7d1..10c6f97f6 100644
--- a/apps/host/src/styles/annotation-fixes.css
+++ b/apps/host/src/styles/annotation-fixes.css
@@ -715,3 +715,15 @@ html[data-motion='reduced'] .task-tree-row[data-leaving] { opacity: 0; }
.native-image-reading input[type=checkbox]:checked:after,.native-gpu-options input[type=checkbox]:checked:after{opacity:1}
.native-image-reading input[type=checkbox]:focus-visible,.native-gpu-options input[type=checkbox]:focus-visible{outline:2px solid var(--st-accent);outline-offset:3px}
.native-image-reading input[type=checkbox]:disabled,.native-gpu-options input[type=checkbox]:disabled{opacity:.5;cursor:default}
+/* Manage models: the downloaded models as a short list. Same surface, line and pill tokens as the settings version rows. */
+.native-manage { display:grid; gap:16px; min-width:min(560px,100%); }
+.native-manage-list { display:grid; gap:10px; }
+.native-manage-row { display:grid; grid-template-columns:minmax(0,1fr) auto auto; align-items:center; gap:14px; padding:14px 16px; border:1px solid var(--st-line); border-radius:var(--st-r-md,12px); background:var(--st-surface); }
+.native-manage-row[data-selected] { border-color:var(--st-accent); background:var(--st-accent-surface); }
+.native-manage-name { display:grid; gap:2px; min-width:0; }
+.native-manage-name strong { font-size:var(--st-fs-md); overflow-wrap:anywhere; }
+.native-manage-name small { color:var(--st-ink-muted); font-size:var(--st-fs-sm); }
+.native-manage-actions { display:flex; gap:8px; }
+.native-manage-empty { padding:24px 8px; text-align:center; }
+.native-manage-foot { padding-top:12px; border-top:1px solid var(--st-line-soft); }
+@media(max-width:600px){ .native-manage-row { grid-template-columns:1fr; } }
diff --git a/apps/host/src/styles/app.css b/apps/host/src/styles/app.css
index 0c7c1f2b7..f939e6db7 100644
--- a/apps/host/src/styles/app.css
+++ b/apps/host/src/styles/app.css
@@ -3902,9 +3902,10 @@ textarea.st-input {
composer, and only while there is something below the fold worth reaching. */
.jumplatest {
position: sticky;
- bottom: 12px;
+ bottom: 16px;
z-index: 3;
- margin: 0 auto;
+ /* clear of the navigation above it where it sits at the top of the transcript, and of the messages beside it */
+ margin: 14px auto 14px;
display: flex;
align-items: center;
gap: 4px;
diff --git a/apps/host/tests/monitor-host-sensors.test.mjs b/apps/host/tests/monitor-host-sensors.test.mjs
new file mode 100644
index 000000000..b47b7fd44
--- /dev/null
+++ b/apps/host/tests/monitor-host-sensors.test.mjs
@@ -0,0 +1,31 @@
+import test from 'node:test';
+import assert from 'node:assert/strict';
+import { build } from 'esbuild';
+
+const built = await build({ stdin: { contents: "export * from './src/lib/native-monitor';", resolveDir: process.cwd() }, bundle: true, write: false, format: 'esm', platform: 'node', loader: { '.json': 'json' } });
+const { withHostSensors } = await import(`data:text/javascript;base64,${Buffer.from(built.outputFiles[0].text).toString('base64')}`);
+
+const none = { id: 'GPU-1', utilizationPct: null, temperatureC: null, memoryUsedGb: null, powerW: null, powerLimitW: null, pcieRxMbs: null };
+const live = { hardware: { gpus: [none], gpuLoad: NaN, vramUsedGb: NaN, vramTotalGb: 11.9, gpuTempC: NaN, powerW: NaN, powerLimitW: NaN, pcieRxMbs: NaN, cpuLoad: 20 } };
+const host = { hardware: { gpus: [{ id: 'GPU-1', utilizationPct: 7, temperatureC: 41, memoryUsedGb: 0.9, powerW: 22, powerLimitW: 250, pcieRxMbs: 3 }], gpuLoad: 7, vramUsedGb: 0.9, vramTotalGb: 11.9, gpuTempC: 41, powerW: 22, powerLimitW: 250, pcieRxMbs: 3 } };
+
+test('with no model loaded the GPU temperature, load, VRAM, power and PCIe come from the host sensors', () => {
+ const out = withHostSensors(live, host);
+ assert.equal(out.hardware.gpus[0].temperatureC, 41);
+ assert.equal(out.hardware.gpus[0].memoryUsedGb, 0.9);
+ assert.equal(out.hardware.gpuLoad, 7);
+ assert.equal(out.hardware.powerW, 22);
+ assert.equal(out.hardware.pcieRxMbs, 3);
+ assert.equal(out.hardware.cpuLoad, 20, 'what the engine reported is kept');
+});
+
+test('what a running engine reports wins over the host sensors', () => {
+ const running = { hardware: { ...live.hardware, gpus: [{ ...none, temperatureC: 55, utilizationPct: 90 }], gpuTempC: 55, gpuLoad: 90 } };
+ const out = withHostSensors(running, host);
+ assert.equal(out.hardware.gpus[0].temperatureC, 55);
+ assert.equal(out.hardware.gpuLoad, 90);
+});
+
+test('no host monitor, no change', () => {
+ assert.equal(withHostSensors(live, null), live);
+});
diff --git a/apps/host/tests/packaged-control.test.mjs b/apps/host/tests/packaged-control.test.mjs
index f4dd41b63..b29e00107 100644
--- a/apps/host/tests/packaged-control.test.mjs
+++ b/apps/host/tests/packaged-control.test.mjs
@@ -107,6 +107,7 @@ function packagedFixture({ engineUsable = true } = {}) {
? { usable: true, backend: 'cuda', components_dir: 'E:\\c', engine: { version: '0.1.45', platform: 'windows-x86_64', backend: 'cuda', exe: 'E:\\engine\\strata.exe', root: 'E:\\engine' } }
: { usable: false, notice: 'No engine for this PC was found in E:\\c: the component folder holds no engine package. The app never downloads an engine while it starts or serves.', backend: 'cuda', engine: null, components_dir: 'E:\\c' };
},
+ async importPlan(path) { calls.push(['importPlan', path]); return { file_set_status: 'plausible', candidate_selection: { family: 'qwen', model: 'IQ3_S' }, file_count: 2, total_bytes: 1e9, issues: [] }; },
async saveProfile(name, path) { calls.push(['saveProfile', name, basename(path)]); return {}; },
async start(name, options) { calls.push(['start', name, options?.waitSeconds]); if (startFailure) { const e = new Error(startFailure.message); e.output = startFailure.output; throw e; } return { ok: true, state: 'ready' }; },
async stop(name) { calls.push(['stop', name]); return { ok: true, state: 'stopped' }; },
@@ -349,3 +350,16 @@ test('packaged: deleting a downloaded model unloads it first, then the installer
assert.equal(bad.state, 'error', 'an id that is not an installed model is refused');
} finally { await f.native.close(); f.cleanup(); }
});
+
+test('packaged: a local GGUF folder is checked by Control, then installed from where it is (no download)', async () => {
+ const f = packagedFixture();
+ try {
+ await f.native.refresh(true);
+ const preview = await f.native.localPreview('D:/models/iq3s');
+ assert.equal(preview.candidate_selection.model, 'IQ3_S');
+ assert.deepEqual(f.calls.find(c => c[0] === 'importPlan'), ['importPlan', 'D:/models/iq3s']);
+ await assert.rejects(() => f.native.localPreview(' '), /Choose a folder/);
+ await f.native.plan({ family: 'qwen', model: 'IQ3_S', gguf_dir: 'D:/models/iq3s' });
+ assert.equal(f.rpc.at(-1).arguments.gguf_dir, 'D:/models/iq3s');
+ } finally { await f.native.close(); f.cleanup(); }
+});
diff --git a/tests/desktop/test_control_install.py b/tests/desktop/test_control_install.py
index 5a251ec9e..9b24bd102 100644
--- a/tests/desktop/test_control_install.py
+++ b/tests/desktop/test_control_install.py
@@ -350,3 +350,23 @@ class DeleteModelTests(unittest.TestCase):
self.assertTrue(outside.is_file())
described = self.s.describe_config(self.root / "strata-iq3_s.json")
self.assertGreater(described["disk_bytes"], 10000)
+
+
+class LocalGgufInstallTests(unittest.TestCase):
+ def test_a_plan_from_a_local_folder_adopts_the_files_and_needs_no_download_space(self):
+ with tempfile.TemporaryDirectory() as tmp:
+ root = Path(tmp) / "install"
+ root.mkdir()
+ local = Path(tmp) / "mine"
+ local.mkdir()
+ spec = importlib.util.spec_from_file_location("strata_mcp_for_local", ROOT / "tools" / "strata_mcp.py")
+ mcp = importlib.util.module_from_spec(spec)
+ with mock.patch.dict(os.environ, {"STRATA_CONTROL_INSTALL": "1", "STRATA_INSTALL_DIR": str(root)}):
+ spec.loader.exec_module(mcp)
+ tools = mcp.Tools(mcp.Strata(root, ROOT))
+ plan, args = tools.install_plan("qwen", "IQ3_S", 32768, "no", None, None, None, None, None, None, None, str(local))
+ self.assertIn("--gguf-dir", args)
+ self.assertEqual(args[args.index("--gguf-dir") + 1], str(local))
+ self.assertLessEqual(plan["disk_needed_gb"], 9) # the 8 GB for preparing, not the download
+ with self.assertRaises(mcp.ToolError):
+ tools.install_plan("qwen", "IQ3_S", 32768, "no", None, None, None, None, None, None, None, str(local / "missing"))
diff --git a/tools/strata_mcp.py b/tools/strata_mcp.py
index 476e932a1..4e5a4bd61 100644
--- a/tools/strata_mcp.py
+++ b/tools/strata_mcp.py
@@ -1123,6 +1123,9 @@ def tool_defs(models: dict, families: dict, contexts: list) -> list:
"Strata folder). Only the current data folder, a folder inside the Strata "
"folder, or a new absolute path whose last folder is named Strata... "
"(e.g. D:\\Strata-data) outside system folders"},
+ "gguf_dir": {"type": "string", "maxLength": 260,
+ "description": "a folder that already holds this model's GGUF files under their original names: setup "
+ "checks them (size and SHA-256) and does not download them again"},
"confirm": {"type": "boolean", "description": "true = really start the install (after the user agreed "
"to the plan and the download size)"},
"cancel": {"type": "boolean", "description": "true = stop the install in progress"}}},
@@ -1325,7 +1328,8 @@ class Tools:
return p
def strata_install(self, family=None, model=None, context=None, vision=None, kv=None, gpu=None, gpus=None,
- backend=None, low_ram=None, port=None, data_dir=None, confirm=False, cancel=False) -> dict:
+ backend=None, low_ram=None, port=None, data_dir=None, confirm=False, cancel=False,
+ gguf_dir=None) -> dict:
s = self.s
with s.lock:
job = s.install_job()
@@ -1356,7 +1360,7 @@ class Tools:
"fix the problem above and call strata_install again with confirm=true (finished "
"steps are skipped)"}
plan, args = self.install_plan(family, model, context, vision, kv, gpu, gpus, backend, low_ram, port,
- data_dir)
+ data_dir, gguf_dir)
tracked = s.tracked_server()
if tracked and not tracked.get("ended"):
raise ToolError("Strata is running (started by strata_start): stop it first with strata_stop - setup "
@@ -1370,7 +1374,7 @@ class Tools:
raise ToolError(plan["disk_short"])
return self.launch_install(plan, args)
- def install_plan(self, family, model, context, vision, kv, gpu, gpus, backend, low_ram, port, data_dir):
+ def install_plan(self, family, model, context, vision, kv, gpu, gpus, backend, low_ram, port, data_dir, gguf_dir=None):
s = self.s
models, families, contexts, _src = s.tables()
if gpu is not None and gpus is not None:
@@ -1420,7 +1424,7 @@ class Tools:
target = self.check_data_dir(data_dir) if data_dir else s.data_dir()
tag = (families[family].get("tag", "") + model)
have_dir = target / "models" / tag
- partly = have_dir.is_dir() and any(have_dir.glob("*.gguf*"))
+ partly = (have_dir.is_dir() and any(have_dir.glob("*.gguf*"))) or bool(gguf_dir) # a local folder: nothing to download
need = (8 if partly else models[model]["download_gb"] + 8) + (1 if vision in ("yes", "gpu", "cpu") else 0)
free = s.disk_free(target)
short = None
@@ -1435,6 +1439,11 @@ class Tools:
("--data-dir", str(target) if data_dir else None)):
if v is not None:
args += [flag, str(v)]
+ if gguf_dir:
+ local = Path(os.path.expandvars(gguf_dir)).expanduser()
+ if not local.is_absolute() or not local.is_dir() or ".." in local.parts:
+ raise ToolError("gguf_dir must be an existing absolute folder")
+ args += ["--gguf-dir", str(local)]
if backend in ("cuda", "hip"):
args += ["--backend", backend]
fit = None