From 0f105f0e1586e19e9378d2ea4c7c64efa938316b Mon Sep 17 00:00:00 2001 From: Jake Date: Fri, 1 May 2026 09:59:03 +0100 Subject: [PATCH] chore(llm): update callers for renamed model variants MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Picks up the registry rename in the front-end and Tauri command layer: - src/lib/types/app.ts: LlmModelIdStr now lists the four new ids (qwen3_5_2b / qwen3_5_4b / qwen3_5_9b / qwen3_6_27b). - src/lib/pages/SettingsPage.svelte: LLM_MODELS table rebuilt with four tiers (Minimal / Standard / High / Maximum), matching subtitles and download-size copy. selectedLlmModelId fallback, hardware-warning thresholds, tier-availability check, and ensureRecommendedLlmTier fallback all retargeted at the new ids. The Maximum tier surfaces a 64 GB / 24 GB warning so users with mid-range hardware see honest expectations. - src-tauri/src/commands/llm.rs and commands/tasks.rs: doc-comment examples refreshed (Qwen3 4B → Qwen3.5 4B, Qwen3's tokenizer → Qwen's tokenizer — the BPE family is shared). - src/lib/stores/llmStatus.svelte.ts: chip-detail example updated. cargo build --workspace clean. cargo test --workspace clean. npx svelte-check reports one pre-existing error in vite.config.js (unused @ts-expect-error directive, dates back to the original scaffold commit 9926a42); not introduced here, out of scope to fix. Co-Authored-By: Claude Opus 4.7 (1M context) --- src-tauri/src/commands/llm.rs | 2 +- src-tauri/src/commands/tasks.rs | 2 +- src/lib/pages/SettingsPage.svelte | 53 ++++++++++++++++++------------ src/lib/stores/llmStatus.svelte.ts | 2 +- src/lib/types/app.ts | 6 +++- 5 files changed, 40 insertions(+), 25 deletions(-) diff --git a/src-tauri/src/commands/llm.rs b/src-tauri/src/commands/llm.rs index 5883f69..051f857 100644 --- a/src-tauri/src/commands/llm.rs +++ b/src-tauri/src/commands/llm.rs @@ -159,7 +159,7 @@ pub struct LlmTestResult { pub category: String, /// `true` when the LLM is healthy and usable after the test. pub ok: bool, - /// One-line status copy for the Settings chip ("Qwen3 4B ready"). + /// One-line status copy for the Settings chip ("Qwen3.5 4B ready"). pub message: String, /// Optional actionable next step ("Click Download", "Delete and /// re-download", "Pick a smaller tier"). Absent when the state is diff --git a/src-tauri/src/commands/tasks.rs b/src-tauri/src/commands/tasks.rs index d0f2ff3..5c2f7a6 100644 --- a/src-tauri/src/commands/tasks.rs +++ b/src-tauri/src/commands/tasks.rs @@ -250,7 +250,7 @@ fn to_llm_examples(rows: Vec) -> Vec { .collect() } -/// Rough character budget for the few-shot block. Qwen3's tokenizer +/// Rough character budget for the few-shot block. Qwen's tokenizer /// averages ~3.5 chars per token in English, so 2000 chars is ~570 /// tokens — well inside the 64-token reserve + response-token gap /// against the 8192-token context cap (see `LlmEngine::generate`). diff --git a/src/lib/pages/SettingsPage.svelte b/src/lib/pages/SettingsPage.svelte index 392669c..ac175b9 100644 --- a/src/lib/pages/SettingsPage.svelte +++ b/src/lib/pages/SettingsPage.svelte @@ -53,25 +53,32 @@ const LLM_MODELS = [ { - id: "qwen3_1_7b", - label: "Low", - subtitle: "Qwen3 1.7B", + id: "qwen3_5_2b", + label: "Minimal", + subtitle: "Qwen3.5 2B", fit: "8 GB RAM, CPU-heavy machines", - size: "~1.1 GB", + size: "~1.3 GB", }, { - id: "qwen3_4b_instruct_2507", - label: "Default", - subtitle: "Qwen3 4B Instruct 2507", - fit: "16 GB RAM or 8 GB+ VRAM", - size: "~2.5 GB", + id: "qwen3_5_4b", + label: "Standard", + subtitle: "Qwen3.5 4B", + fit: "16 GB RAM or 6 GB+ VRAM", + size: "~2.7 GB", }, { - id: "qwen3_14b", + id: "qwen3_5_9b", label: "High", - subtitle: "Qwen3 14B", - fit: "32 GB RAM or 16 GB+ VRAM", - size: "~10.5 GB", + subtitle: "Qwen3.5 9B", + fit: "32 GB RAM and 12 GB+ VRAM", + size: "~5.7 GB", + }, + { + id: "qwen3_6_27b", + label: "Maximum", + subtitle: "Qwen3.6 27B", + fit: "64 GB RAM and 24 GB+ VRAM", + size: "~17 GB", }, ]; @@ -459,7 +466,7 @@ } function selectedLlmModelId() { - return settings.llmModelId || "qwen3_4b_instruct_2507"; + return settings.llmModelId || "qwen3_5_4b"; } function llmModelStatus(modelId) { @@ -476,19 +483,23 @@ function llmHardwareWarning(modelId) { const ramMb = systemInfo?.ram_mb || 0; - if (modelId === "qwen3_14b" && ramMb < 32768) { + if (modelId === "qwen3_6_27b" && ramMb < 65536) { + return "Maximum tier needs 64 GB RAM (or a 24 GB GPU) to avoid heavy swap. Expect slow responses on this machine."; + } + if (modelId === "qwen3_5_9b" && ramMb < 32768) { return "High tier will swap heavily on this machine. Expect slow responses."; } - if (modelId === "qwen3_4b_instruct_2507" && ramMb < 16384 && !hasGpuAcceleration()) { - return "Default tier is best with 16 GB RAM or a GPU-backed build."; + if (modelId === "qwen3_5_4b" && ramMb < 16384 && !hasGpuAcceleration()) { + return "Standard tier is best with 16 GB RAM or a GPU-backed build."; } return ""; } function llmTierAvailable(modelId) { const ramMb = systemInfo?.ram_mb || 0; - if (modelId === "qwen3_14b") return ramMb >= 32768; - if (modelId === "qwen3_4b_instruct_2507") return ramMb >= 16384 || hasGpuAcceleration(); + if (modelId === "qwen3_6_27b") return ramMb >= 65536; + if (modelId === "qwen3_5_9b") return ramMb >= 32768; + if (modelId === "qwen3_5_4b") return ramMb >= 16384 || hasGpuAcceleration(); return true; } @@ -497,7 +508,7 @@ try { settings.llmModelId = await invoke("recommend_llm_tier"); } catch { - settings.llmModelId = "qwen3_4b_instruct_2507"; + settings.llmModelId = "qwen3_5_4b"; } } @@ -1732,7 +1743,7 @@

Recommended for this machine: - {LLM_MODELS.find((model) => model.id === (settings.llmModelId || "qwen3_4b_instruct_2507"))?.subtitle || "Qwen3 4B Instruct 2507"} + {LLM_MODELS.find((model) => model.id === (settings.llmModelId || "qwen3_5_4b"))?.subtitle || "Qwen3.5 4B"} {#if systemInfo} · {Math.round((systemInfo.ram_mb || 0) / 1024)} GB RAM detected diff --git a/src/lib/stores/llmStatus.svelte.ts b/src/lib/stores/llmStatus.svelte.ts index f8aaa5d..dcd9ae3 100644 --- a/src/lib/stores/llmStatus.svelte.ts +++ b/src/lib/stores/llmStatus.svelte.ts @@ -11,7 +11,7 @@ export type LlmStatusKind = "off" | "warming" | "ready" | "generating" | "error" export interface LlmStatusState { kind: LlmStatusKind; - /// Optional short phrase for the chip to surface (e.g. "Loading Qwen3 4B"). + /// Optional short phrase for the chip to surface (e.g. "Loading Qwen3.5 4B"). detail: string | null; } diff --git a/src/lib/types/app.ts b/src/lib/types/app.ts index 478f5f1..8600adf 100644 --- a/src/lib/types/app.ts +++ b/src/lib/types/app.ts @@ -11,7 +11,11 @@ export type WhisperModelSize = | "Medium" | "Distil-L"; export type AiTier = "off" | "cleanup" | "tasks"; -export type LlmModelIdStr = "qwen3_1_7b" | "qwen3_4b_instruct_2507" | "qwen3_14b"; +export type LlmModelIdStr = + | "qwen3_5_2b" + | "qwen3_5_4b" + | "qwen3_5_9b" + | "qwen3_6_27b"; export type LlmPromptPreset = "default" | "email" | "notes" | "code"; export type AiGpuConcurrency = "parallel" | "sequential"; export type TaskBucket = "inbox" | "today" | "soon" | "later";