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++
exec((__import__('pathlib').Path(__file__).parent/'apply-shared.py').read_text().split("append('src/lib/format.ts'")[0])
p=root/'src/screens/Tuning.tsx';s=p.read_text();s=s.replace("import { ModelPicker, ModelAction } from '../components/ModelCatalog';", "import { formatModelName } from '../lib/format';\nimport { AutoTune } from '../components/AutoTune';")
s=s.replace('DemoTest, PerformancePreview, TuningDials','DemoTest, PerformancePreview')
s=s.replace("import type { ModelVariant } from '../lib/types';\n",'');s=s.replace('ActionError, Btn, Dialog, Field, Icon, Seg, Select','ActionError, Btn, Dialog, ErrorNotice, Icon, Select');s=s.replace('useStore, setConfigDraft','go, useStore, setConfigDraft');s=s.replace(" const [pickerOpen, setPickerOpen] = useState(false);\n const [picked, setPicked] = useState<ModelVariant | null>(null);", " const [tuneOpen,setTuneOpen]=useState(false);\n const [unsupported,setUnsupported]=useState(false);")
start=s.index('const PRIORITIES');end=s.index('type Issue',start);s=s[:start]+s[end:]
s=s.replace('const dirty = rawDraft !== null;', 'const dirty = rawDraft !== null && (!doc || JSON.stringify(doc)!==JSON.stringify(saved));')
s=s.replace("const rows = params.filter(p =>", "const rows = params.filter(p => p.id!=='server.host' && (unsupported || !!p.applies&&!p.applies.startsWith('Preserved'))).filter(p =>")
s=s.replace("v.id === engine?.variantId", "v.id === library?.loaded")
start=s.index(' function changeBeginner');end=s.index(' function changeParam',start);s=s[:start]+s[end:]
s=s.replace(" const batchSupported = !!engine.expert.find(p => p.id === 'perf.batch' && p.applies === 'Next model load');\n",'')
s=s.replace("sub={current ? `${current.family} · ${current.quant}` : 'Choose a model to explore its setup.'} actions={<Btn onClick={() => setPickerOpen(true)}>Change model</Btn>}", "sub={formatModelName(current)} actions={<><Btn size=\"sm\" onClick={()=>go('models')}>Model version</Btn><button className=\"st-btn st-btn--secondary\" aria-pressed={mode==='expert'} onClick={()=>setMode(mode==='expert'?'beginner':'expert')}>Expert mode</button></>}")
start=s.index(' <div className="section-toolbar">');end=s.index(' <ActionError />',start)
s=s[:start]+''' <div className="section-toolbar"><span className="small muted">{dirty?'Unsaved changes':engine.dirty?'Saved for next load':'Saved settings'}</span><div className="row"><Btn size="sm" disabled={!doc} onClick={resetDraft}>Reset to recommended</Btn><Btn size="sm" disabled={!doc} onClick={()=>setTestOpen(true)}>Run speed test</Btn></div></div>
'''+s[end:]
start=s.index(' {mode === \'beginner\'');end=s.index(' <details className="disclosure"><summary>Expected experience',start)
s=s[:start]+''' {mode === 'beginner' && doc ? <div className="instrument-layout">
<section className="instrument-controls simple-engine"><div className="auto-tune-card"><Icon name="gauge" size={28}/><h2 className="h3">Make the most of this computer</h2><p className="small muted">Find a starting point for your hardware, then review before saving.</p><Btn variant="primary" disabled={!hardware||!current} onClick={()=>setTuneOpen(true)}>Auto-tune for my PC</Btn></div>
<section><h2 className="h4">What are you working on?</h2><div className="workload-cards">{[{id:'short',title:'Everyday chat',detail:'Quick questions and short text',context:8192},{id:'document',title:'Documents & code',detail:'Room for longer files',context:32768},{id:'agent',title:'Long projects',detail:'Keep more of the conversation',context:131072}].map(w=><button key={w.id} aria-pressed={workload===w.id} onClick={()=>{setWorkload(w.id as Workload);const n=Math.min(w.context,current?.contextMax??32768);update({...doc,beginner:{...doc.beginner,contextLength:`${n/1024}k` as BeginnerConfig['contextLength']},expert:{...doc.expert,'ctx.length':`${n/1024}K`}});}}><strong>{w.title}</strong><span>{w.detail}</span></button>)}</div></section>
<section><h2 className="h4">Resources</h2><div className="workload-cards">{[{id:'shared',title:'Leave room for other apps',detail:'Keep this computer responsive'},{id:'full',title:'Full speed',detail:'Give the engine more CPU threads'}].map(h=><button key={h.id} aria-pressed={(doc.headroom??'shared')===h.id} onClick={()=>update({...doc,headroom:h.id,expert:{...doc.expert,'perf.threads':Math.max(1,(hardware?.cpu.cores??4)-(h.id==='shared'?2:0))}})}><strong>{h.title}</strong><span>{h.detail}</span></button>)}</div></section>
<label className="input-field"><span>Conversation context · {cfg.context/1024}K</span><input type="range" aria-label="Conversation context" min={0} max={[4096,8192,16384,32768,65536,131072,262144,524288,1048576].filter(n=>n<=(current?.contextMax??32768)).length-1} value={Math.max(0,[4096,8192,16384,32768,65536,131072,262144,524288,1048576].indexOf(cfg.context))} onChange={e=>changeParam('ctx.length',`${[4,8,16,32,64,128,256,512,1024][Number(e.target.value)]}K`)} /><span className="xs muted">4K — {(current?.contextMax??32768)/1024}K supported · larger context uses more memory</span></label>
</section>{showPreview}
</div> : <div className="stack expert-engine">
<div className="engine-subtabs" role="tablist" aria-label="Expert editor">{(['parameters','raw'] as const).map(v=><button role="tab" aria-selected={view===v} key={v} onClick={()=>setView(v)}>{v==='raw'?'Raw config':'Parameters'}</button>)}</div>
'''+s[end:]
s=s.replace('<textarea className="st-input config-editor"', '{parsed.error?<ErrorNotice message={parsed.error} next="Correct the JSON before saving or applying."/>:null}<textarea className="st-input config-editor"')
s=s.replace(' <div className="parameter-toolbar">', ''' <div className="row small muted"><a href="#/serving">Server access is managed in Serving</a><label className="check-label"><input type="checkbox" checked={unsupported} onChange={e=>setUnsupported(e.target.checked)}/>Show unsupported</label></div><div className="parameter-toolbar">''')
s=s.replace("{p.id.startsWith('sample.') ? 'Next request · all requests' : g === 'Additional settings' ? 'Preserved only' : p.applies ?? 'Preserved only'}", "{!p.applies||p.applies.startsWith('Preserved')?'Not used by this engine':p.applies}")
s=s.replace('<ExpertInput param={p} onChange=', "<ExpertInput param={p} disabled={!p.applies||p.applies.startsWith('Preserved')} onChange=")
start=s.index(' <div className="config-savebar">');end=s.index('\n </div>',start);s=s[:start]+''' {dirty?<div className="config-savebar"><span className="small">{changed.length || 'Configuration'} {changed.length===1?'change':'changes'}</span><Btn size="sm" variant="ghost" disabled={pending} onClick={()=>setDiscardOpen(true)}>Discard</Btn><span className="spacer"/>{library?.loaded&&library.mode!=='simulated'?<Btn size="sm" disabled={invalid||pending||!connected||!lifecycle.allowed} onClick={()=>setApplyOpen(true)}>Apply now…</Btn>:null}<Btn size="sm" variant="primary" disabled={invalid||pending||!connected} onClick={()=>void save()}>{pending?'Saving…':'Save'}</Btn></div>:null}
'''+s[end:]
start=s.index(' <ModelPicker ');end=s.index(' <Dialog open={discardOpen}',start);s=s[:start]+''' <AutoTune open={tuneOpen} onClose={()=>setTuneOpen(false)} onDone={()=>{resetDraft();setTuneOpen(false);}}/>
'''+s[end:]
s=s.replace('Return all three editors to the saved configuration. The running model is unaffected.','Discard all unsaved engine changes and return to the saved configuration.')
s=s.replace('function ExpertInput({ param, onChange }: { param: ExpertParam; onChange:', 'function ExpertInput({ param, onChange, disabled=false }: { param: ExpertParam; disabled?:boolean; onChange:');s=s.replace('<Select value={String(param.value)}','<Select disabled={disabled} value={String(param.value)}');s=s.replace('<button className="st-toggle" type="button"','<button disabled={disabled} className="st-toggle" type="button"');s=s.replace('<input id={`param-${param.id}`}','<input disabled={disabled} id={`param-${param.id}`}');p.write_text(s)
(root/'src/components/AutoTune.tsx').write_text('''import { useEffect, useState } from 'react';
import { Btn, Dialog, Icon } from './ui';
const stages=['Checking hardware','Reviewing supported parameters','Choosing recommended settings','Ready to review'];
/** Proposes catalog defaults; the animation never represents a measured benchmark. */
export function AutoTune({open,onClose,onDone}:{open:boolean;onClose:()=>void;onDone:()=>void}){
const [step,setStep]=useState(0);
useEffect(()=>{if(!open)return;setStep(0);const timer=setInterval(()=>setStep(s=>Math.min(3,s+1)),900);return()=>clearInterval(timer);},[open]);
return <Dialog open={open} title="Auto-tune for this computer" onClose={onClose} actions={<><Btn onClick={onClose}>Close</Btn><Btn variant="primary" disabled={step<3} onClick={onDone}>Review recommended settings</Btn></>}><div className="tune-progress"><div className="tune-orbit" data-complete={step===3}><svg viewBox="0 0 120 120" aria-hidden="true"><circle cx="60" cy="60" r="50"/><circle cx="60" cy="60" r="50" pathLength="100" strokeDasharray={`${(step+1)*25} 100`}/></svg><Icon name={step===3?'check':'gauge'} size={42}/></div><h3 role="status">{stages[step]}</h3><p className="small muted">A recommendation based on detected hardware and supported defaults. Save to apply it; speed has not been benchmarked.</p><div className="tune-steps">{stages.map((s,i)=><span key={s} data-done={i<=step}/>)}</div></div></Dialog>;
}
''')
append('src/styles/app.css','''
.simple-engine { display:flex; flex-direction:column; gap:24px; }.auto-tune-card { padding:24px; background:var(--st-surface); border:1px solid var(--st-line); border-radius:18px; }.auto-tune-card > svg { color:var(--st-accent-text); }.auto-tune-card h2 { margin-top:12px; }
.workload-cards { display:flex; gap:8px; }.workload-cards button { flex:1; min-width:0; padding:12px; text-align:left; border:1px solid var(--st-line); border-radius:12px; background:var(--st-surface); color:var(--st-ink); font:inherit; cursor:pointer; }.workload-cards button[aria-pressed='true'] { border-color:var(--st-accent-text); background:var(--st-accent-surface); }.workload-cards span { display:block; font-size:12px; color:var(--st-ink-soft); margin-top:6px; }.simple-engine input[type='range'] { width:100%; accent-color:var(--st-accent); }
.engine-subtabs { display:flex; gap:24px; border-bottom:1px solid var(--st-line); }.engine-subtabs button { padding:10px 0; border:0; border-bottom:2px solid transparent; background:none; font:inherit; color:var(--st-ink-muted); cursor:pointer; }.engine-subtabs button[aria-selected='true'] { color:var(--st-ink); border-bottom-color:var(--st-accent); }
.expert-engine { gap:12px; }.parameter-group { margin:0; }.parameter-group > h2 { margin:12px 0 4px; }.parameter-row { display:grid; grid-template-columns:minmax(220px,1fr) minmax(230px,1fr); gap:20px; padding:10px 0; }.parameter-key { display:inline; margin-left:8px; font-size:11px; }.parameter-row .xs { display:none; }.parameter-toolbar { gap:12px; padding:8px 0; }.parameter-control { display:flex; align-items:center; gap:8px; }.parameter-control > :first-child { flex:1; }.parameter-control .st-input { min-height:32px; }.config-savebar { display:flex; flex-wrap:nowrap; align-items:center; gap:12px; padding:10px 14px; margin-top:12px; min-height:0; position:sticky; bottom:0; background:var(--st-surface); }.config-editor { min-height:320px; font-family:var(--st-font-mono); }.tuning { padding-bottom:24px; }
.tune-progress { text-align:center; padding:10px 20px 24px; }.tune-orbit { width:180px; height:180px; margin:0 auto 20px; display:grid; place-items:center; position:relative; color:var(--st-accent-text); }.tune-orbit > svg:first-child { position:absolute; inset:0; width:100%; height:100%; transform:rotate(-90deg); }.tune-orbit circle { fill:none; stroke:var(--st-line); stroke-width:3; }.tune-orbit circle+circle { stroke:var(--st-accent); stroke-linecap:round; transition:stroke-dasharray var(--st-t-local) var(--st-ease-standard); }.tune-orbit[data-complete='true'] { color:var(--st-accent-text); }.tune-steps { display:flex; justify-content:center; gap:6px; margin-top:24px; }.tune-steps span { width:22px; height:5px; border-radius:3px; background:var(--st-line); }.tune-steps span[data-done='true'] { background:var(--st-accent); }
@media(prefers-reduced-motion:reduce) { .tune-orbit circle+circle { transition:none; } }[data-motion='reduced'] .tune-orbit circle+circle { transition:none; }
''')