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++
Round 8: compact segmented Computer use, version chevron and panel gap, download details only when useful, immediate download progress, Models screens no longer follow every monitor tick
Niko1221850987084946
diff --git a/apps/host/server/engine-step.mjs b/apps/host/server/engine-step.mjsindex fa40d0e6b..da7742474 100644--- a/apps/host/server/engine-step.mjs+++ b/apps/host/server/engine-step.mjs@@ -32,7 +32,7 @@ export function createEngineStep({ control, signal = null, onChange = () => {} }try {report = await control.updateCheck();} catch (error) {- if (usable) { set({ state: 'skipped', message: 'The engine for this PC is installed.', details: 'The update server could not be reached, so a newer engine was not looked for.' }); return { ...part }; }+ if (usable) { set({ state: 'skipped', message: 'The engine for this PC is installed.' }); return { ...part }; }throw error;}const engine = report.engine ?? {};diff --git a/apps/host/src/components/ChatModelPicker.tsx b/apps/host/src/components/ChatModelPicker.tsxindex eb0eeb4b5..bc759c035 100644--- a/apps/host/src/components/ChatModelPicker.tsx+++ b/apps/host/src/components/ChatModelPicker.tsx@@ -3,7 +3,7 @@ import { modelFamilyIcon } from '../lib/model-icons';import { useId, useRef, useState } from 'react';import { FloatingMenu } from './FloatingMenu';import { Bar, Btn, Dialog, ErrorNotice, Icon } from './ui';-import { go, lifecycleStatus, loadVariant, selectRemoteModel, setSettingsSection, useStore } from '../lib/store';+import { go, useLifecycle, loadVariant, selectRemoteModel, setSettingsSection, useStore } from '../lib/store';import { pickerGroups, pickerVersionState } from '../lib/model-picker';import { versionFit } from '../lib/model-versions';import type { ModelVariant } from '../lib/types';@@ -28,7 +28,7 @@ function LegacyChatModelPicker() {const providers = useStore(s => s.providers), remote = useStore(s => s.remoteModel), streaming = useStore(s => s.streaming);const connection = providers?.connections.find(c => c.id === remote?.connectionId);const apiModel = connection?.models.find(m => m.id === remote?.modelId);- const lifecycle = lifecycleStatus(useStore(s => s));+ const lifecycle = useLifecycle();const [open, setOpen] = useState(false), [selected, setSelected] = useState<string | null>(null);const [pending, setPending] = useState(false), [error, setError] = useState('');const [expanded, setExpanded] = useState<string[]>([]);diff --git a/apps/host/src/components/FloatingMenu.tsx b/apps/host/src/components/FloatingMenu.tsxindex ac6fcb3f4..ab9034353 100644--- a/apps/host/src/components/FloatingMenu.tsx+++ b/apps/host/src/components/FloatingMenu.tsx@@ -14,7 +14,7 @@ export function FloatingMenu({ anchor, title, onClose, children, width = 232 }:const rect = anchor?.getBoundingClientRect();const height = ref.current?.getBoundingClientRect().height ?? 200;const left = Math.max(12, Math.min(rect?.left ?? 12, window.innerWidth - Math.min(width, window.innerWidth - 24) - 12));- const below = rect?.bottom ?? 12;+ const below = (rect?.bottom ?? 12) + 8; // a little air between the button and its panelconst top = below + height + 12 <= window.innerHeight ? below : Math.max(12, (rect?.top ?? window.innerHeight) - height - 6);setPlaced({ left, top });ref.current?.querySelector<HTMLElement>('[role="menuitem"]:not(:disabled), [role="menuitemradio"]:not(:disabled)')?.focus();diff --git a/apps/host/src/components/LifecycleNotice.tsx b/apps/host/src/components/LifecycleNotice.tsxindex aa4cdcd1c..30bd19c29 100644--- a/apps/host/src/components/LifecycleNotice.tsx+++ b/apps/host/src/components/LifecycleNotice.tsx@@ -1,10 +1,10 @@import { tr } from '../lib/i18n';-import { go, lifecycleStatus, useStore } from '../lib/store';+import { go, useLifecycle } from '../lib/store';import { Btn } from './ui';export function LifecycleNotice({ showScope = true }: {showScope?: boolean;}) {- const status = lifecycleStatus(useStore(s => s));+ const status = useLifecycle();if (!showScope && status.allowed)return null;return <div className="lifecycle-notice small muted">{tr(showScope ? <span>{tr("Global \u00B7 all chats")}</span> : null)}{tr(!status.allowed ? <><span role="status">{tr(status.reason)}</span><Btn size="sm" variant="ghost" onClick={() => go('serving')}>{tr("View requests")}</Btn></> : null)}</div>;diff --git a/apps/host/src/components/ManagedModelLibrary.tsx b/apps/host/src/components/ManagedModelLibrary.tsxindex ecedf0b28..5f69013df 100644--- a/apps/host/src/components/ManagedModelLibrary.tsx+++ b/apps/host/src/components/ManagedModelLibrary.tsx@@ -10,7 +10,7 @@ import { familyVersion, modelFamilies, modelVersions, versionFit } from '../lib/import { contextTokens, estimate, execution } from '../lib/experience';import { planMemory } from '../lib/run-memory';import type { ModelVariant } from '../lib/types';-import { cancelInstall, installVariant, lifecycleStatus, loadVariant, removeVariant, runtimeModelAction, useStore } from '../lib/store';+import { cancelInstall, installVariant, useLifecycle, loadVariant, removeVariant, runtimeModelAction, useStore } from '../lib/store';export function ManagedModelLibrary({ contextOverride, familyOverride, selectedVariant, onChoose }: {contextOverride?: number;familyOverride?: string;@@ -19,7 +19,7 @@ export function ManagedModelLibrary({ contextOverride, familyOverride, selectedV}) {const library = useStore(s => s.library), hardware = useStore(s => s.hardware), engine = useStore(s => s.engine);const runtime = useStore(s => s.runtime), serving = useStore(s => s.serving);- const lifecycle = lifecycleStatus(useStore(s => s));+ const lifecycle = useLifecycle();const [selected, setSelected] = useState(selectedVariant ?? '');const [familyChoice, setFamilyChoice] = useState(familyOverride ?? '');const [pending, setPending] = useState(false), [error, setError] = useState('');diff --git a/apps/host/src/components/NativeModels.tsx b/apps/host/src/components/NativeModels.tsxindex daddadb08..a8d6c9a12 100644--- a/apps/host/src/components/NativeModels.tsx+++ b/apps/host/src/components/NativeModels.tsx@@ -171,4 +171,4 @@ catch (e) {}finally {setStopping(false);-} } return <section className="st-card native-progress" aria-live="polite"><div className="section-toolbar"><h2 className="h4">{tr(job.kind === 'install' ? 'Preparing your model' : job.kind === 'load' ? 'Loading model' : job.kind === 'autotune' || job.kind === 'recheck' ? 'Tuning your model' : 'Engine operation')}</h2>{tr(job.kind === 'install' || job.kind === 'load' || job.kind === 'autotune' || job.kind === 'recheck' ? <div className="onboard-progress-actions">{tr(eta ? <span className="small muted">{eta}</span> : null)}<Btn size="sm" disabled={stopping} onClick={() => void stop()}>{tr(stopping ? 'Stopping…' : 'Stop')}</Btn></div> : null)}</div><p className="small">{tr(job.kind === 'install' ? installStepLabel(job.result?.install?.step) : job.summary)}</p>{tr(download ? <><progress max={100} value={download.percent ?? 0}/><p className="xs muted">{tr(download.file === 'model files' ? 'Model files' : download.file)} · {tr(download.percent ?? 0)}%{tr(Number.isFinite(download.done_gb) && Number.isFinite(download.total_gb) ? ` · ${download.done_gb!.toFixed(1)} / ${download.total_gb!.toFixed(1)} GB` : '')}</p></> : null)}<details><summary className="small">{tr("Details")}</summary><p className="small muted">{tr("Completed files are retained. Downloading, packing and loading are separate stages; readiness is confirmed by the engine.")}</p>{tr(detailsText ? <pre className="small muted error-detail-text">{detailsText}</pre> : null)}</details>{tr(error ? <ErrorNotice message={error}/> : null)}</section>; }+} } return <section className="st-card native-progress" aria-live="polite"><div className="section-toolbar"><h2 className="h4">{tr(job.kind === 'install' ? 'Preparing your model' : job.kind === 'load' ? 'Loading model' : job.kind === 'autotune' || job.kind === 'recheck' ? 'Tuning your model' : 'Engine operation')}</h2>{tr(job.kind === 'install' || job.kind === 'load' || job.kind === 'autotune' || job.kind === 'recheck' ? <div className="onboard-progress-actions">{tr(eta ? <span className="small muted">{eta}</span> : null)}<Btn size="sm" disabled={stopping} onClick={() => void stop()}>{tr(stopping ? 'Stopping…' : 'Stop')}</Btn></div> : null)}</div><p className="small">{tr(job.kind === 'install' ? installStepLabel(job.result?.install?.step) : job.summary)}</p>{tr(download ? <><progress max={100} value={download.percent ?? 0}/><p className="xs muted">{tr(download.file === 'model files' ? 'Model files' : download.file)} · {tr(download.percent ?? 0)}%{tr(Number.isFinite(download.done_gb) && Number.isFinite(download.total_gb) ? ` · ${download.done_gb!.toFixed(1)} / ${download.total_gb!.toFixed(1)} GB` : '')}</p></> : null)}{tr(detailsText ? <details><summary className="small">{tr("Details")}</summary><pre className="small muted error-detail-text">{detailsText}</pre></details> : null)}{tr(error ? <ErrorNotice message={error}/> : null)}</section>; }diff --git a/apps/host/src/components/VersionPicker.tsx b/apps/host/src/components/VersionPicker.tsxindex 03939dc86..b173a737f 100644--- a/apps/host/src/components/VersionPicker.tsx+++ b/apps/host/src/components/VersionPicker.tsx@@ -55,7 +55,7 @@ export function VersionPicker({ versions, selectedId, hardware, onSelect, onOwnG<button ref={trigger} type="button" className="version-trigger" aria-haspopup="menu" aria-expanded={open} aria-label={tr("Model version")} onClick={() => setOpen(v => !v)}><strong>{selected ? versionName(selected, true) : tr("Choose a version")}</strong><span className="version-trigger__need muted">{tr(fit ? `${gb(fit.memoryGb)} RAM + VRAM` : '')}</span>- <Icon name="chevron" size={14}/>+ <Icon name="chevron" size={14} className="version-trigger__chev"/></button>{tr(open ? <FloatingMenu anchor={trigger.current} title={tr("Model version")} width={620} onClose={() => setOpen(false)}><div className="version-menu">diff --git a/apps/host/src/lib/native.ts b/apps/host/src/lib/native.tsindex 521c68f75..fdff0c0e5 100644--- a/apps/host/src/lib/native.ts+++ b/apps/host/src/lib/native.ts@@ -9,7 +9,9 @@ export interface NativeInstance {id:string;apiModelId:string;model:string;label:export interface NativeState {available:boolean;repo:string;downloadDirectory?:string;version?:string|null;summary:string;error:string|null;catalog:{families:NativeFamily[];contexts:number[];recommendation:{family:string|null;model:string|null;context?:number;why?:string};context_note:string}|null;installed:{models:{model:string;config:string;model_name:string;ready:boolean;context?:number;kv?:string;images?:string;visionEnabled?:boolean;visionDevice?:string;lowRamMode?:string;resourceProfile?:'work'|'performance';dataFolder?:string;diskGb?:number;diskBytes?:number;missing_files?:string[]}[];data_folder:string;engine:{version:string|null}}|null;hardware:{ram_gb:number;gpus:{index:number;name:string;vram_gb:number;usable:boolean}[]}|null;fields:NativeField[];instances:NativeInstance[];defaultId:string|null;jobs:NativeJob[];capabilities:{responses?:boolean;updates:boolean;rollback:boolean;calibration:boolean;componentUpdates?:boolean}}let state:NativeState|null=null,timer:ReturnType<typeof setInterval>|null=null,reading:Promise<void>|null=null;const listeners=new Set<()=>void>();-export function refreshNative(force=false){if(reading)return reading;reading=api.get<NativeState>(`/api/native${force?'?refresh=1':''}`).then(value=>{state=value;listeners.forEach(fn=>fn());}).catch(error=>{if(state){state={...state,error:error.message,instances:state.instances.map(i=>({...i,metrics:null,phase:'unavailable'}))};listeners.forEach(fn=>fn());}}).finally(()=>{reading=null;});return reading;}+let again=false;+/** A forced refresh (after an action) never joins a read that began before the action: that read cannot know about the new job. It waits for it, then reads again. */+export function refreshNative(force=false):Promise<void>{if(reading){if(!force)return reading;if(again)return reading;again=true;return reading.then(()=>{again=false;return refreshNative(true);});}reading=api.get<NativeState>(`/api/native${force?'?refresh=1':''}`).then(value=>{if(state&&JSON.stringify(state)===JSON.stringify(value))return;state=value;listeners.forEach(fn=>fn());}).catch(error=>{if(state){state={...state,error:error.message,instances:state.instances.map(i=>({...i,metrics:null,phase:'unavailable'}))};listeners.forEach(fn=>fn());}}).finally(()=>{reading=null;});return reading;}export function useNative(){const value=useSyncExternalStore(fn=>{listeners.add(fn);return()=>listeners.delete(fn);},()=>state);useEffect(()=>{void refreshNative();if(!timer)timer=setInterval(()=>void refreshNative(),2500);return()=>{if(!listeners.size&&timer){clearInterval(timer);timer=null;}};},[]);return value;}export const nativeState=()=>state;/** Connection-list projection only; memory reservations are not inferred. */@@ -17,6 +19,10 @@ export function nativeRouting(native:NativeState|null,hardware:Hardware|null):Ruif(!native?.instances.length)return null;return {revision:Date.now(),mode:'real',capabilities:{multipleModels:true,deviceAssignment:true},defaultId:native.defaultId,instances:native.instances.filter(i=>i.status==='ready').map(i=>({id:i.id,apiModelId:i.apiModelId,variantId:i.model,family:i.label,name:i.model,quant:i.model,loadedAt:i.loadedAt,status:'ready',phase:i.phase as RuntimeModels['instances'][number]['phase'],active:i.metrics?.live?.running??0,queued:i.metrics?.live?.queued??0,prompt:{done:0,total:0,pct:0},outputTps:i.metrics?.live?.tok_s??0,promptTps:i.metrics?.live?.prefill_tok_s_mean??0,context:{usedTokens:0,maxTokens:i.metrics?.engine?.max_context??i.context??0,pct:0},gpuIds:i.gpus.map(index=>{const g=hardware?.gpus.find(g=>g.index===index);return g?.id??`${g?.vendor??'native'}:${index}`;}),memory:{context:i.metrics?.engine?.max_context??i.context??0,ramGb:0,gpuGb:0,spillGb:0,reserveGb:0,totalGb:0,devices:[]}})),memory:{ramGb:0,budgetGb:0,reserveGb:0,totalGb:0,fits:true,devices:[]}};}-export async function nativeAction<T=unknown>(path:string,body:unknown={}){const result=await api.post<T>(`/api/native/${path}`,body);await refreshNative(true);return result;}+export async function nativeAction<T=unknown>(path:string,body:unknown={}){const result=await api.post<T>(`/api/native/${path}`,body);+ // A started operation is a job: show it at once instead of waiting for the next read (the owner saw download progress only after switching tabs).+ const job=result as unknown as NativeJob|undefined;+ if(state&&job&&typeof job.id==='string'&&path==='operations'&&!state.jobs.some(j=>j.id===job.id)){state={...state,jobs:[...state.jobs,job]};listeners.forEach(fn=>fn());}+ await refreshNative(true);return result;}export {nativeVersionLabel} from './native-catalog';diff --git a/apps/host/src/lib/store.ts b/apps/host/src/lib/store.tsindex afec584ab..aa0895931 100644--- a/apps/host/src/lib/store.ts+++ b/apps/host/src/lib/store.ts@@ -324,6 +324,14 @@ function libraryResponse(data: ModelLibrary): ModelLibrary {export function lifecycleStatus(s = state) {return lifecyclePolicy({ connected: s.connection === 'live', streaming: !!s.streaming || s.liveChats > 0, stats: s.serving?.stats, busy: s.busy });}+/** The lifecycle status without subscribing to the whole store: a screen that only needs this must not redraw on every monitor tick (round 8, item 13). */+export function useLifecycle() {+ const connected = useStore(s => s.connection === 'live');+ const streaming = useStore(s => !!s.streaming || s.liveChats > 0);+ const stats = useStore(s => s.serving?.stats);+ const busy = useStore(s => s.busy);+ return lifecyclePolicy({ connected, streaming, stats, busy });+}export function lifecycleAvailable(): boolean {const result = lifecycleStatus();if (!result.allowed) pushToast('warn', 'Model change unavailable', result.reason);diff --git a/apps/host/src/screens/ModelRun.tsx b/apps/host/src/screens/ModelRun.tsxindex 904196ec6..a4d8bc31f 100644--- a/apps/host/src/screens/ModelRun.tsx+++ b/apps/host/src/screens/ModelRun.tsx@@ -19,7 +19,7 @@ import { computerIdentity, configIdentity, defaultProfileKey, emptyProfiles, reaimport { modelFamilyIcon } from '../lib/model-icons';import { familyVersion, modelFamilies } from '../lib/model-versions';import { sizeGb } from '../lib/format';-import { applyImageModel, getState, lifecycleStatus, loadRuntimeModel, loadVariant, pushToast, restartEngine, saveEngine, selectImageModel, setConfigDraft, useStore, validateEngine } from '../lib/store';+import { applyImageModel, getState, useLifecycle, loadRuntimeModel, loadVariant, pushToast, restartEngine, saveEngine, selectImageModel, setConfigDraft, useStore, validateEngine } from '../lib/store';import type { ImageModelChoice, RuntimeModels, RuntimeModel } from '../lib/types';import { useNative } from '../lib/native';import { NativeModels } from '../components/NativeModels';@@ -55,7 +55,7 @@ function LegacyModelRunScreen({ importFirst = false, initialVariant }: {const imageNeedsDownload = imageChoice !== 'off' && imageVersion?.state !== 'installed';const imageUnavailable = imageChoice !== 'off' && !imageModels?.generationAvailable;const rawDraft = useStore(s => s.configDraft), connected = useStore(s => s.connection === 'live');- const lifecycle = lifecycleStatus(useStore(s => s));+ const lifecycle = useLifecycle();const [selected, setSelected] = useState(() => {if (initialVariant)return initialVariant;diff --git a/apps/host/src/screens/Models.tsx b/apps/host/src/screens/Models.tsxindex 87573dfeb..fc4669f94 100644--- a/apps/host/src/screens/Models.tsx+++ b/apps/host/src/screens/Models.tsx@@ -11,7 +11,7 @@ import { contextTokens, estimate, execution } from '../lib/experience';import { planMemory } from '../lib/run-memory';import { useMedia } from '../lib/responsive';import { formatModelName, sizeGb } from '../lib/format';-import { cancelInstall, go, installVariant, loadVariant, removeVariant, unloadModel, useStore, lifecycleStatus } from '../lib/store';+import { cancelInstall, go, installVariant, loadVariant, removeVariant, unloadModel, useStore, useLifecycle } from '../lib/store';export function ModelsScreen({ embedded = false, ...props }: {embedded?: boolean;contextOverride?: number;@@ -28,7 +28,7 @@ function ModelLibraryScreen({ embedded = false, contextOverride, onChoose }: {} = {}) {const inlineDetails = useMedia('(max-width: 850px)');const library = useStore(s => s.library), hardware = useStore(s => s.hardware), engine = useStore(s => s.engine);- const lifecycle = lifecycleStatus(useStore(s => s));+ const lifecycle = useLifecycle();const [selected, setSelected] = useState(''), [selectedFamily, setSelectedFamily] = useState(''), [confirm, setConfirm] = useState<'switch' | 'delete' | null>(null), [pending, setPending] = useState(false), [error, setError] = useState('');if (!library)return <Screen title={tr("Model")}><p>{tr("Loading model versions\u2026")}</p></Screen>;diff --git a/apps/host/src/screens/Tuning.tsx b/apps/host/src/screens/Tuning.tsxindex fb984f012..f76cba860 100644--- a/apps/host/src/screens/Tuning.tsx+++ b/apps/host/src/screens/Tuning.tsx@@ -10,7 +10,7 @@ import type { Workload } from '../lib/experience';import { ActionError, Btn, Dialog, ErrorNotice, Icon, Select } from '../components/ui';import { Screen, SectionHead } from '../components/layout';import { configDocument, configPatch, draftParams, readConfig, type ConfigDocument } from '../lib/config';-import { useStore, setConfigDraft, saveEngine, restartEngine, validateEngine, pushToast, lifecycleAvailable, lifecycleStatus } from '../lib/store';+import { useStore, setConfigDraft, saveEngine, restartEngine, validateEngine, pushToast, lifecycleAvailable, useLifecycle } from '../lib/store';import type { BeginnerConfig, EngineConfig, ExpertParam } from '../lib/types';type Issue = {level: 'warn' | 'error';@@ -35,7 +35,7 @@ export function TuningScreen() {const [changedOnly, setChangedOnly] = useState(false);const [descriptions, setDescriptions] = useState(false);const [moreOpen, setMoreOpen] = useState(false);- const lifecycle = lifecycleStatus(useStore(s => s));+ const lifecycle = useLifecycle();const [issues, setIssues] = useState<Issue[]>([]);const [preview, setPreview] = useState<EngineConfig['predicted'] | null>(null);const [pending, setPending] = useState(false);diff --git a/apps/host/src/styles/app.css b/apps/host/src/styles/app.cssindex c7952d366..1fb56acf6 100644--- a/apps/host/src/styles/app.css+++ b/apps/host/src/styles/app.css@@ -7374,3 +7374,16 @@ textarea {.privacy-notes { padding: 2px 4px; }.plan__step[data-state="skipped"] { color: var(--st-ink-muted); text-decoration: line-through; }.plan__step[data-state="skipped"] .plan__text small { text-decoration: none; }++/* Computer use: one compact segmented control on a single line (round 8, item 2) */+.native-choice__col .native-resource-choice { display: inline-flex; align-self: flex-start; gap: 2px; padding: 3px; border: 1px solid var(--st-line); border-radius: 10px; background: var(--st-surface-2); max-width: 100%; }+.native-choice__col .native-resource-choice button { min-height: 0; height: 30px; padding: 0 14px; border: 0; border-radius: 8px; background: transparent; box-shadow: none; display: inline-flex; align-items: center; justify-content: center; white-space: nowrap; font-size: var(--st-fs-sm); color: var(--st-ink-soft); }+.native-choice__col .native-resource-choice button strong { font-weight: 600; font-size: inherit; }+.native-choice__col .native-resource-choice button > svg, .native-choice__col .native-resource-choice button > span + svg { display: none; }+.native-choice__col .native-resource-choice button[data-selected="true"] { background: var(--st-surface); color: var(--st-ink); box-shadow: var(--st-sh-card); }+.native-choice__col .native-resource-choice button:focus-visible { outline: 2px solid var(--st-accent); outline-offset: 1px; }++/* the version dropdown's chevron turns when it opens (round 8, item 7) */+.version-trigger__chev { transform: rotate(90deg); transition: transform var(--st-t-local, 160ms) var(--st-ease-in-out, ease); }+.version-trigger[aria-expanded="true"] .version-trigger__chev { transform: rotate(-90deg); }+@media (prefers-reduced-motion: reduce) { .version-trigger__chev { transition: none; } }