The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
feat(desktop): Local Models — one click from nothing to local tokens
emozillaad04a076bdf8
diff --git a/apps/desktop/src/app/gateway/hooks/use-gateway-boot.ts b/apps/desktop/src/app/gateway/hooks/use-gateway-boot.tsindex 334ea4e604d..e15f9e2f022 100644--- a/apps/desktop/src/app/gateway/hooks/use-gateway-boot.ts+++ b/apps/desktop/src/app/gateway/hooks/use-gateway-boot.ts@@ -25,6 +25,7 @@ import {touchSecondaryGateways} from '@/store/gateway'import { $gatewaySwitching, wipeSessionListsForGatewaySwitch } from '@/store/gateway-switch'+import { checkLocalRuntimeUpdate, watchLocalRuntimeJobs } from '@/store/local-runtime-jobs'import { notify, notifyError } from '@/store/notifications'import { $activeGatewayProfile, normalizeProfileKey, touchActiveGatewayBackend } from '@/store/profile'import {@@ -334,6 +335,12 @@ export function useGatewayBoot({])completeDesktopBoot()bootCompleted = true+ // Rediscover local-runtime jobs (model downloads, runtime installs)+ // that were running before a reload — the backend registry is the+ // authority; this just resumes following it.+ watchLocalRuntimeJobs()+ // One-per-session engine-update pointer (enabled runtimes only).+ void checkLocalRuntimeUpdate()} catch (err) {if (!cancelled) {const message = err instanceof Error ? err.message : String(err)diff --git a/apps/desktop/src/app/settings/index.tsx b/apps/desktop/src/app/settings/index.tsxindex f55503702b4..59e8fde62de 100644--- a/apps/desktop/src/app/settings/index.tsx+++ b/apps/desktop/src/app/settings/index.tsx@@ -10,6 +10,7 @@ import {Archive,BarChart3,Bell,+ Cpu,Download,Globe,Info,@@ -191,6 +192,13 @@ export function SettingsView({ onClose, onConfigSaved, onMainModelChanged }: Setid: 'pview:custom-endpoints',label: t.settings.nav.providerCustomEndpoints,onSelect: () => openProviderView('custom-endpoints')+ },+ {+ active: activeView === 'providers' && providerView === 'local',+ icon: Cpu,+ id: 'pview:local',+ label: t.settings.nav.providerLocalModels,+ onSelect: () => openProviderView('local')}],gapBefore: true,diff --git a/apps/desktop/src/app/settings/local-models-settings.test.tsx b/apps/desktop/src/app/settings/local-models-settings.test.tsxnew file mode 100644index 00000000000..e125eb40c8a--- /dev/null+++ b/apps/desktop/src/app/settings/local-models-settings.test.tsx@@ -0,0 +1,277 @@+import { cleanup, render, screen, waitFor } from '@testing-library/react'+import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'++import { I18nProvider } from '@/i18n'+import { $localRuntimeJobs } from '@/store/local-runtime-jobs'+import type { LocalCatalogModel, LocalHardware, LocalModelsStatus, LocalRuntimeJob } from '@/types/hermes'++import { LocalModelsSettings } from './local-models-settings'++// Mock the API layer — the pane's contract is what it RENDERS from these+// payloads, not transport.+vi.mock('@/hermes', () => ({+ activateLocalModel: vi.fn(),+ deleteLocalModel: vi.fn(),+ downloadLocalModel: vi.fn(),+ ejectLocalModel: vi.fn(),+ getLocalCatalog: vi.fn(),+ getLocalHardware: vi.fn(),+ getLocalModelsJobs: vi.fn(),+ getLocalModelsStatus: vi.fn(),+ getLocalRuntimeJob: vi.fn(),+ installLocalRuntime: vi.fn()+}))++import * as hermes from '@/hermes'++const mocked = vi.mocked(hermes)++const BASE_STATUS: LocalModelsStatus = {+ enabled: true,+ tag: 'b10290',+ configured_tag: 'b10290',+ update_available: false,+ runtime_installed: false,+ runtime_backend: null,+ server_running: false,+ server_base_url: null,+ active_model_id: null,+ loaded_models: {},+ models: [],+ models_dir: 'C:/somewhere/models'+}++const BASE_HARDWARE: LocalHardware = {+ uma: false,+ vram_total_bytes: 32 * 2 ** 30,+ vram_usable_bytes: 26 * 2 ** 30,+ ram_total_bytes: 256 * 2 ** 30,+ ram_available_bytes: 200 * 2 ** 30,+ vram_label: '32.0 GB',+ gpu_name: 'NVIDIA GeForce RTX 5090',+ gpu_util_percent: 12,+ vram_used_bytes: 6 * 2 ** 30+}++const FITTING_MODEL: LocalCatalogModel = {+ id: 'Qwen3.6-27B-UD-Q4_K_XL',+ display_name: 'Qwen3.6 27B',+ description: 'Best all-round agent model; long context stays fast',+ size_bytes: 17.6 * 2 ** 30,+ size_label: '17.6 GB',+ native_context: 262144,+ native_context_label: '256K',+ tags: ['recommended'],+ downloaded: false,+ mtp: false,+ fits: true,+ fit_summary: 'runs at its full 256K context',+ start_window: 262144,+ start_window_label: '256K',+ spilled: false+}++const SPILLED_MODEL: LocalCatalogModel = {+ ...FITTING_MODEL,+ id: 'Spilled-Model',+ display_name: 'Spilled Model',+ tags: [],+ fits: true,+ spilled: true,+ start_window: 65536,+ start_window_label: '64K',+ fit_summary: 'starts at 64K and grows toward 256K as you use it (larger than your GPU memory — runs slower)'+}++const REFUSED_MODEL: LocalCatalogModel = {+ ...FITTING_MODEL,+ id: 'Huge-Model',+ display_name: 'Huge Model',+ tags: [],+ fits: false,+ fit_summary: 'Needs more memory than this machine has',+ fit_detail: 'needs ~60 GiB at the 64K floor',+ start_window: undefined,+ start_window_label: undefined+}++function renderPane() {+ return render(+ <I18nProvider>+ <LocalModelsSettings />+ </I18nProvider>+ )+}++beforeEach(() => {+ mocked.getLocalModelsStatus.mockResolvedValue(BASE_STATUS)+ mocked.getLocalHardware.mockResolvedValue(BASE_HARDWARE)+ mocked.getLocalCatalog.mockResolvedValue({ models: [FITTING_MODEL, SPILLED_MODEL, REFUSED_MODEL] })+ mocked.getLocalModelsJobs.mockResolvedValue({ jobs: [] })+ $localRuntimeJobs.set([])+})++afterEach(() => {+ cleanup()+ vi.clearAllMocks()+})++describe('LocalModelsSettings', () => {+ it('offers the runtime install with a plain-language explanation', async () => {+ renderPane()++ expect(await screen.findByText('Install the local runtime')).toBeTruthy()+ expect(screen.getByText(/runs? entirely on this machine/i)).toBeTruthy()+ expect(screen.getByRole('button', { name: /install runtime/i })).toBeTruthy()+ })++ it('shows every catalog model with fit pills; unaffordable ones stay visible with the reason', async () => {+ renderPane()++ expect(await screen.findByText('Qwen3.6 27B')).toBeTruthy()+ // The fitting model reads as pills, not prose: green memory pill ++ // full-context pill (start_window == native here).+ expect(screen.getByText('Fits your GPU')).toBeTruthy()+ expect(screen.getByText('Full 256K context')).toBeTruthy()++ // The refused model is NOT hidden (discoverability rule): red memory+ // pill, and the ceiling it would have had (spilled model shows one too).+ expect(screen.getByText('Huge Model')).toBeTruthy()+ expect(screen.getByText('Too big for this machine')).toBeTruthy()+ expect(screen.getAllByText('Up to 256K').length).toBeGreaterThanOrEqual(1)++ // The spilled model reads amber + a start/ceiling pair.+ expect(screen.getByText('Spilled Model')).toBeTruthy()+ expect(screen.getByText('Uses system RAM')).toBeTruthy()+ expect(screen.getByText('Starts at 64K')).toBeTruthy()++ // Its download button is disabled; the fitting model's is enabled once+ // the runtime exists (here runtime_installed=false, so both disabled —+ // asserted separately below).+ const buttons = screen.getAllByRole('button', { name: /download · 17\.6 GB/i })+ expect(buttons.every(b => (b as HTMLButtonElement).disabled)).toBe(true)+ })++ it('enables downloads only once the runtime is installed', async () => {+ mocked.getLocalModelsStatus.mockResolvedValue({+ ...BASE_STATUS,+ runtime_installed: true,+ runtime_backend: 'cuda'+ })+ renderPane()++ await screen.findByText('Qwen3.6 27B')+ const [fittingButton] = screen.getAllByRole('button', { name: /download · 17\.6 GB/i })+ expect((fittingButton as HTMLButtonElement).disabled).toBe(false)+ })++ it('shows hardware facts after backfill', async () => {+ renderPane()++ expect(await screen.findByText('NVIDIA GeForce RTX 5090')).toBeTruthy()+ expect(screen.getByText(/32\.0 GB GPU memory/)).toBeTruthy()+ expect(screen.getByText(/256\.0 GB RAM/)).toBeTruthy()+ })++ it('tracks a download job to completion and refreshes', async () => {+ mocked.getLocalModelsStatus.mockResolvedValue({+ ...BASE_STATUS,+ runtime_installed: true,+ runtime_backend: 'cuda'+ })+ mocked.downloadLocalModel.mockResolvedValue({ job_id: 'j1' })++ const running: LocalRuntimeJob = {+ job_id: 'j1',+ kind: 'model-download',+ target: 'Qwen3.6 27B',+ model_id: FITTING_MODEL.id,+ status: 'running',+ phase: 'downloading',+ detail: 'Qwen3.6 27B — 17.6 GB',+ total_bytes: 100,+ done_bytes: 40,+ percent: 40,+ error: null+ }++ mocked.getLocalModelsJobs+ .mockResolvedValueOnce({ jobs: [running] })+ .mockResolvedValue({ jobs: [{ ...running, status: 'done', phase: 'done', done_bytes: 100, percent: 100 }] })++ renderPane()+ await screen.findByText('Qwen3.6 27B')++ const [download] = screen.getAllByRole('button', { name: /download · 17\.6 GB/i })+ download.click()++ // The app-level watcher follows the job; when it settles the pane+ // refreshes (status + catalog re-fetched).+ await waitFor(() => {+ expect(mocked.getLocalModelsJobs).toHaveBeenCalled()+ expect(mocked.getLocalModelsStatus.mock.calls.length).toBeGreaterThanOrEqual(2)+ })+ })++ it('renders progress for a download discovered from the store (survives pane remount)', async () => {+ mocked.getLocalModelsStatus.mockResolvedValue({+ ...BASE_STATUS,+ runtime_installed: true,+ runtime_backend: 'cuda'+ })+ // A running job already in the app-level store — as after closing and+ // reopening the pane mid-download.+ $localRuntimeJobs.set([+ {+ job_id: 'j9',+ kind: 'model-download',+ target: 'Qwen3.6 27B',+ model_id: FITTING_MODEL.id,+ status: 'running',+ phase: 'downloading',+ detail: '',+ total_bytes: 100,+ done_bytes: 62,+ percent: 62,+ error: null+ }+ ])++ renderPane()+ await screen.findByText('Qwen3.6 27B')++ // The fitting row shows byte progress; the remaining download+ // buttons belong to the other rows (spilled + refused).+ expect(screen.getByText(/0\.0 GB of 0\.0 GB|of/)).toBeTruthy()+ const remaining = screen.queryAllByRole('button', { name: /download · 17\.6 GB/i })+ expect(remaining.length).toBe(2)+ expect(remaining.some(b => (b as HTMLButtonElement).disabled)).toBe(true)+ })++ it('surfaces a failed download with the backend message', async () => {+ mocked.getLocalModelsStatus.mockResolvedValue({+ ...BASE_STATUS,+ runtime_installed: true,+ runtime_backend: 'cuda'+ })+ $localRuntimeJobs.set([+ {+ job_id: 'j2',+ kind: 'model-download',+ target: 'Qwen3.6 27B',+ model_id: FITTING_MODEL.id,+ status: 'error',+ phase: 'verifying',+ detail: '',+ total_bytes: 100,+ done_bytes: 100,+ error: 'Downloaded file failed its integrity check and was removed — try again'+ }+ ])++ renderPane()+ await screen.findByText('Qwen3.6 27B')++ expect(await screen.findByText(/integrity check/)).toBeTruthy()+ })+})diff --git a/apps/desktop/src/app/settings/local-models-settings.tsx b/apps/desktop/src/app/settings/local-models-settings.tsxnew file mode 100644index 00000000000..9017c232e70--- /dev/null+++ b/apps/desktop/src/app/settings/local-models-settings.tsx@@ -0,0 +1,560 @@+import { useStore } from '@nanostores/react'+import { useCallback, useEffect, useState } from 'react'++import { Button } from '@/components/ui/button'+import { Tip } from '@/components/ui/tooltip'+import {+ activateLocalModel,+ deleteLocalModel,+ downloadLocalModel,+ ejectLocalModel,+ getLocalCatalog,+ getLocalHardware,+ getLocalModelsStatus,+ installLocalRuntime,+ setLocalServer+} from '@/hermes'+import { useI18n } from '@/i18n'+import { Check, CheckCircle2, Cpu, Download, Eject, Loader2, Monitor, Package, StopFilled, Trash2, Zap } from '@/lib/icons'+import { cn } from '@/lib/utils'+import {+ $localRuntimeJobs,+ runningDownloadFor,+ runningRuntimeInstall,+ watchLocalRuntimeJobs+} from '@/store/local-runtime-jobs'+import { notify, notifyError } from '@/store/notifications'+import type { LocalCatalogModel, LocalHardware, LocalModelsStatus } from '@/types/hermes'++import { ListRow, Pill, SettingsContent, SettingsSection, SettingsSkeleton } from './primitives'++function ProgressBar({ percent }: { percent: number | undefined }) {+ return (+ <div className="h-1.5 w-full overflow-hidden rounded-full bg-(--ui-bg-tertiary)">+ <div+ className="h-full rounded-full bg-primary transition-[width] duration-300"+ style={{ width: `${Math.max(2, Math.min(100, percent ?? 2))}%` }}+ />+ </div>+ )+}++function gbLabel(bytes: number | null | undefined): string {+ if (!bytes) {+ return '—'+ }++ return `${(bytes / (1 << 30)).toFixed(1)} GB`+}++export function LocalModelsSettings() {+ const { t } = useI18n()+ const copy = t.settings.localModels+ const [status, setStatus] = useState<LocalModelsStatus | null>(null)+ const [hardware, setHardware] = useState<LocalHardware | null>(null)+ const [catalog, setCatalog] = useState<LocalCatalogModel[] | null>(null)+ const [deleting, setDeleting] = useState<string | null>(null)+ const [serverBusy, setServerBusy] = useState(false)+ // Jobs live in the app-level store (they must survive this pane+ // unmounting); the pane just renders the slice it cares about.+ const jobs = useStore($localRuntimeJobs)++ const refresh = useCallback(() => {+ void getLocalModelsStatus()+ .then(setStatus)+ .catch(() => setStatus(null))+ void getLocalCatalog()+ .then(data => setCatalog(data.models))+ .catch(() => setCatalog([]))+ }, [])++ // Snappy first paint: status + catalog immediately; hardware (may shell out+ // to nvidia-smi) backfills and pops in-place. The job watcher also kicks+ // here so reopening the pane rediscovers work started before.+ useEffect(() => {+ refresh()+ watchLocalRuntimeJobs()+ void getLocalHardware()+ .then(setHardware)+ .catch(() => setHardware(null))+ }, [refresh])++ // The pane is LIVE while visible: residency changes without user action+ // (boot warm finishing, idle sweep unloading, another surface ejecting),+ // and a stale snapshot here reads as a broken feature — 'VRAM full but+ // the pane says Not in memory'. The status route is built cheap for+ // polling; setTimeout chain, never overlapping.+ useEffect(() => {+ let cancelled = false+ let timer: number | undefined++ const tick = async () => {+ try {+ const next = await getLocalModelsStatus()++ if (!cancelled) {+ setStatus(next)+ }+ } catch {+ // Backend briefly unreachable — keep the last snapshot.+ }++ if (!cancelled) {+ timer = window.setTimeout(() => void tick(), 4_000)+ }+ }++ timer = window.setTimeout(() => void tick(), 4_000)++ return () => {+ cancelled = true++ if (timer !== undefined) {+ window.clearTimeout(timer)+ }+ }+ }, [])++ // A job finishing (download done, install done) changes what status/catalog+ // should show — refresh whenever the running set shrinks.+ const runningCount = jobs.filter(j => j.status === 'running').length+ useEffect(() => {+ refresh()+ }, [refresh, runningCount])++ async function handleInstallRuntime() {+ try {+ await installLocalRuntime()+ watchLocalRuntimeJobs()+ } catch (err) {+ notifyError(err, copy.installFailed)+ }+ }++ async function handleDownload(model: LocalCatalogModel) {+ try {+ const res = await downloadLocalModel(model.id)++ if (res.already_downloaded || !res.job_id) {+ refresh()++ return+ }++ watchLocalRuntimeJobs()+ } catch (err) {+ notifyError(err, copy.downloadFailed(model.display_name))+ }+ }++ async function handleActivate(model: LocalCatalogModel) {+ const target = model.downloaded_model_id ?? model.model_id++ if (!target) {+ return+ }++ try {+ await activateLocalModel(target)+ watchLocalRuntimeJobs()+ } catch (err) {+ notifyError(err, copy.activateFailed(model.display_name))+ }+ }++ async function handleEject(modelId: string) {+ try {+ await ejectLocalModel(modelId)+ notify({ durationMs: 3_000, kind: 'success', message: copy.ejected, title: copy.title })+ refresh()+ } catch (err) {+ notifyError(err, copy.ejectFailed)+ }+ }++ async function handleServer(action: 'start' | 'stop') {+ setServerBusy(true)++ try {+ await setLocalServer(action)+ notify({+ durationMs: 3_500,+ kind: 'success',+ message: action === 'stop' ? copy.serverStopped : copy.serverStarted,+ title: copy.title+ })+ refresh()+ } catch (err) {+ notifyError(err, action === 'stop' ? copy.serverStopFailed : copy.serverStartFailed)+ } finally {+ setServerBusy(false)+ }+ }++ async function handleDelete(model: LocalCatalogModel) {+ const target = model.downloaded_model_id ?? model.id++ if (!window.confirm(copy.deleteConfirm(target))) {+ return+ }++ setDeleting(model.id)++ try {+ await deleteLocalModel(target)+ notify({ durationMs: 2_500, kind: 'success', message: copy.deleted(target), title: copy.title })+ refresh()+ } catch (err) {+ notifyError(err, copy.deleteFailed)+ } finally {+ setDeleting(null)+ }+ }++ if (!status || catalog === null) {+ return <SettingsSkeleton sections={[{ rows: 2 }, { rows: 4 }]} />+ }++ const rJob = runningRuntimeInstall(jobs)+ const lastError = jobs.find(j => j.status === 'error')++ // Up to date = the authority (status) says the configured tag is what's+ // serving. Shown whenever true — not only right after an update.+ const updateApplied =+ status.runtime_installed && !status.update_available && status.tag === status.configured_tag++ return (+ <SettingsContent>+ {/* ── Runtime ── */}+ <SettingsSection+ aside={+ status.runtime_installed ? (+ <Pill tone="primary">+ {status.server_running ? copy.serverRunning : copy.runtimeReady(status.runtime_backend ?? '')}+ </Pill>+ ) : undefined+ }+ icon={Zap}+ meta={status.tag}+ title={copy.runtimeTitle}+ >+ {status.runtime_installed ? (+ <ListRow+ action={+ status.server_running ? (+ <Button+ className={cn(serverBusy && '[&_svg]:animate-spin')}+ disabled={serverBusy}+ onClick={() => void handleServer('stop')}+ size="sm"+ variant="outline"+ >+ {serverBusy ? <Loader2 /> : <StopFilled />}+ {copy.stopServer}+ </Button>+ ) : (+ <Button+ className={cn(serverBusy && '[&_svg]:animate-spin')}+ disabled={serverBusy}+ onClick={() => void handleServer('start')}+ size="sm"+ variant="outline"+ >+ {serverBusy ? <Loader2 /> : <Zap />}+ {copy.startServer}+ </Button>+ )+ }+ description={+ status.server_running+ ? copy.runtimeRunningDetail+ : copy.runtimeInstalledDetail(status.tag, status.runtime_backend ?? 'cpu')+ }+ title={copy.runtimeInstalled}+ />+ ) : rJob ? (+ <ListRow+ below={<ProgressBar percent={rJob.percent} />}+ description={rJob.detail || copy.installing}+ title={+ <span className="inline-flex items-center gap-2">+ <Loader2 className="size-3.5 animate-spin" />+ {copy.installing}+ </span>+ }+ />+ ) : (+ <ListRow+ action={+ <Button onClick={() => void handleInstallRuntime()} size="sm">+ <Download />+ {copy.installAction}+ </Button>+ }+ description={copy.installDetail}+ title={copy.installTitle}+ />+ )}++ {status.update_available && !rJob && (+ <ListRow+ action={+ <Button onClick={() => void handleInstallRuntime()} size="sm">+ <Download />+ {copy.updateAction}+ </Button>+ }+ description={copy.updateDetail(status.configured_tag, status.tag)}+ title={copy.updateTitle}+ />+ )}++ {rJob && status.runtime_installed && (+ <ListRow+ below={<ProgressBar percent={rJob.percent} />}+ description={rJob.detail || copy.updating}+ title={+ <span className="inline-flex items-center gap-2">+ <Loader2 className="size-3.5 animate-spin" />+ {copy.updating}+ </span>+ }+ />+ )}++ {updateApplied && (+ <ListRow+ description={copy.upToDateDetail(status.tag, status.runtime_backend ?? 'cpu')}+ title={+ <span className="inline-flex items-center gap-2">+ <CheckCircle2 className="size-4 text-emerald-600 dark:text-emerald-400" />+ {copy.upToDateTitle}+ </span>+ }+ />+ )}++ {lastError?.kind === 'runtime-install' && (+ <p className="text-[0.75rem] text-destructive">{lastError.error}</p>+ )}+ </SettingsSection>++ {/* ── This machine ── */}+ <SettingsSection icon={Monitor} title={copy.hardwareTitle}>+ {hardware ? (+ <div className="flex flex-wrap items-center gap-x-5 gap-y-1 py-1 text-[length:var(--conversation-caption-font-size)] text-muted-foreground">+ {hardware.gpu_name && (+ <span className="inline-flex items-center gap-1.5">+ <Zap className="size-3.5" />+ {hardware.gpu_name}+ </span>+ )}++ <span className="inline-flex items-center gap-1.5">+ <Cpu className="size-3.5" />+ {copy.vram(gbLabel(hardware.vram_total_bytes))}+ </span>++ <span className="inline-flex items-center gap-1.5">+ <Package className="size-3.5" />+ {copy.ram(gbLabel(hardware.ram_total_bytes))}+ </span>++ {hardware.uma && <Pill>{copy.unifiedMemory}</Pill>}+ </div>+ ) : (+ <p className="py-1 text-[length:var(--conversation-caption-font-size)] text-muted-foreground">+ {copy.hardwareLoading}+ </p>+ )}+ </SettingsSection>++ {/* ── Models ── */}+ <SettingsSection icon={Download} meta={`${catalog.length}`} title={copy.modelsTitle}>+ <div className="grid gap-1">+ {catalog.map(model => {+ const dJob = runningDownloadFor(jobs, model.id)+ const anyDownloadRunning = jobs.some(j => j.kind === 'model-download' && j.status === 'running')+ const activateTarget = model.downloaded_model_id ?? model.model_id+ const isActive = Boolean(activateTarget && status.active_model_id === activateTarget)+ const residency = activateTarget ? status.loaded_models[activateTarget] : undefined+ const isLoaded = residency === 'loaded' || residency === 'ready'+ const isLoadingNow = residency === 'loading'++ const aJob = jobs.find(+ j => j.kind === 'model-activate' && j.status === 'running' && j.model_id === activateTarget+ )++ const anyActivateRunning = jobs.some(j => j.kind === 'model-activate' && j.status === 'running')++ return (+ <ListRow+ action={+ model.downloaded ? (+ <div className="flex items-center justify-end gap-2">+ {isLoaded && <Pill>{copy.loadedPill}</Pill>}++ {isLoadingNow && (+ <Pill>+ <Loader2 className="mr-1 size-3 animate-spin" />+ {copy.loadingPill}+ </Pill>+ )}++ {isActive ? (+ <Tip label={copy.activeDetail}>+ <Pill tone="primary">+ <Check className="mr-1 size-3" />+ {copy.activePill}+ </Pill>+ </Tip>+ ) : (+ <Button+ className={cn(aJob && '[&_svg]:animate-spin')}+ disabled={anyActivateRunning}+ onClick={() => void handleActivate(model)}+ size="sm"+ >+ {aJob ? <Loader2 /> : <Check />}+ {aJob ? copy.activating : copy.useAction}+ </Button>+ )}++ {isLoaded && (+ <Tip label={copy.ejectTip}>+ <Button+ onClick={() => void handleEject(activateTarget ?? model.id)}+ size="icon"+ variant="ghost"+ >+ <Eject />+ </Button>+ </Tip>+ )}++ <Tip label={copy.deleteAction}>+ <Button+ className={cn(deleting === model.id && '[&_svg]:animate-spin')}+ onClick={() => void handleDelete(model)}+ size="icon"+ variant="ghost"+ >+ {deleting === model.id ? <Loader2 /> : <Trash2 />}+ </Button>+ </Tip>+ </div>+ ) : dJob ? undefined : (+ <Button+ disabled={!model.fits || anyDownloadRunning || !status.runtime_installed}+ onClick={() => void handleDownload(model)}+ size="sm"+ variant="outline"+ >+ <Download />+ {copy.downloadAction(model.size_label)}+ </Button>+ )+ }+ below={+ dJob ? (+ <div className="mt-2 grid gap-1">+ <ProgressBar percent={dJob.percent} />++ <p className="text-[0.68rem] text-muted-foreground">+ {dJob.phase === 'verifying'+ ? copy.verifying+ : copy.downloadProgress(gbLabel(dJob.done_bytes), gbLabel(dJob.total_bytes))}+ </p>+ </div>+ ) : undefined+ }+ description={+ <>+ {model.description}++ <span className="mt-1.5 flex flex-wrap items-center gap-1.5">+ {/* Memory: the traffic light. Green = runs fully on+ the GPU; amber = spills to system RAM (works,+ slower); red = doesn't fit this machine at all.+ Detail prose lives in the tooltip. */}+ {!model.fits ? (+ <Tip label={model.fit_detail ?? model.fit_summary}>+ <Pill tone="destructive">+ <Cpu className="mr-1 size-3" />+ {copy.pillTooBig}+ </Pill>+ </Tip>+ ) : model.spilled ? (+ <Tip label={model.quant_reason ?? model.fit_summary}>+ <Pill tone="warn">+ <Cpu className="mr-1 size-3" />+ {copy.pillUsesRam}+ </Pill>+ </Tip>+ ) : (+ <Tip label={model.quant_reason ?? model.fit_summary}>+ <Pill tone="success">+ <Cpu className="mr-1 size-3" />+ {copy.pillFitsGpu}+ </Pill>+ </Tip>+ )}++ {/* Context: where it starts, and how far it can grow.+ A model granted its full native window collapses+ both into one green pill. */}+ {model.fits && model.start_window_label && (+ model.start_window && model.start_window >= model.native_context ? (+ <Tip label={copy.pillFullContextTip}>+ <Pill tone="success">{copy.pillFullContext(model.native_context_label)}</Pill>+ </Tip>+ ) : (+ <>+ <Tip label={copy.pillStartsTip}>+ <Pill>{copy.pillStarts(model.start_window_label)}</Pill>+ </Tip>+ <Tip label={copy.pillGrowsTip}>+ <Pill>{copy.pillUpTo(model.native_context_label)}</Pill>+ </Tip>+ </>+ )+ )}++ {!model.fits && (+ <Pill>{copy.pillUpTo(model.native_context_label)}</Pill>+ )}++ {model.vision && <Pill>{copy.pillVision}</Pill>}+ </span>++ {isActive && !isLoaded && !isLoadingNow && status.server_running && (+ <span className="mt-0.5 block text-(--ui-text-tertiary)">{copy.activeNotLoaded}</span>+ )}+ </>+ }+ key={model.id}+ title={+ <span className="inline-flex items-center gap-2">+ {model.display_name}++ {model.tags.includes('recommended') && <Pill tone="primary">{copy.recommended}</Pill>}++ <span className="text-[0.68rem] font-normal text-muted-foreground">+ {model.downloaded_quant ?? model.quant ?? ''}+ {(model.downloaded_quant ?? model.quant) ? ' · ' : ''}+ {model.size_label}+ </span>+ </span>+ }+ />+ )+ })}+ </div>++ {lastError?.kind === 'model-download' && (+ <p className="text-[0.75rem] text-destructive">{lastError.error}</p>+ )}+ </SettingsSection>+ </SettingsContent>+ )+}diff --git a/apps/desktop/src/app/settings/primitives.tsx b/apps/desktop/src/app/settings/primitives.tsxindex bbe86a45f2a..b00abcc17c6 100644--- a/apps/desktop/src/app/settings/primitives.tsx+++ b/apps/desktop/src/app/settings/primitives.tsx@@ -22,7 +22,13 @@ export function SettingsContent({ children, bare = false }: { children: ReactNod)}-const PILL_VARIANT = { muted: 'muted', primary: 'default', warn: 'warn' } as const+const PILL_VARIANT = {+ muted: 'muted',+ primary: 'default',+ success: 'success',+ warn: 'warn',+ destructive: 'destructive'+} as constexport function Pill({ tone = 'muted', children }: { tone?: keyof typeof PILL_VARIANT; children: ReactNode }) {return <Badge variant={PILL_VARIANT[tone]}>{children}</Badge>diff --git a/apps/desktop/src/app/settings/providers-settings.tsx b/apps/desktop/src/app/settings/providers-settings.tsxindex 9fb69784ec4..dadb1a78638 100644--- a/apps/desktop/src/app/settings/providers-settings.tsx+++ b/apps/desktop/src/app/settings/providers-settings.tsx@@ -7,6 +7,7 @@ import {FEATURED_ID,FeaturedProviderRow,FireworksProviderRow,+ LocalModelsProviderRow,OpenRouterProviderRow,ProviderRow,providerTitle,@@ -28,6 +29,7 @@ import { isKeyVar, ProviderKeyRows } from './credential-key-ui'import { CustomEndpointsSettings } from './custom-endpoints-settings'import { SettingsCategoryHeading, useEnvCredentials } from './env-credentials'import { providerGroup, providerMeta, providerPriority } from './helpers'+import { LocalModelsSettings } from './local-models-settings'import { SettingsContent, SettingsSkeleton } from './primitives'// The embedded terminal (and thus the "run disconnect command" path) only@@ -45,7 +47,7 @@ function GroupLabel({ children }: { children: ReactNode }) {}// Sub-views surfaced as a sidebar subnav: account sign-in vs raw API keys.-export const PROVIDER_VIEWS = ['accounts', 'keys', 'custom-endpoints'] as const+export const PROVIDER_VIEWS = ['accounts', 'keys', 'custom-endpoints', 'local'] as constexport type ProviderView = (typeof PROVIDER_VIEWS)[number]@@ -128,12 +130,14 @@ function OAuthPicker({onDisconnect,onTerminalDisconnect,onWantApiKey,+ onWantLocalModels,providers}: {disconnecting: null | stringonDisconnect: (provider: OAuthProvider) => voidonTerminalDisconnect: (provider: OAuthProvider) => voidonWantApiKey: () => void+ onWantLocalModels: () => voidproviders: OAuthProvider[]}) {const { t } = useI18n()@@ -177,6 +181,8 @@ function OAuthPicker({{featured && <FeaturedProviderRow onSelect={select} provider={featured} />}{/* Slot #2 — always visible, matching onboarding / CANONICAL_PROVIDERS. */}<FireworksProviderRow onClick={onWantApiKey} />+ {/* Slot #3 — the no-account path, matching onboarding. */}+ <LocalModelsProviderRow onClick={onWantLocalModels} />{connected.length > 0 && (<><GroupLabel>{p.connected}</GroupLabel>@@ -494,6 +500,10 @@ export function ProvidersSettings({return <CustomEndpointsSettings onConfigSaved={onConfigSaved} onMainModelChanged={onMainModelChanged} />}+ if (view === 'local') {+ return <LocalModelsSettings />+ }+return (<SettingsContent><OAuthPicker@@ -501,6 +511,7 @@ export function ProvidersSettings({onDisconnect={provider => void handleDisconnect(provider)}onTerminalDisconnect={handleTerminalDisconnect}onWantApiKey={() => onViewChange('keys')}+ onWantLocalModels={() => onViewChange('local')}providers={oauthProviders}/></SettingsContent>diff --git a/apps/desktop/src/app/shell/hooks/use-statusbar-items.tsx b/apps/desktop/src/app/shell/hooks/use-statusbar-items.tsxindex a4081e9ac77..c1b1a37c4a4 100644--- a/apps/desktop/src/app/shell/hooks/use-statusbar-items.tsx+++ b/apps/desktop/src/app/shell/hooks/use-statusbar-items.tsx@@ -5,6 +5,7 @@ import type { CommandCenterSection } from '@/app/command-center'import { useApprovalModeStatusbarItem } from '@/app/shell/approval-mode-menu'import { ContextUsagePanel } from '@/app/shell/context-usage-panel'import { GatewayMenuPanel } from '@/app/shell/gateway-menu-panel'+import { useSystemResourcesStatusbarItem } from '@/app/shell/system-resources-statusbar'import { $paneVisible, togglePaneVisible } from '@/components/pane-shell/tree/store'import { Codicon } from '@/components/ui/codicon'import { GlyphSpinner } from '@/components/ui/glyph-spinner'@@ -234,6 +235,7 @@ export function useStatusbarItems({)const approvalModeItem = useApprovalModeStatusbarItem(activeGatewayProfile, requestGateway)+ const systemResourcesItem = useSystemResourcesStatusbarItem()const gatewayMenuContent = useMemo(() => (close: () => void) => (@@ -526,9 +528,12 @@ export function useStatusbarItems({},{detail: contextBar || undefined,- hidden: !contextUsage,+ // Never self-hide: the user opted this item in (it's hidden-by-+ // default), so an empty label must render as a waiting placeholder,+ // not a vanished item — an enabled-but-invisible toggle reads as+ // "another item took its spot".id: 'context-usage',- label: contextUsage,+ label: contextUsage || '—',menuAlign: 'end',menuClassName: 'w-auto border-(--ui-stroke-secondary) p-0',menuContent: (@@ -550,6 +555,7 @@ export function useStatusbarItems({toggleLabel: copy.toggleSessionTimer,variant: 'text'},+ systemResourcesItem,{...approvalModeItem,hidden: gatewayState !== 'open',@@ -584,6 +590,7 @@ export function useStatusbarItems({requestGateway,sessionStartedAt,gatewayState,+ systemResourcesItem,terminalShowing,turnStartedAt]diff --git a/apps/desktop/src/app/shell/system-resources-statusbar.tsx b/apps/desktop/src/app/shell/system-resources-statusbar.tsxnew file mode 100644index 00000000000..e4d2ce12570--- /dev/null+++ b/apps/desktop/src/app/shell/system-resources-statusbar.tsx@@ -0,0 +1,157 @@+import { useStore } from '@nanostores/react'+import { useEffect, useState } from 'react'++import type { StatusbarItem } from '@/app/shell/statusbar-controls'+import { getLocalHardware } from '@/hermes'+import { useI18n } from '@/i18n'+import { Activity } from '@/lib/icons'+import { $statusbarHiddenIds } from '@/store/statusbar-prefs'+import type { LocalHardware } from '@/types/hermes'++// Live host-resource readout for the bottom bar: GPU utilization + VRAM ++// RAM, fed by /api/local-models/hardware. Hidden by default (an item most+// users don't watch); the poll runs ONLY while the item is shown, so the+// hidden default costs nothing. 5s cadence — resource numbers, not a+// heartbeat.+const POLL_MS = 5_000++function gb(bytes: number | null | undefined): string {+ return bytes ? `${(bytes / (1 << 30)).toFixed(0)}G` : '—'+}++function gbLong(bytes: number | null | undefined): string {+ return bytes ? `${(bytes / (1 << 30)).toFixed(1)} GB` : '—'+}++function MeterRow({ label, percent, value }: { label: string; percent: number | null; value: string }) {+ return (+ <div className="grid gap-1">+ <div className="flex items-baseline justify-between gap-2">+ <span className="text-muted-foreground">{label}</span>++ <span className="tabular-nums text-foreground">{value}</span>+ </div>++ {percent !== null && (+ <div className="h-1.5 w-full overflow-hidden rounded-full bg-(--ui-bg-tertiary)">+ <div+ className="h-full rounded-full bg-primary transition-[width] duration-500"+ style={{ width: `${Math.max(1, Math.min(100, percent))}%` }}+ />+ </div>+ )}+ </div>+ )+}++export function useSystemResourcesStatusbarItem(): StatusbarItem {+ const { t } = useI18n()+ const copy = t.shell.statusbar.systemResources+ const hiddenIds = useStore($statusbarHiddenIds)+ const shown = !hiddenIds.includes('system-resources')+ const [hardware, setHardware] = useState<LocalHardware | null>(null)++ useEffect(() => {+ if (!shown) {+ return+ }++ let cancelled = false+ let timer: number | null = null++ const poll = async () => {+ try {+ const next = await getLocalHardware()++ if (!cancelled) {+ setHardware(next)+ }+ } catch {+ if (!cancelled) {+ setHardware(null)+ }+ }++ if (!cancelled) {+ timer = window.setTimeout(() => void poll(), POLL_MS)+ }+ }++ void poll()++ return () => {+ cancelled = true++ if (timer !== null) {+ window.clearTimeout(timer)+ }+ }+ }, [shown])++ const hasGpu = Boolean(hardware?.gpu_name)++ const vramPercent =+ hardware?.vram_used_bytes != null && hardware.vram_total_bytes+ ? Math.round((hardware.vram_used_bytes / hardware.vram_total_bytes) * 100)+ : null++ const ramUsed = hardware ? hardware.ram_total_bytes - hardware.ram_available_bytes : null+ const ramPercent = hardware?.ram_total_bytes && ramUsed != null ? Math.round((ramUsed / hardware.ram_total_bytes) * 100) : null++ // Compact bar label: the numbers a local-inference user glances at.+ // "GPU 34% · 18G/32G" with a GPU; "RAM 41G/256G" without.+ const label = hardware+ ? hasGpu+ ? `GPU ${hardware.gpu_util_percent ?? 0}%${+ hardware.vram_used_bytes != null ? ` · ${gb(hardware.vram_used_bytes)}/${gb(hardware.vram_total_bytes)}` : ''+ }`+ : `RAM ${gb(ramUsed)}/${gb(hardware.ram_total_bytes)}`+ : copy.loading++ return {+ detail: undefined,+ hidden: false,+ icon: <Activity className="size-3" />,+ id: 'system-resources',+ label,+ menuAlign: 'end',+ menuClassName: 'w-64 p-0',+ menuContent: (+ <div className="grid gap-3 p-3 text-[0.75rem]" data-slot="system-resources-panel">+ <div className="flex items-baseline justify-between gap-2">+ <p className="font-medium text-foreground">{copy.title}</p>++ {hardware?.gpu_name && (+ <span className="truncate text-[0.6875rem] text-muted-foreground">{hardware.gpu_name}</span>+ )}+ </div>++ {hasGpu && (+ <MeterRow+ label={copy.gpuUtilization}+ percent={hardware?.gpu_util_percent ?? null}+ value={`${hardware?.gpu_util_percent ?? 0}%`}+ />+ )}++ {hasGpu && (+ <MeterRow+ label={copy.gpuMemory}+ percent={vramPercent}+ value={`${gbLong(hardware?.vram_used_bytes)} / ${gbLong(hardware?.vram_total_bytes)}`}+ />+ )}++ <MeterRow+ label={copy.ram}+ percent={ramPercent}+ value={`${gbLong(ramUsed)} / ${gbLong(hardware?.ram_total_bytes)}`}+ />++ {hardware?.uma && <p className="text-[0.6875rem] text-muted-foreground">{copy.unifiedNote}</p>}+ </div>+ ),+ toggleLabel: copy.toggle,+ variant: 'menu'+ }+}diff --git a/apps/desktop/src/components/onboarding/index.tsx b/apps/desktop/src/components/onboarding/index.tsxindex 3b44c4cba05..0e37a7321fb 100644--- a/apps/desktop/src/components/onboarding/index.tsx+++ b/apps/desktop/src/components/onboarding/index.tsx@@ -32,6 +32,7 @@ import { DocsLink, FlowPanel, Status } from './flow'import {FeaturedProviderRow,FireworksProviderRow,+ LocalModelsProviderRow,OpenRouterProviderRow,ProviderRow,sortProviders@@ -41,6 +42,7 @@ export {FeaturedProviderRow,FireworksProviderRow,KeyProviderRow,+ LocalModelsProviderRow,OpenRouterProviderRow,ProviderRow,providerTitle,@@ -474,10 +476,28 @@ export function Picker({ ctx }: { ctx: OnboardingContext }) {const collapsible = Boolean(featured)const showRest = !collapsible || showAll+ // "Run models locally" leaves the picker for Settings -> Providers ->+ // Local Models, where install/download live. First-run: persist the skip+ // (same contract as ChooseLaterLink) so the blocking overlay never+ // re-nags; manual mode just closes. window.location keeps this picker+ // router-independent (it renders outside the route tree on first run).+ const openLocalModels = () => {+ if (manual) {+ closeManualOnboarding()+ } else {+ dismissFirstRunOnboarding()+ }++ window.location.hash = '#/settings?tab=providers&pview=local'+ }+return (<div className="grid gap-2"><div className="grid max-h-[60dvh] gap-2 overflow-y-auto p-1">{featured ? <FeaturedProviderRow onSelect={select} provider={featured} /> : null}+ {/* The no-account path stays always-visible: everything runs on+ this machine. (Fireworks moved into the expanded list on main.) */}+ <LocalModelsProviderRow onClick={openLocalModels} />{showRest ? (<>{/* Fireworks leads the expanded list, matching CANONICAL_PROVIDERSdiff --git a/apps/desktop/src/components/onboarding/providers.tsx b/apps/desktop/src/components/onboarding/providers.tsxindex 1240efa95e6..d5ab346788a 100644--- a/apps/desktop/src/components/onboarding/providers.tsx+++ b/apps/desktop/src/components/onboarding/providers.tsx@@ -95,6 +95,14 @@ export function FireworksProviderRow({ onClick }: { onClick: () => void }) {return <KeyProviderRow onClick={onClick} pitch={t.onboarding.fireworksPitch} title="Fireworks AI" />}+/** Onboarding row for the managed local runtime: no account, no key — the+ * destination is the Local Models pane where install/download live. */+export function LocalModelsProviderRow({ onClick }: { onClick: () => void }) {+ const { t } = useI18n()++ return <KeyProviderRow onClick={onClick} pitch={t.onboarding.localModelsPitch} title={t.onboarding.localModelsTitle} />+}+export function OpenRouterProviderRow({ onClick }: { onClick: () => void }) {const { t } = useI18n()diff --git a/apps/desktop/src/components/ui/badge.tsx b/apps/desktop/src/components/ui/badge.tsxindex c4e46e52361..37bf13b2725 100644--- a/apps/desktop/src/components/ui/badge.tsx+++ b/apps/desktop/src/components/ui/badge.tsx@@ -13,6 +13,7 @@ const badgeVariants = cva(variant: {default: 'bg-primary/10 text-primary',muted: 'bg-muted text-muted-foreground',+ success: 'bg-emerald-500/10 text-emerald-600 dark:text-emerald-300',warn: 'bg-amber-500/10 text-amber-600 dark:text-amber-300',destructive: 'bg-destructive/10 text-destructive',outline: 'border border-(--ui-stroke-secondary) text-muted-foreground'diff --git a/apps/desktop/src/hermes.ts b/apps/desktop/src/hermes.tsindex b3722926d27..4da0bd8ea1d 100644--- a/apps/desktop/src/hermes.ts+++ b/apps/desktop/src/hermes.ts@@ -25,6 +25,10 @@ import type {EnvVarInfo,HermesConfig,HermesConfigRecord,+ LocalCatalogModel,+ LocalHardware,+ LocalModelsStatus,+ LocalRuntimeJob,LogsResponse,McpCatalogResponse,McpServerSummary,@@ -788,6 +792,96 @@ export function getStatus(): Promise<StatusResponse> {})}+// ── Managed local runtime (llama.cpp) ──────────────────────────++export function getLocalModelsStatus(): Promise<LocalModelsStatus> {+ return window.hermesDesktop.api<LocalModelsStatus>({+ ...profileScoped(),+ path: '/api/local-models/status'+ })+}++export function getLocalHardware(): Promise<LocalHardware> {+ return window.hermesDesktop.api<LocalHardware>({+ ...profileScoped(),+ path: '/api/local-models/hardware'+ })+}++export function getLocalCatalog(): Promise<{ models: LocalCatalogModel[] }> {+ return window.hermesDesktop.api<{ models: LocalCatalogModel[] }>({+ ...profileScoped(),+ path: '/api/local-models/catalog'+ })+}++export function installLocalRuntime(backend?: string): Promise<{ job_id: string; backend: string; tag: string }> {+ return window.hermesDesktop.api<{ job_id: string; backend: string; tag: string }>({+ ...profileScoped(),+ path: '/api/local-models/runtime/install',+ method: 'POST',+ body: { backend: backend ?? null }+ })+}++export function downloadLocalModel(modelId: string): Promise<{ job_id: string | null; already_downloaded?: boolean }> {+ return window.hermesDesktop.api<{ job_id: string | null; already_downloaded?: boolean }>({+ ...profileScoped(),+ path: '/api/local-models/download',+ method: 'POST',+ body: { model_id: modelId }+ })+}++export function deleteLocalModel(modelId: string): Promise<{ ok: boolean }> {+ return window.hermesDesktop.api<{ ok: boolean }>({+ ...profileScoped(),+ path: `/api/local-models/models/${encodeURIComponent(modelId)}`,+ method: 'DELETE'+ })+}++export function getLocalRuntimeJob(jobId: string): Promise<LocalRuntimeJob> {+ return window.hermesDesktop.api<LocalRuntimeJob>({+ ...profileScoped(),+ path: `/api/local-models/jobs/${encodeURIComponent(jobId)}`+ })+}++export function getLocalModelsJobs(): Promise<{ jobs: LocalRuntimeJob[] }> {+ return window.hermesDesktop.api<{ jobs: LocalRuntimeJob[] }>({+ ...profileScoped(),+ path: '/api/local-models/jobs'+ })+}++export function activateLocalModel(modelId: string): Promise<{ job_id: string }> {+ return window.hermesDesktop.api<{ job_id: string }>({+ ...profileScoped(),+ path: '/api/local-models/activate',+ method: 'POST',+ body: { model_id: modelId }+ })+}++export function ejectLocalModel(modelId: string): Promise<{ ok: boolean }> {+ return window.hermesDesktop.api<{ ok: boolean }>({+ ...profileScoped(),+ path: '/api/local-models/eject',+ method: 'POST',+ body: { model_id: modelId }+ })+}++export function setLocalServer(action: 'start' | 'stop'): Promise<{ ok: boolean }> {+ return window.hermesDesktop.api<{ ok: boolean }>({+ ...profileScoped(),+ path: '/api/local-models/server',+ method: 'POST',+ body: { action }+ })+}+export function getLogs(params: {component?: stringfile?: stringdiff --git a/apps/desktop/src/i18n/en.ts b/apps/desktop/src/i18n/en.tsindex b0b3d46fbe2..48ccafeb403 100644--- a/apps/desktop/src/i18n/en.ts+++ b/apps/desktop/src/i18n/en.ts@@ -343,6 +343,7 @@ export const en: Translations = {providerAccounts: 'Accounts',providerApiKeys: 'API keys',providerCustomEndpoints: 'Custom Endpoints',+ providerLocalModels: 'Local Models',gateway: 'Gateway',apiKeys: 'Tools & Keys',keybinds: 'Keyboard Shortcuts',@@ -868,6 +869,75 @@ export const en: Translations = {curator: { label: 'Curator', hint: 'Skill-usage review' }}},+ localModels: {+ title: 'Local Models',+ runtimeTitle: 'Local runtime',+ runtimeReady: backend => `Ready · ${backend}`,+ serverRunning: 'Running',+ runtimeInstalled: 'llama.cpp runtime installed',+ runtimeInstalledDetail: (tag, backend) =>+ `Build ${tag}, ${backend} backend. Hermes starts and manages the server for you.`,+ installTitle: 'Install the local runtime',+ installDetail:+ 'Downloads the llama.cpp inference engine (a few hundred MB). Models you download run entirely on this machine — no account, nothing leaves your computer.',+ installAction: 'Install runtime',+ installing: 'Installing runtime…',+ installFailed: 'Runtime install failed',+ hardwareTitle: 'This machine',+ hardwareLoading: 'Checking your hardware…',+ vram: label => `${label} GPU memory`,+ ram: label => `${label} RAM`,+ unifiedMemory: 'Unified memory',+ modelsTitle: 'Models',+ recommended: 'Recommended',+ downloaded: 'Downloaded',+ downloadAction: size => `Download · ${size}`,+ downloadProgress: (done, total) => `${done} of ${total}`,+ downloadDoneToast: model => `${model} is downloaded and ready to use.`,+ installDoneToast: 'Local runtime installed and ready.',+ useAction: 'Use',+ activePill: 'Default',+ updateTitle: 'Engine update available',+ updateDetail: (next, current) => `A newer llama.cpp build (${next}) is ready to install — you're on ${current}. Models keep working during the download.`,+ updateAction: 'Update engine',+ updating: 'Updating engine…',+ upToDateTitle: 'Engine up to date',+ upToDateDetail: (tag, backend) => `Running llama.cpp ${tag} (${backend}) — the latest build Hermes ships.`,+ updateToast: next => `A newer local engine build (${next}) is available. Update from Settings → Local Models.`,+ activeDetail: 'New chats use this model — it loads when you send your first message',+ activeNotLoaded: 'Loads on your first message',+ loadedPill: 'In memory',+ loadingPill: 'Loading…',+ ejectTip: 'Free GPU memory (loads again on the next message)',+ ejected: 'Model unloaded — GPU memory freed.',+ ejectFailed: 'Could not unload the model',+ stopServer: 'Turn off',+ startServer: 'Turn on',+ runtimeRunningDetail: 'The local server is running. Turning it off frees all GPU memory and stops new chats from using local models until you turn it back on.',+ serverStopped: 'Local server stopped — GPU memory freed.',+ serverStarted: 'Local server running.',+ serverStopFailed: 'Could not stop the local server',+ serverStartFailed: 'Could not start the local server',+ activating: 'Starting…',+ activateFailed: model => `Could not switch to ${model}`,+ activateDoneToast: model => `${model} is now your model — new chats will use it.`,+ verifying: 'Verifying download…',+ downloadFailed: model => `Download of ${model} failed`,+ pillFitsGpu: 'Fits your GPU',+ pillUsesRam: 'Uses system RAM',+ pillTooBig: 'Too big for this machine',+ pillFullContext: max => `Full ${max} context`,+ pillFullContextTip: "Runs at the model's complete context window from the start",+ pillStarts: start => `Starts at ${start}`,+ pillStartsTip: 'The context window it opens with — sized to run fast on your hardware',+ pillUpTo: max => `Up to ${max}`,+ pillGrowsTip: 'Grows automatically as your conversation needs more room',+ pillVision: 'Sees images',+ deleteAction: 'Delete model',+ deleteConfirm: model => `Delete ${model} from disk?`,+ deleted: model => `${model} deleted.`,+ deleteFailed: 'Delete failed'+ },providers: {connectAccount: 'Connect an account',haveApiKey: 'Have an API key instead?',@@ -2390,6 +2460,8 @@ export const en: Translations = {connected: 'Connected',featuredPitch: 'One subscription, 300+ frontier models — the recommended way to run Hermes',fireworksPitch: 'Direct model API — Fireworks-hosted frontier models',+ localModelsTitle: 'Run models locally',+ localModelsPitch: 'No account needed — download a model and run it on this machine',openRouterPitch: 'One key, hundreds of models — a solid default',apiKeyOptions: {fireworks: {@@ -2585,6 +2657,15 @@ export const en: Translations = {openStarmap: 'Open memory graph',turnRunning: 'Running',contextUsage: 'Context usage',+ systemResources: {+ title: 'System Resources',+ loading: 'Resources…',+ gpuUtilization: 'GPU utilization',+ gpuMemory: 'GPU memory',+ ram: 'RAM',+ unifiedNote: 'Unified memory — the GPU and system share this pool.',+ toggle: 'System resources'+ },contextUsagePanel: {categories: {conversation: 'Conversation',diff --git a/apps/desktop/src/i18n/ja.ts b/apps/desktop/src/i18n/ja.tsindex a4e49cc8f69..7dcbce21604 100644--- a/apps/desktop/src/i18n/ja.ts+++ b/apps/desktop/src/i18n/ja.ts@@ -228,6 +228,7 @@ export const ja = defineLocale({providerAccounts: 'アカウント',providerApiKeys: 'API キー',providerCustomEndpoints: 'カスタムエンドポイント',+ providerLocalModels: 'ローカルモデル',gateway: 'ゲートウェイ',apiKeys: 'ツールとキー',keybinds: 'キーボードショートカット',@@ -893,6 +894,75 @@ export const ja = defineLocale({curator: { label: 'キュレーター', hint: 'スキル使用レビュー' }}},+ localModels: {+ title: 'ローカルモデル',+ runtimeTitle: 'ローカルランタイム',+ runtimeReady: backend => `準備完了 · ${backend}`,+ serverRunning: '実行中',+ runtimeInstalled: 'llama.cpp ランタイムをインストール済み',+ runtimeInstalledDetail: (tag, backend) =>+ `ビルド ${tag}、${backend} バックエンド。サーバーは Hermes が起動・管理します。`,+ installTitle: 'ローカルランタイムをインストール',+ installDetail:+ 'llama.cpp 推論エンジン(数百 MB)をダウンロードします。ダウンロードしたモデルはすべてこのマシン上で動作します——アカウント不要、データが外部に送られることはありません。',+ installAction: 'ランタイムをインストール',+ installing: 'ランタイムをインストール中…',+ installFailed: 'ランタイムのインストールに失敗しました',+ hardwareTitle: 'このマシン',+ hardwareLoading: 'ハードウェアを確認中…',+ vram: label => `GPU メモリ ${label}`,+ ram: label => `RAM ${label}`,+ unifiedMemory: 'ユニファイドメモリ',+ modelsTitle: 'モデル',+ recommended: 'おすすめ',+ downloaded: 'ダウンロード済み',+ downloadAction: size => `ダウンロード · ${size}`,+ downloadProgress: (done, total) => `${done} / ${total}`,+ downloadDoneToast: model => `${model} のダウンロードが完了し、使用できます。`,+ installDoneToast: 'ローカルランタイムのインストールが完了しました。',+ useAction: '使用する',+ activePill: 'デフォルト',+ updateTitle: 'エンジンの更新があります',+ updateDetail: (next, current) => `新しい llama.cpp ビルド(${next})をインストールできます——現在は ${current} です。ダウンロード中もモデルは引き続き使えます。`,+ updateAction: 'エンジンを更新',+ updating: 'エンジンを更新中…',+ upToDateTitle: 'エンジンは最新です',+ upToDateDetail: (tag, backend) => `llama.cpp ${tag}(${backend})で動作中——Hermes が提供する最新ビルドです。`,+ updateToast: next => `ローカルエンジンの新しいビルド(${next})があります。設定 → ローカルモデル から更新できます。`,+ activeDetail: '新しいチャットはこのモデルを使用——最初のメッセージ送信時に読み込みます',+ activeNotLoaded: '最初のメッセージで読み込みます',+ loadedPill: '読み込み済み',+ loadingPill: '読み込み中…',+ ejectTip: 'GPU メモリを解放(必要時に再読み込み)',+ ejected: 'モデルをアンロードしました——GPU メモリを解放しました。',+ ejectFailed: 'モデルをアンロードできませんでした',+ stopServer: 'オフにする',+ startServer: 'オンにする',+ runtimeRunningDetail: 'ローカルサーバーが実行中です。オフにすると GPU メモリを全て解放し、再度オンにするまで新しいチャットはローカルモデルを使用しません。',+ serverStopped: 'ローカルサーバーを停止しました——GPU メモリを解放しました。',+ serverStarted: 'ローカルサーバー実行中。',+ serverStopFailed: 'ローカルサーバーを停止できませんでした',+ serverStartFailed: 'ローカルサーバーを起動できませんでした',+ activating: '起動中…',+ activateFailed: model => `${model} への切り替えに失敗しました`,+ activateDoneToast: model => `${model} が現在のモデルになりました——新しいチャットで使用されます。`,+ verifying: 'ダウンロードを検証中…',+ downloadFailed: model => `${model} のダウンロードに失敗しました`,+ pillFitsGpu: 'GPU に完全に収まります',+ pillUsesRam: 'システム RAM を使用',+ pillTooBig: 'このマシンには大きすぎます',+ pillFullContext: max => `フル ${max} コンテキスト`,+ pillFullContextTip: '最初からモデルの完全なコンテキストウィンドウで動作します',+ pillStarts: start => `${start} から開始`,+ pillStartsTip: '開始時のコンテキストウィンドウ——ハードウェアに合わせて高速に動作するサイズです',+ pillUpTo: max => `最大 ${max}`,+ pillGrowsTip: '会話が必要とするにつれて自動的に拡張します',+ pillVision: '画像対応',+ deleteAction: 'モデルを削除',+ deleteConfirm: model => `${model} をディスクから削除しますか?`,+ deleted: model => `${model} を削除しました。`,+ deleteFailed: '削除に失敗しました'+ },providers: {connectAccount: 'アカウントを接続',haveApiKey: 'API キーをお持ちですか?',@@ -2177,6 +2247,8 @@ export const ja = defineLocale({connected: '接続済み',featuredPitch: '1 つのサブスクリプションで 300 以上の最先端モデル — Hermes を実行するための推奨方法',fireworksPitch: '直接モデル API — Fireworks がホストする最先端モデル',+ localModelsTitle: 'モデルをローカルで実行',+ localModelsPitch: 'アカウント不要——モデルをダウンロードしてこのマシンで実行',openRouterPitch: '1 つのキーで数百のモデル — 堅実なデフォルト',apiKeyOptions: {fireworks: {@@ -2358,6 +2430,15 @@ export const ja = defineLocale({openStarmap: 'メモリグラフを開く',turnRunning: '実行中',contextUsage: 'コンテキスト使用状況',+ systemResources: {+ title: 'システムリソース',+ loading: 'リソース…',+ gpuUtilization: 'GPU 使用率',+ gpuMemory: 'GPU メモリ',+ ram: 'RAM',+ unifiedNote: 'ユニファイドメモリ——GPU とシステムがこのプールを共有します。',+ toggle: 'システムリソース'+ },contextUsagePanel: {categories: {conversation: '会話',diff --git a/apps/desktop/src/i18n/types.ts b/apps/desktop/src/i18n/types.tsindex 4772ef6561b..d48c8801cce 100644--- a/apps/desktop/src/i18n/types.ts+++ b/apps/desktop/src/i18n/types.ts@@ -293,6 +293,7 @@ export interface Translations {providerAccounts: stringproviderApiKeys: stringproviderCustomEndpoints: string+ providerLocalModels: stringgateway: stringapiKeys: stringkeybinds: string@@ -737,6 +738,73 @@ export interface Translations {notInCatalog: stringtasks: Record<string, AuxTaskCopy>}+ localModels: {+ title: string+ runtimeTitle: string+ runtimeReady: (backend: string) => string+ serverRunning: string+ runtimeInstalled: string+ runtimeInstalledDetail: (tag: string, backend: string) => string+ installTitle: string+ installDetail: string+ installAction: string+ installing: string+ installFailed: string+ hardwareTitle: string+ hardwareLoading: string+ vram: (label: string) => string+ ram: (label: string) => string+ unifiedMemory: string+ modelsTitle: string+ recommended: string+ downloaded: string+ downloadAction: (size: string) => string+ downloadProgress: (done: string, total: string) => string+ downloadDoneToast: (model: string) => string+ installDoneToast: string+ useAction: string+ activePill: string+ updateTitle: string+ updateDetail: (next: string, current: string) => string+ updateAction: string+ updating: string+ upToDateTitle: string+ upToDateDetail: (tag: string, backend: string) => string+ updateToast: (next: string) => string+ activeDetail: string+ activeNotLoaded: string+ loadedPill: string+ loadingPill: string+ ejectTip: string+ ejected: string+ ejectFailed: string+ stopServer: string+ startServer: string+ runtimeRunningDetail: string+ serverStopped: string+ serverStarted: string+ serverStopFailed: string+ serverStartFailed: string+ activating: string+ activateFailed: (model: string) => string+ activateDoneToast: (model: string) => string+ verifying: string+ downloadFailed: (model: string) => string+ pillFitsGpu: string+ pillUsesRam: string+ pillTooBig: string+ pillFullContext: (max: string) => string+ pillFullContextTip: string+ pillStarts: (start: string) => string+ pillStartsTip: string+ pillUpTo: (max: string) => string+ pillGrowsTip: string+ pillVision: string+ deleteAction: string+ deleteConfirm: (model: string) => string+ deleted: (model: string) => string+ deleteFailed: string+ }providers: {connectAccount: stringhaveApiKey: string@@ -2004,6 +2072,8 @@ export interface Translations {connected: stringfeaturedPitch: stringfireworksPitch: string+ localModelsTitle: string+ localModelsPitch: stringopenRouterPitch: stringapiKeyOptions: Record<string, { short: string; description: string }>backToSignIn: string@@ -2177,6 +2247,15 @@ export interface Translations {openStarmap: stringturnRunning: stringcontextUsage: string+ systemResources: {+ title: string+ loading: string+ gpuUtilization: string+ gpuMemory: string+ ram: string+ unifiedNote: string+ toggle: string+ }contextUsagePanel: {categories: {conversation: stringdiff --git a/apps/desktop/src/i18n/zh-hant.ts b/apps/desktop/src/i18n/zh-hant.tsindex 1020be810d1..4595c1a9f88 100644--- a/apps/desktop/src/i18n/zh-hant.ts+++ b/apps/desktop/src/i18n/zh-hant.ts@@ -222,6 +222,7 @@ export const zhHant = defineLocale({providerAccounts: '帳號',providerApiKeys: 'API 金鑰',providerCustomEndpoints: '自訂端點',+ providerLocalModels: '本地模型',gateway: '閘道',apiKeys: '工具與金鑰',keybinds: '鍵盤快捷鍵',@@ -865,6 +866,74 @@ export const zhHant = defineLocale({curator: { label: '策展器', hint: '技能使用審查' }}},+ localModels: {+ title: '本地模型',+ runtimeTitle: '本地執行環境',+ runtimeReady: backend => `就緒 · ${backend}`,+ serverRunning: '執行中',+ runtimeInstalled: '已安裝 llama.cpp 執行環境',+ runtimeInstalledDetail: (tag, backend) => `組建 ${tag},${backend} 後端。Hermes 會為您啟動並管理伺服器。`,+ installTitle: '安裝本地執行環境',+ installDetail:+ '下載 llama.cpp 推理引擎(數百 MB)。下載的模型完全在本機執行——無需帳號,資料不會離開您的電腦。',+ installAction: '安裝執行環境',+ installing: '正在安裝執行環境…',+ installFailed: '執行環境安裝失敗',+ hardwareTitle: '本機配置',+ hardwareLoading: '正在檢測硬體…',+ vram: label => `${label} 顯示記憶體`,+ ram: label => `${label} 記憶體`,+ unifiedMemory: '統一記憶體',+ modelsTitle: '模型',+ recommended: '推薦',+ downloaded: '已下載',+ downloadAction: size => `下載 · ${size}`,+ downloadProgress: (done, total) => `${done} / ${total}`,+ downloadDoneToast: model => `${model} 已下載完成,可以使用。`,+ installDoneToast: '本地執行環境已安裝就緒。',+ useAction: '使用',+ activePill: '預設',+ updateTitle: '引擎有可用更新',+ updateDetail: (next, current) => `新的 llama.cpp 組建(${next})可以安裝——目前為 ${current}。下載期間模型仍可正常使用。`,+ updateAction: '更新引擎',+ updating: '正在更新引擎…',+ upToDateTitle: '引擎已是最新',+ upToDateDetail: (tag, backend) => `正在執行 llama.cpp ${tag}(${backend})——Hermes 提供的最新組建。`,+ updateToast: next => `本地引擎有新組建(${next})。可在 設定 → 本地模型 中更新。`,+ activeDetail: '新對話使用此模型——傳送首條訊息時載入',+ activeNotLoaded: '首條訊息時載入',+ loadedPill: '已載入',+ loadingPill: '載入中…',+ ejectTip: '釋放顯示記憶體(需要時重新載入)',+ ejected: '模型已卸載——顯示記憶體已釋放。',+ ejectFailed: '無法卸載模型',+ stopServer: '關閉',+ startServer: '開啟',+ runtimeRunningDetail: '本地伺服器執行中。關閉後將釋放全部顯示記憶體,新對話將不再使用本地模型,直到您重新開啟。',+ serverStopped: '本地伺服器已停止——顯示記憶體已釋放。',+ serverStarted: '本地伺服器執行中。',+ serverStopFailed: '無法停止本地伺服器',+ serverStartFailed: '無法啟動本地伺服器',+ activating: '啟動中…',+ activateFailed: model => `無法切換到 ${model}`,+ activateDoneToast: model => `${model} 現在是您的模型——新對話將使用它。`,+ verifying: '正在驗證下載…',+ downloadFailed: model => `${model} 下載失敗`,+ pillFitsGpu: '完全在 GPU 上執行',+ pillUsesRam: '使用系統記憶體',+ pillTooBig: '超出本機記憶體',+ pillFullContext: max => `完整 ${max} 上下文`,+ pillFullContextTip: '從一開始就以模型的完整上下文視窗執行',+ pillStarts: start => `起始 ${start}`,+ pillStartsTip: '開啟時的上下文視窗——已按您的硬體調整為快速執行',+ pillUpTo: max => `最高 ${max}`,+ pillGrowsTip: '隨著對話需要更多空間自動增長',+ pillVision: '識圖',+ deleteAction: '刪除模型',+ deleteConfirm: model => `從磁碟刪除 ${model}?`,+ deleted: model => `已刪除 ${model}。`,+ deleteFailed: '刪除失敗'+ },providers: {connectAccount: '連結帳號',haveApiKey: '改用 API 金鑰?',@@ -2109,6 +2178,8 @@ export const zhHant = defineLocale({connected: '已連線',featuredPitch: '一個訂閱,300+ 前沿模型 — 執行 Hermes 的建議方式',fireworksPitch: '直接模型 API — Fireworks 託管的前沿模型',+ localModelsTitle: '本地執行模型',+ localModelsPitch: '無需帳號——下載模型,在本機執行',openRouterPitch: '一個金鑰,數百個模型 — 穩定的預設選擇',apiKeyOptions: {fireworks: { short: '直接模型 API', description: '直接存取 Fireworks AI 託管的模型。' },@@ -2281,6 +2352,15 @@ export const zhHant = defineLocale({openStarmap: '開啟記憶圖譜',turnRunning: '執行中',contextUsage: '上下文使用量',+ systemResources: {+ title: '系統資源',+ loading: '資源…',+ gpuUtilization: 'GPU 使用率',+ gpuMemory: '顯示記憶體',+ ram: '記憶體',+ unifiedNote: '統一記憶體——GPU 與系統共享此記憶體池。',+ toggle: '系統資源'+ },contextUsagePanel: {categories: {conversation: '對話',diff --git a/apps/desktop/src/i18n/zh.ts b/apps/desktop/src/i18n/zh.tsindex d33f5e1b59e..f0343179926 100644--- a/apps/desktop/src/i18n/zh.ts+++ b/apps/desktop/src/i18n/zh.ts@@ -332,6 +332,7 @@ export const zh: Translations = {providerAccounts: '账号',providerApiKeys: 'API 密钥',providerCustomEndpoints: '自定义端点',+ providerLocalModels: '本地模型',gateway: '网关',apiKeys: '工具与密钥',keybinds: '键盘快捷键',@@ -1070,6 +1071,73 @@ export const zh: Translations = {curator: { label: '维护器', hint: '技能使用审查' }}},+ localModels: {+ title: '本地模型',+ runtimeTitle: '本地运行时',+ runtimeReady: backend => `就绪 · ${backend}`,+ serverRunning: '运行中',+ runtimeInstalled: '已安装 llama.cpp 运行时',+ runtimeInstalledDetail: (tag, backend) => `构建 ${tag},${backend} 后端。Hermes 会为您启动并管理服务器。`,+ installTitle: '安装本地运行时',+ installDetail: '下载 llama.cpp 推理引擎(几百 MB)。下载的模型完全在本机运行——无需账号,数据不会离开您的电脑。',+ installAction: '安装运行时',+ installing: '正在安装运行时…',+ installFailed: '运行时安装失败',+ hardwareTitle: '本机配置',+ hardwareLoading: '正在检测硬件…',+ vram: label => `${label} 显存`,+ ram: label => `${label} 内存`,+ unifiedMemory: '统一内存',+ modelsTitle: '模型',+ recommended: '推荐',+ downloaded: '已下载',+ downloadAction: size => `下载 · ${size}`,+ downloadProgress: (done, total) => `${done} / ${total}`,+ downloadDoneToast: model => `${model} 已下载完成,可以使用。`,+ installDoneToast: '本地运行时已安装就绪。',+ useAction: '使用',+ activePill: '默认',+ updateTitle: '引擎有可用更新',+ updateDetail: (next, current) => `新的 llama.cpp 构建(${next})可以安装——当前为 ${current}。下载期间模型仍可正常使用。`,+ updateAction: '更新引擎',+ updating: '正在更新引擎…',+ upToDateTitle: '引擎已是最新',+ upToDateDetail: (tag, backend) => `正在运行 llama.cpp ${tag}(${backend})——Hermes 提供的最新构建。`,+ updateToast: next => `本地引擎有新构建(${next})。可在 设置 → 本地模型 中更新。`,+ activeDetail: '新对话使用此模型——发送首条消息时加载',+ activeNotLoaded: '首条消息时加载',+ loadedPill: '已加载',+ loadingPill: '加载中…',+ ejectTip: '释放显存(需要时重新加载)',+ ejected: '模型已卸载——显存已释放。',+ ejectFailed: '无法卸载模型',+ stopServer: '关闭',+ startServer: '开启',+ runtimeRunningDetail: '本地服务器正在运行。关闭后将释放全部显存,新对话将不再使用本地模型,直到您重新开启。',+ serverStopped: '本地服务器已停止——显存已释放。',+ serverStarted: '本地服务器运行中。',+ serverStopFailed: '无法停止本地服务器',+ serverStartFailed: '无法启动本地服务器',+ activating: '启动中…',+ activateFailed: model => `无法切换到 ${model}`,+ activateDoneToast: model => `${model} 现在是您的模型——新对话将使用它。`,+ verifying: '正在校验下载…',+ downloadFailed: model => `${model} 下载失败`,+ pillFitsGpu: '完全在 GPU 上运行',+ pillUsesRam: '使用系统内存',+ pillTooBig: '超出本机内存',+ pillFullContext: max => `完整 ${max} 上下文`,+ pillFullContextTip: '从一开始就以模型的完整上下文窗口运行',+ pillStarts: start => `起始 ${start}`,+ pillStartsTip: '打开时的上下文窗口——已按您的硬件调整为快速运行',+ pillUpTo: max => `最高 ${max}`,+ pillGrowsTip: '随着对话需要更多空间自动增长',+ pillVision: '识图',+ deleteAction: '删除模型',+ deleteConfirm: model => `从磁盘删除 ${model}?`,+ deleted: model => `已删除 ${model}。`,+ deleteFailed: '删除失败'+ },providers: {connectAccount: '连接账号',haveApiKey: '改用 API 密钥?',@@ -2576,6 +2644,8 @@ export const zh: Translations = {connected: '已连接',featuredPitch: '一个订阅,300+ 前沿模型 — 运行 Hermes 的推荐方式',fireworksPitch: '直接模型 API — Fireworks 托管的前沿模型',+ localModelsTitle: '本地运行模型',+ localModelsPitch: '无需账号——下载模型,在本机运行',openRouterPitch: '一个密钥,数百个模型 — 稳妥的默认选择',apiKeyOptions: {fireworks: { short: '直接模型 API', description: '直接访问 Fireworks AI 托管的模型。' },@@ -2763,6 +2833,15 @@ export const zh: Translations = {openStarmap: '打开记忆图谱',turnRunning: '运行中',contextUsage: '上下文用量',+ systemResources: {+ title: '系统资源',+ loading: '资源…',+ gpuUtilization: 'GPU 利用率',+ gpuMemory: '显存',+ ram: '内存',+ unifiedNote: '统一内存——GPU 与系统共享此内存池。',+ toggle: '系统资源'+ },contextUsagePanel: {categories: {conversation: '对话',diff --git a/apps/desktop/src/lib/icons.ts b/apps/desktop/src/lib/icons.tsindex 6b3d5f80cc7..2bbda4dc438 100644--- a/apps/desktop/src/lib/icons.ts+++ b/apps/desktop/src/lib/icons.ts@@ -40,6 +40,7 @@ import {IconEar as Ear,IconEarOff as EarOff,IconEgg as Egg,+ IconPlayerEjectFilled as Eject,IconExternalLink as ExternalLink,IconEye as Eye,IconEyeOff as EyeOff,@@ -167,6 +168,7 @@ export {Ear,EarOff,Egg,+ Eject,ExternalLink,Eye,EyeOff,diff --git a/apps/desktop/src/lib/model-status-label.test.ts b/apps/desktop/src/lib/model-status-label.test.tsindex d1ad06fb73e..326296dd27e 100644--- a/apps/desktop/src/lib/model-status-label.test.ts+++ b/apps/desktop/src/lib/model-status-label.test.ts@@ -1,6 +1,6 @@import { describe, expect, it } from 'vitest'-import { currentPickerSelection, displayModelName, formatModelStatusLabel } from './model-status-label'+import { currentPickerSelection, displayModelName, formatModelStatusLabel, modelDisplayParts } from './model-status-label'import { reasoningEffortLabel } from './reasoning-effort'describe('model-status-label', () => {@@ -16,6 +16,18 @@ describe('model-status-label', () => {expect(displayModelName('anthropic/claude-haiku-4-5-20251001')).toBe('Haiku 4 5')})+ it('renders local GGUF ids as a clean name with a quant tag', () => {+ expect(modelDisplayParts('Qwen3.6-27B-UD-Q4_K_XL')).toEqual({ name: 'Qwen3.6 27B', tag: 'Q4' })+ expect(modelDisplayParts('Nemotron-3-Nano-30B-A3B-UD-Q4_K_XL')).toEqual({+ name: 'Nemotron 3 Nano 30B A3B',+ tag: 'Q4'+ })+ expect(modelDisplayParts('Qwen3-4B-Instruct-2507-UD-Q8_K_XL')).toEqual({ name: 'Qwen3 4B', tag: 'Q8' })+ expect(modelDisplayParts('some-model-Q6_K')).toEqual({ name: 'Some Model', tag: 'Q6' })+ // Cloud ids keep their existing behavior.+ expect(modelDisplayParts('anthropic/claude-opus-4.8-fast').tag).toBe('Fast')+ })+it('maps reasoning effort to compact labels', () => {expect(reasoningEffortLabel('high')).toBe('High')expect(reasoningEffortLabel('xhigh')).toBe('XHigh')diff --git a/apps/desktop/src/lib/model-status-label.ts b/apps/desktop/src/lib/model-status-label.tsindex 5dde20746f8..62af16cd383 100644--- a/apps/desktop/src/lib/model-status-label.ts+++ b/apps/desktop/src/lib/model-status-label.ts@@ -75,12 +75,26 @@ export function modelDisplayParts(model: string): { name: string; tag: string }let base = modelBaseId(model)let tag = ''- for (const [pattern, label] of VARIANT_TAGS) {- if (pattern.test(base)) {- tag = label- base = base.replace(pattern, '')+ // Local GGUF ids carry a quant suffix (`…-UD-Q4_K_XL`, `…-Q8_0`). Render it+ // as a quiet tag — "Qwen3.6 27B · Q4" — never as part of the name. Without+ // this the composer pill reads raw quant soup ("Qwen3.6 27B UD Q4 K XL").+ const quant = base.match(/-(?:UD-)?(Q\d(?:_[A-Z0-9]+)*|IQ\d(?:_[A-Z0-9]+)*|F16|BF16)$/i)++ if (quant) {+ tag = quant[1].split('_')[0].toUpperCase()+ base = base.slice(0, -quant[0].length)+ // Instruct/chat markers are noise once the quant confirmed a local build.+ base = base.replace(/-(?:Instruct|Chat)(?:-\d{4})?$/i, '')+ }++ if (!tag) {+ for (const [pattern, label] of VARIANT_TAGS) {+ if (pattern.test(base)) {+ tag = label+ base = base.replace(pattern, '')- break+ break+ }}}diff --git a/apps/desktop/src/store/local-runtime-jobs.ts b/apps/desktop/src/store/local-runtime-jobs.tsnew file mode 100644index 00000000000..7ec47da9df4--- /dev/null+++ b/apps/desktop/src/store/local-runtime-jobs.ts@@ -0,0 +1,151 @@+import { atom } from 'nanostores'++import { getLocalModelsJobs, getLocalModelsStatus } from '@/hermes'+import { translateNow } from '@/i18n'+import { notify, notifyError } from '@/store/notifications'+import type { LocalRuntimeJob } from '@/types/hermes'++// App-level tracker for local-runtime jobs (runtime installs, model+// downloads). The AUTHORITY is the backend job registry — this store is a+// cache of it (desktop guide: server truth is cached, not owned). Living at+// the store layer, not in the settings pane, is what makes a download+// survive the pane unmounting: anything can start a job, the poller follows+// it to completion, and completion/failure notify app-wide exactly once.++export const $localRuntimeJobs = atom<readonly LocalRuntimeJob[]>([])++const POLL_ACTIVE_MS = 700+let timer: null | number = null+let polling = false+// Jobs we've already toasted for, so a poll race can't double-notify.+const settledNotified = new Set<string>()++function jobsEqual(a: readonly LocalRuntimeJob[], b: readonly LocalRuntimeJob[]) {+ if (a.length !== b.length) {+ return false+ }++ return a.every((job, i) => {+ const other = b[i]++ return (+ job.job_id === other.job_id &&+ job.status === other.status &&+ job.phase === other.phase &&+ job.done_bytes === other.done_bytes+ )+ })+}++function notifySettled(previous: readonly LocalRuntimeJob[], next: readonly LocalRuntimeJob[]) {+ const wasRunning = new Set(previous.filter(j => j.status === 'running').map(j => j.job_id))++ for (const job of next) {+ if (job.status === 'running' || !wasRunning.has(job.job_id) || settledNotified.has(job.job_id)) {+ continue+ }++ settledNotified.add(job.job_id)++ if (job.status === 'done') {+ notify({+ durationMs: 6_000,+ kind: 'success',+ title: translateNow('settings.localModels.title'),+ message:+ job.kind === 'model-download'+ ? translateNow('settings.localModels.downloadDoneToast', job.target)+ : job.kind === 'model-activate'+ ? translateNow('settings.localModels.activateDoneToast', job.target)+ : translateNow('settings.localModels.installDoneToast')+ })+ } else {+ notifyError(+ new Error(job.error ?? job.detail ?? 'failed'),+ job.kind === 'model-download'+ ? translateNow('settings.localModels.downloadFailed', job.target)+ : job.kind === 'model-activate'+ ? translateNow('settings.localModels.activateFailed', job.target)+ : translateNow('settings.localModels.installFailed')+ )+ }+ }+}++async function poll() {+ try {+ const { jobs } = await getLocalModelsJobs()+ const previous = $localRuntimeJobs.get()++ if (!jobsEqual(previous, jobs)) {+ notifySettled(previous, jobs)+ $localRuntimeJobs.set(jobs)+ }+ } catch {+ // Backend unreachable — keep the last snapshot; the next poll retries.+ }++ const anyRunning = $localRuntimeJobs.get().some(j => j.status === 'running')++ if (anyRunning) {+ timer = window.setTimeout(() => void poll(), POLL_ACTIVE_MS)+ } else {+ polling = false+ timer = null+ }+}++// Idempotent kick: start (or keep) the poll loop while work is in flight.+// Call after starting a job AND on app boot (to rediscover work started+// before a reload).+export function watchLocalRuntimeJobs() {+ if (polling) {+ return+ }++ polling = true++ if (timer !== null) {+ window.clearTimeout(timer)+ }++ void poll()+}++// Selector: the running download job for a catalog model id, if any.+export function runningDownloadFor(jobs: readonly LocalRuntimeJob[], modelId: string): LocalRuntimeJob | null {+ return jobs.find(j => j.kind === 'model-download' && j.status === 'running' && j.model_id === modelId) ?? null+}++export function runningRuntimeInstall(jobs: readonly LocalRuntimeJob[]): LocalRuntimeJob | null {+ return jobs.find(j => j.kind === 'runtime-install' && j.status === 'running') ?? null+}++// One engine-update toast per app session: checked at boot (after the+// gateway is ready), only when the user runs the local engine. The+// download itself is always a button click in Local Models — this is a+// pointer, not an installer.+let updateNotified = false++export async function checkLocalRuntimeUpdate() {+ if (updateNotified) {+ return+ }++ try {+ const status = await getLocalModelsStatus()++ if (status.enabled && status.update_available) {+ updateNotified = true+ notify({+ durationMs: 10_000,+ kind: 'info',+ title: translateNow('settings.localModels.title'),+ message: translateNow('settings.localModels.updateToast', status.configured_tag)+ })+ }+ } catch {+ // Backend without the endpoint (older runtime) or transient failure —+ // silently skip; the pane still shows the update row when opened.+ }+}diff --git a/apps/desktop/src/store/statusbar-prefs.ts b/apps/desktop/src/store/statusbar-prefs.tsindex 7318e18d7e0..9be85c5ce42 100644--- a/apps/desktop/src/store/statusbar-prefs.ts+++ b/apps/desktop/src/store/statusbar-prefs.ts@@ -25,6 +25,7 @@ export const STATUSBAR_HIDDEN_BY_DEFAULT: readonly string[] = ['cron','running-timer','session-timer',+ 'system-resources','terminal','webhooks']diff --git a/apps/desktop/src/types/hermes.ts b/apps/desktop/src/types/hermes.tsindex 2afe4e44a79..a5384ef22a4 100644--- a/apps/desktop/src/types/hermes.ts+++ b/apps/desktop/src/types/hermes.ts@@ -1159,6 +1159,76 @@ export interface StatusResponse {version: string}+// ── Managed local runtime (llama.cpp) ──────────────────────────++export interface LocalModelsStatus {+ enabled: boolean+ tag: string+ configured_tag: string+ update_available: boolean+ runtime_installed: boolean+ runtime_backend: string | null+ server_running: boolean+ server_base_url: string | null+ active_model_id: string | null+ loaded_models: Record<string, string>+ models: { id: string; size_bytes: number; size_label: string }[]+ models_dir: string+}++export interface LocalHardware {+ uma: boolean+ vram_total_bytes: number+ vram_usable_bytes: number+ ram_total_bytes: number+ ram_available_bytes: number+ vram_label: string+ gpu_name: string | null+ gpu_util_percent: number | null+ vram_used_bytes: number | null+}++export interface LocalCatalogModel {+ id: string+ display_name: string+ description: string+ size_bytes: number+ size_label: string+ native_context: number+ native_context_label: string+ tags: string[]+ downloaded: boolean+ downloaded_model_id?: string | null+ downloaded_quant?: string | null+ mtp: boolean+ vision?: boolean+ fits: boolean+ fit_summary: string+ fit_detail?: string+ model_id?: string+ quant?: string+ quant_reason?: string+ quant_validated?: boolean+ variant_count?: number+ start_window?: number+ start_window_label?: string+ spilled?: boolean+}++export interface LocalRuntimeJob {+ job_id: string+ kind: 'runtime-install' | 'model-download' | 'model-activate'+ target: string+ model_id: string | null+ status: 'running' | 'done' | 'error'+ phase: string+ detail: string+ total_bytes: number | null+ done_bytes: number+ percent?: number+ error: string | null+}+export interface ActionResponse {name: stringok: boolean