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

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