chore(llm): update callers for renamed model variants

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) <noreply@anthropic.com>
This commit is contained in:
2026-05-01 09:59:03 +01:00
parent 699cb7e08e
commit 0f105f0e15
5 changed files with 40 additions and 25 deletions

View File

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

View File

@@ -250,7 +250,7 @@ fn to_llm_examples(rows: Vec<FeedbackRow>) -> Vec<LlmFeedbackExample> {
.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`).

View File

@@ -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 @@
<p class="text-[11px] text-text-tertiary mt-3">
Recommended for this machine:
<span class="text-text">
{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"}
</span>
{#if systemInfo}
· {Math.round((systemInfo.ram_mb || 0) / 1024)} GB RAM detected

View File

@@ -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;
}

View File

@@ -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";