From 684881246dc37df0dbb830024a00f63fbb695a24 Mon Sep 17 00:00:00 2001 From: Niko1221 Date: Sat, 24 Oct 2026 21:41:06 +0200 Subject: [PATCH] DeepSeek Speed label: the default is named by the engine's own rule, integrated / unified-memory GPU (Strix Halo) or cards totalling 16 GiB or less; '(default on this PC)' on the matching choice; test --- apps/host/src/components/NativeSettings.tsx | 12 +++---- apps/host/src/lib/deepseek-speed.ts | 30 ++++++++++++++++ apps/host/tests/deepseek-speed.test.mjs | 38 +++++++++++++++++++++ 3 files changed, 73 insertions(+), 7 deletions(-) create mode 100644 apps/host/src/lib/deepseek-speed.ts create mode 100644 apps/host/tests/deepseek-speed.test.mjs diff --git a/apps/host/src/components/NativeSettings.tsx b/apps/host/src/components/NativeSettings.tsx index 6c6fb06d..f9cd893a 100644 --- a/apps/host/src/components/NativeSettings.tsx +++ b/apps/host/src/components/NativeSettings.tsx @@ -6,6 +6,8 @@ import { useEffect, useState } from 'react'; import { api } from '../lib/client'; import { refreshNative, useNative, type NativeField } from '../lib/native'; import { Btn, ErrorNotice, Select } from './ui'; +import { speedOptions } from '../lib/deepseek-speed'; +import type { RunCard } from '../lib/native-fit'; import { NativeMcpEditor } from './NativeMcpEditor'; export function NativeSettings({ model }: { model: string; @@ -117,16 +119,12 @@ function NativeFieldInput({ field, value, onChange }: { return ; return 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; +/** DeepSeek's Speed choice. The engine decides the default itself (--experts auto); the labels name the same default (lib/deepseek-speed.ts). */ 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; + const options = speedOptions(native?.hardware?.gpus as RunCard[] | undefined).map(o => ({ ...o, label: tr(o.label) })); return