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++

DeepSeek settings: Speed (Faster / Full quality), default shown by the engine's own 16 GB rule, passed as --experts 5|6 only when chosen

Niko12214e4921f63e1b
diff --git a/apps/host/server/native-control.mjs b/apps/host/server/native-control.mjs
index 23f4f286b..b532dc772 100644
--- a/apps/host/server/native-control.mjs
+++ b/apps/host/server/native-control.mjs
@@ -246,6 +246,9 @@ return {summary:result.summary??'Deleted',removed:result.plan?.gb??null};}
/* The agent asks for long answers (a thinking model can use most of the window): let the engine clamp the output to what is left of the context instead of refusing the request. */
if(packaged&&!ownEngine(config)&&cfg.fit_max_tokens===undefined)cfg.fit_max_tokens=true;
if(parallelChoice){const applied=applyParallel(cfg,parallelChoice);for(const k of Object.keys(cfg))if(!(k in applied.cfg))delete cfg[k];Object.assign(cfg,applied.cfg);parallelNote=applied.note;}
+ /* DeepSeek's Speed choice: the engine decides by itself (--experts auto: 5 when the cards total 16 GB or less, else 6), so nothing is passed unless the person chose 5 or 6. */
+ if(ownEngine(config)){const list=[];const old=Array.isArray(cfg.args)?cfg.args:[];for(let i=0;i<old.length;i++){if(old[i]==='--experts'){i++;continue;}list.push(old[i]);}if(cfg.ds_experts==='5'||cfg.ds_experts==='6')list.push('--experts',cfg.ds_experts);cfg.args=list;delete cfg.ds_experts;}
+ else delete cfg.ds_experts;
return {cfg,resources,visionPreferences,parallelChoice,parallelNote};
}
/* The DFlash2 drafter, before a load that uses it: Control says whether the choice needs it (and the file is not here), downloads it pinned and checked, and packs it, with plain progress in the job.
diff --git a/apps/host/server/native-settings.mjs b/apps/host/server/native-settings.mjs
index 4413ac553..dba90f94b 100644
--- a/apps/host/server/native-settings.mjs
+++ b/apps/host/server/native-settings.mjs
@@ -11,6 +11,7 @@ export const NATIVE_FIELDS=[
{id:'mtp',label:'Draft layer (MTP)',group:'Serving',type:'boolean',hint:'The draft layer guesses several words ahead, which makes answers faster, and costs about 1 GB of graphics memory and some RAM. Turn it off if the model stops while it starts, or the card is small: the expert cache gets that memory back and answers are slower. Default is on.'},
{id:'drafting',label:'Drafting',group:'Serving',type:'enum',choices:['auto','mtp','dflash2','off'],hint:'Which drafter guesses words ahead to make answers faster. Auto (recommended) lets Strata pick from what it measured on cards like yours; today that is the MTP. DFlash2 is for Qwen3.8-Flash-Next only and downloads a 1.2 GB drafter once. If DFlash2 cannot run, the MTP is used and Details says why. Off turns the draft layer off.'},
{id:'batchMtp',label:'MTP per request',group:'Serving',type:'boolean',hint:'Each concurrent request uses the draft layer. Left alone, Strata turns it on for one graphics card with 24 GB or more and several requests at once, and off otherwise; choose on or off here to decide yourself.'},
+ {id:'ds_experts',label:'Speed (DeepSeek)',group:'Serving',type:'enum',choices:['5','6'],forModel:'deepseek',hint:'Faster uses 5 of 6 experts per word: a small quality change, usually not noticeable. Full quality uses all 6. Left alone, the engine picks Faster on a PC whose graphics cards total 16 GB or less.'},
{id:'parallel',label:'Concurrent requests',group:'Serving',type:'number',min:1,max:8,hint:'More slots need more memory and can slow each response.'},
{id:'engine_silence_s',label:'Engine stall timeout (seconds)',group:'Recovery',type:'number',min:10,max:3600},
{id:'api_monitor',label:'Keep API request metadata',group:'Recovery',type:'boolean'},
@@ -26,7 +27,7 @@ export const NATIVE_FIELDS=[
{id:'mcp_max_result_chars',label:'Maximum tool result characters',group:'Tools',type:'number',min:100,max:1000000},
];
/** Settings the app itself applies when it starts a model (they are not read from the engine's source, so the engine's text never says it supports them). */
-export const APP_OWNED_FIELDS=['mtp','batchMtp','drafting'];
+export const APP_OWNED_FIELDS=['mtp','batchMtp','drafting','ds_experts'];
/** The engine arguments without the draft layer: --mtp <folder or count>, --spec-min-p <p> (its confidence threshold) and --batch-mtp. --spec stays: prompt lookup still uses its windows. Same rule as strata_control/draft_layer.py. */
export function withoutDraftLayer(args){
const out=[];const list=(args??[]).map(String);
diff --git a/apps/host/src/components/NativeSettings.tsx b/apps/host/src/components/NativeSettings.tsx
index 8b1e39bbf..ec176ffda 100644
--- a/apps/host/src/components/NativeSettings.tsx
+++ b/apps/host/src/components/NativeSettings.tsx
@@ -90,7 +90,7 @@ export function NativeSettings({ model }: {
<summary>{tr('Native engine settings')}</summary>
{error ? <><ErrorNotice message={tr('Couldn’t load model settings.')} next={tr('Check that the engine is connected and this model is installed, then try again.')} onRetry={() => setRevision(value => value + 1)}/><details className="native-settings-diagnostic"><summary className="small">{tr('Details')}</summary><p className="small muted">{error}</p></details></> : <p className="small muted" role="status">{tr('Reading saved settings…')}</p>}
</details>;
- const rows = (native?.fields ?? []).filter(f => `${tr(f.label)} ${f.id} ${tr(f.group)}`.toLowerCase().includes(query.toLowerCase()));
+ const rows = (native?.fields ?? []).filter(f => (!f.forModel || model.toLowerCase().includes(f.forModel)) && `${tr(f.label)} ${f.id} ${tr(f.group)}`.toLowerCase().includes(query.toLowerCase()));
return <details className="native-settings"><summary>{tr("Native engine settings")}</summary>{tr(tuned?.changed?.length ? <div className="native-tuned"><p className="small"><strong>{tr("Your tuning '{0}' sets", [tuned.preset?.name ?? ''])}</strong></p><ul>{tuned.changed.map(c => { const d = describeChange(c); return <li key={c.flag}><span>{d.name}</span><b>{d.now || tr('off')}</b>{d.was !== null ? <small className="muted">{tr("was {0}", [d.was])}</small> : null}</li>; })}</ul></div> : null)}<p className="small muted">{tr(!original ? 'Reading saved settings… ' : '')}{tr("Settings for this model. Blank values use Strata\u2019s defaults.")}</p><div className="editor-tabs" role="tablist" aria-label={tr("Native settings editor")}>{tr(['fields', 'json', 'tools'].map(t => <button key={t} role="tab" aria-selected={tab === t} onClick={() => chooseTab(t)}>{tr(t === 'fields' ? 'Parameters' : t === 'json' ? 'JSON' : 'MCP tools')}</button>))}</div>
{tr(tab === 'fields' ? <><input className="st-input" type="search" aria-label={tr("Search native parameters")} placeholder={tr("Search parameters…")} value={query} onChange={e => setQuery(e.target.value)}/>{tr(['Responses', 'GPU & memory', 'Serving', 'Image reading', 'Tools', 'Recovery'].map(group => rows.some(f => f.group === group) ? <section className="native-settings-group" key={group}><h3 className="h4">{tr(group)}</h3>{tr(rows.filter(f => f.group === group).map(f => <label className="native-setting-row" key={f.id}><span><strong>{tr(f.label)}</strong>{tr(f.supported === false ? <small>{tr("Requires a newer Strata installation.")}</small> : f.hint ? <small>{tr(f.hint)}</small> : null)}</span><NativeFieldInput field={f} value={values[f.id]} onChange={v => change(f.id, v)}/></label>))}</section> : null))}<section className="native-settings-group"><h3 className="h4">{tr("Sampling")}</h3>{tr([['temperature', 'Temperature'], ['top_p', 'Top-p'], ['top_k', 'Top-k'], ['min_p', 'Min-p'], ['repetition_penalty', 'Repetition penalty'], ['presence_penalty', 'Presence penalty'], ['frequency_penalty', 'Frequency penalty'], ['penalty_last_n', 'Penalty window'], ['seed', 'Seed']].map(([id, label]) => <label className="native-setting-row" key={id}><span><strong>{tr(label)}</strong></span><input className="st-input" aria-label={tr("Native {0}", [label])} inputMode="decimal" value={values.sampling?.[id] ?? ''} onChange={e => {
const sampling = { ...values.sampling };
@@ -112,10 +112,23 @@ function NativeFieldInput({ field, value, onChange }: {
return <NativeAliases field={field} value={value} onChange={onChange}/>;
if (field.type === 'boolean')
return <Select disabled={field.supported === false} ariaLabel={tr(field.label)} value={value === null || value === undefined ? '' : String(value)} options={[{ value: '', label: 'Default' }, { value: 'true', label: 'On' }, { value: 'false', label: 'Off' }]} onChange={v => onChange(v === '' ? null : v === 'true')}/>;
+ if (field.id === 'ds_experts')
+ return <DeepSeekSpeed field={field} value={value} onChange={onChange}/>;
if (field.type === 'enum')
return <Select disabled={field.supported === false} ariaLabel={tr(field.label)} value={value ?? ''} options={[{ value: '', label: 'Default' }, ...(field.choices ?? []).map(v => ({ value: v, label: v }))]} onChange={v => onChange(v || null)}/>;
return <input disabled={field.supported === false} className="st-input" aria-label={tr(field.label)} inputMode={field.type === 'number' ? 'numeric' : undefined} placeholder={tr("Default")} value={Array.isArray(value) ? value.join(', ') : value ?? ''} onChange={e => onChange(e.target.value === '' ? null : field.type === 'array' ? e.target.value.split(',').map(s => s.trim()).filter(Boolean) : field.type === 'number' ? Number(e.target.value) : e.target.value)}/>;
}
+/** DeepSeek's Speed choice. The engine's own rule (--experts auto): Faster (5 experts) when the graphics cards in use total 16 GB (17,179,869,184 bytes) or less, else Full quality (6). */
+const SIXTEEN_GIB = 17179869184;
+function DeepSeekSpeed({ field, value, onChange }: { field: NativeField; value: any; onChange: (v: any) => void }) {
+ const native = useNative();
+ const cards = (native?.hardware?.gpus ?? []).filter(g => g.usable !== false);
+ const total = cards.reduce((sum, g) => sum + (g.vram_gb ?? 0) * 1073741824, 0);
+ const faster = total > 0 && total <= SIXTEEN_GIB;
+ return <Select disabled={field.supported === false} ariaLabel={tr(field.label)} value={value === null || value === undefined ? '' : String(value)}
+ options={[{ value: '', label: tr(faster ? 'Default (Faster on this PC)' : 'Default (Full quality on this PC)') }, { value: '5', label: tr('Faster') }, { value: '6', label: tr('Full quality') }]}
+ onChange={v => onChange(v === '' ? null : v)}/>;
+}
function NativeAliases({ field, value, onChange }: {
field: NativeField;
value: any;
diff --git a/apps/host/src/lib/native.ts b/apps/host/src/lib/native.ts
index 1bc0e7281..b62a02bc9 100644
--- a/apps/host/src/lib/native.ts
+++ b/apps/host/src/lib/native.ts
@@ -5,7 +5,7 @@ export interface GpuChoiceOption {key:string;cards:number[];label:string;verdict
export interface GpuChoice {options:GpuChoiceOption[];recommended:string|null;ignored:{name?:string;why_ignored:string}[];cards:number}
export interface NativeSize {/** The first engine that reads this size's files (the catalog), and whether the installed engine is older: the screen then says "needs a newer engine" and offers the update. */engine_min?:string|null;needsNewerEngine?:boolean;id:string;model:string;about:string;download_gb:number;ram_needed_gb:number;experts_gb:number;on_this_pc:string|null;installed:boolean;gpu_options?:GpuChoice|null;images?:boolean;imagesCapable?:boolean;/** DeepSeek-V4.1-Flash and the like: several big files and an engine of their own. */multi_file?:boolean}
export interface NativeFamily {family:string;title:string;about:string;experimental:boolean;images:boolean;sizes:NativeSize[]}
-export interface NativeField {id:string;label:string;group:string;type:'number'|'boolean'|'string'|'enum'|'array';min?:number;max?:number;choices?:string[];hint?:string;supported?:boolean}
+export interface NativeField {id:string;label:string;group:string;type:'number'|'boolean'|'string'|'enum'|'array';min?:number;max?:number;choices?:string[];hint?:string;supported?:boolean;forModel?:string}
export interface NativeJob {id:string;kind:string;guided?:boolean;model?:string;family?:string;state:'running'|'done'|'error'|'cancelled';startedAt:string;summary:string;error:string|null;details?:string;result:Record<string,any>|null;progress?:Record<string,any>|null}
export interface NativeInstance {id:string;apiModelId:string;model:string;label:string;aliases?:string[];vision?:boolean;resourceProfile?:'work'|'performance'|null;context?:number;port:number;gpus:number[];status:'loading'|'ready'|'unloading'|'error';phase:string;loadedAt:string;error:string|null;metrics:Record<string,any>|null}
export interface NativeState {
diff --git a/apps/host/tests/packaged-control.test.mjs b/apps/host/tests/packaged-control.test.mjs
index 51503dffa..0c3015278 100644
--- a/apps/host/tests/packaged-control.test.mjs
+++ b/apps/host/tests/packaged-control.test.mjs
@@ -225,6 +225,27 @@ test('packaged: a model id with dots (DeepSeek) is listed, loaded from its run c
} finally { await f.native.close(); f.cleanup(); }
});
+test('packaged: the Speed choice of DeepSeek passes --experts 5 or 6 only when chosen; "Default" passes nothing', async () => {
+ const id = 'deepseek-v4.1-flash-ist-das-2.00bpw';
+ const run = async (values, extraArgs = []) => {
+ const f = packagedFixture({ ids: [id] });
+ try {
+ writeFileSync(join(f.install, `strata-${id}.json`), JSON.stringify({ exe: join(f.install, 'engine-dsv41', 'strata-dsv41'), arch: 'deepseek41', tokenizer: join(f.install, 'tok'), args: ['--pack', join(f.install, 'pack'), '--max-context', '8192', ...extraArgs], model_name: 'deepseek-v4.1-flash', port: 8080 }));
+ await f.native.refresh(true);
+ const job = await finish(f.native, f.native.operation('load', { model: id, ...(values ? { values } : {}) }).id);
+ assert.equal(job.state, 'done', job.error);
+ return f.saved[0];
+ } finally { await f.native.close(); f.cleanup(); }
+ };
+ const flags = cfg => { const i = cfg.args.indexOf('--experts'); return i < 0 ? null : cfg.args[i + 1]; };
+ assert.equal(flags(await run(null)), null, 'nothing chosen: the engine decides (--experts auto)');
+ assert.equal(flags(await run({ ds_experts: '5' })), '5');
+ assert.equal(flags(await run({ ds_experts: '6' }, ['--experts', '5'])), '6', 'the choice replaces an older flag');
+ assert.equal(flags(await run({ ds_experts: null }, ['--experts', '5'])), null, 'Default clears an older flag');
+ const cfg = await run({ ds_experts: '5' });
+ assert.equal('ds_experts' in cfg, false, 'the app-only key is not handed to the engine');
+});
+
test('packaged: no engine for this PC is the notice, and nothing is started', async () => {
const f = packagedFixture({ engineUsable: false });
try {