Skip to content

Dodaios is an open-source agent OS for your desktop: it runs your coding agents, browser and apps by voice or chat, on your own machine. Formerly Personal Jarvis.

feat(local-models): the Local models section skeleton — sidebar row, Open button on the Ollama row, Simple|Advanced rail

rubenluetke10-beepb8c1c7ea038d
diff --git a/jarvis/cli_ctl/reserved.py b/jarvis/cli_ctl/reserved.py
index 69dfe56200..088e6b9b03 100644
--- a/jarvis/cli_ctl/reserved.py
+++ b/jarvis/cli_ctl/reserved.py
@@ -11,6 +11,7 @@ so dispatch is stable as the curated surface grows. A parity test
(``tests/unit/cli_ctl/test_dispatch.py``) asserts none of these collide with a
launcher flag or command.
"""
+
from __future__ import annotations
# Control command groups + meta commands routed to the control CLI.
@@ -44,6 +45,7 @@ RESERVED_CONTROL_NAMES: frozenset[str] = frozenset(
"clis",
"mcps",
"marketplace",
+ "local-models",
"docs",
"frontier",
"ide",
diff --git a/jarvis/plugins/tool/navigate.py b/jarvis/plugins/tool/navigate.py
index 99073babe4..8ae5dd7536 100644
--- a/jarvis/plugins/tool/navigate.py
+++ b/jarvis/plugins/tool/navigate.py
@@ -11,6 +11,7 @@ A direct safe-gated UI action, never a spawn — it never enters a worker tool-s
(AP-5/AP-14). ``KNOWN`` mirrors the frontend ``SECTION_IDS`` (store/events.ts);
a parity test (tests/unit/plugins/tool/test_navigate.py) guards against drift.
"""
+
from __future__ import annotations
from typing import Any
@@ -40,6 +41,8 @@ KNOWN: frozenset[str] = frozenset(
"profile",
"memory",
"apikeys",
+ # Local models: the Ollama server, installed models and the catalogue.
+ "local-models",
"settings",
"telephony",
"telephony-setup",
@@ -134,6 +137,13 @@ _ALIASES: dict[str, str] = {
"notizen": "memory",
"notiz": "memory",
"wiki": "memory",
+ "local models": "local-models",
+ "local-models": "local-models",
+ "local model": "local-models",
+ "ollama": "local-models",
+ "lokale modelle": "local-models", # i18n-allow: input vocab
+ "lokale models": "local-models", # i18n-allow: input vocab
+ "modelos locales": "local-models", # i18n-allow: input vocab
"api keys": "apikeys",
"api-keys": "apikeys",
"api key": "apikeys",
@@ -264,8 +274,7 @@ class NavigateTool:
"type": "string",
"enum": sorted(KNOWN),
"description": (
- "The sidebar section id to open "
- "(e.g. 'socials', 'settings', 'agents')."
+ "The sidebar section id to open (e.g. 'socials', 'settings', 'agents')."
),
}
},
diff --git a/jarvis/ui/web/frontend/src/components/layout/MainView.tsx b/jarvis/ui/web/frontend/src/components/layout/MainView.tsx
index 989d634b1c..07e0e6092f 100644
--- a/jarvis/ui/web/frontend/src/components/layout/MainView.tsx
+++ b/jarvis/ui/web/frontend/src/components/layout/MainView.tsx
@@ -85,6 +85,9 @@ const WikiView = lazyView(() =>
const ApiKeysView = lazyView(() =>
import("@/views/ApiKeysView").then((m) => ({ default: m.ApiKeysView })),
);
+const LocalModelsView = lazyView(() =>
+ import("@/views/LocalModelsView").then((m) => ({ default: m.LocalModelsView })),
+);
const ExtensionsView = lazyView(() =>
import("@/views/ExtensionsView").then((m) => ({ default: m.ExtensionsView })),
);
@@ -94,8 +97,8 @@ const ExtensionsView = lazyView(() =>
const AgenticIdeView = lazyPropView<AgenticIdeViewProps>(() =>
import("@/views/AgenticIdeView").then((m) => ({ default: m.AgenticIdeView })),
);
-const TasksView = lazyView(() =>
- import("@/views/TasksView").then((m) => ({ default: m.TasksView })),
+const AutomationsView = lazyView(() =>
+ import("@/views/AutomationsView").then((m) => ({ default: m.AutomationsView })),
);
const SessionsView = lazyView(() =>
import("@/views/SessionsView").then((m) => ({ default: m.SessionsView })),
@@ -434,7 +437,7 @@ function SwitchOnActiveSection({ active }: { active: string }) {
case "docs":
return <DocsView />;
case "tasks":
- return <TasksView />;
+ return <AutomationsView />;
case "sessions":
return <SessionsView />;
case "run_inspector":
@@ -454,6 +457,10 @@ function SwitchOnActiveSection({ active }: { active: string }) {
case "apikeys":
case "telephony":
return <ApiKeysView />;
+ // The local-model section: server, installed models and the catalogue.
+ // Reached from the sidebar row and the "Open" button on the Ollama row.
+ case "local-models":
+ return <LocalModelsView />;
// Dedicated telephony setup page (scripts + step-by-step guide). Not a
// sidebar entry — reached only via the "Setup script" button in the
// telephony credentials card.
diff --git a/jarvis/ui/web/frontend/src/components/layout/navGroups.ts b/jarvis/ui/web/frontend/src/components/layout/navGroups.ts
index 579969f096..4b5009fd73 100644
--- a/jarvis/ui/web/frontend/src/components/layout/navGroups.ts
+++ b/jarvis/ui/web/frontend/src/components/layout/navGroups.ts
@@ -13,9 +13,9 @@ import {
BookOpen,
Boxes,
Contact,
+ Cpu,
Gauge,
KeyRound,
- ListTodo,
MessageSquare,
MessageSquareWarning,
MessagesSquare,
@@ -31,6 +31,7 @@ import {
UserCircle2,
Users,
Wallet,
+ Workflow,
Image as ImageIcon,
type LucideIcon,
} from "lucide-react";
@@ -117,7 +118,9 @@ export const NAV_GROUPS: NavItem[][] = [
],
// 2) Content & data — things the user reads, edits, or browses.
[
- { id: "tasks", labelKey: "nav.tasks", icon: ListTodo },
+ // Automations — the recurring agent tasks and their catalogue. The id stays
+ // "tasks" (navigate parity, deep links); only the label and glyph changed.
+ { id: "tasks", labelKey: "nav.tasks", icon: Workflow, fallbackLabel: "Automations" },
{ id: "sessions", labelKey: "nav.sessions", icon: Mic },
{ id: "run_inspector", labelKey: "nav.run_inspector", icon: Gauge },
// Spend & Tokens — every token the app spent, priced per provider,
@@ -161,6 +164,14 @@ export const NAV_GROUPS: NavItem[][] = [
icon: KeyRound,
matchIds: ["apikeys", "telephony", "telephony-setup"],
},
+ // Local models sit directly under API Keys: the same "which brain" question,
+ // answered for the machine itself instead of a hosted account.
+ {
+ id: "local-models",
+ labelKey: "nav.local_models",
+ icon: Cpu,
+ fallbackLabel: "Local models",
+ },
{
id: "settings",
labelKey: "nav.settings",
diff --git a/jarvis/ui/web/frontend/src/components/providers/ProviderTierSection.tsx b/jarvis/ui/web/frontend/src/components/providers/ProviderTierSection.tsx
index 34357a928c..16fb55c07c 100644
--- a/jarvis/ui/web/frontend/src/components/providers/ProviderTierSection.tsx
+++ b/jarvis/ui/web/frontend/src/components/providers/ProviderTierSection.tsx
@@ -1025,6 +1025,7 @@ export function ProviderCard({
const [consentPending, setConsentPending] = useState(false);
const pushToast = useEventStore((s) => s.pushToast);
const assistantName = useEventStore((s) => s.assistantName);
+ const setActiveSection = useEventStore((s) => s.setActiveSection);
const recordVerdict = useProviderTestStore((s) => s.record);
// The card only escalates to red for a real "set up but failing" error — the
// amber "needs setup" case stays on the tab + the open/ready badge so a fresh,
@@ -1431,6 +1432,24 @@ export function ProviderCard({
</p>
</div>
+ {/* Pull-capable servers have a section of their own; the row still
+ opens/activates the provider as before (rowGestures ignores anything
+ marked data-agent-card-control). */}
+ {descriptor.supports_model_pull && (
+ <button
+ type="button"
+ data-agent-card-control
+ data-testid={`provider-open-local-models-${descriptor.id}`}
+ onClick={(e) => {
+ e.stopPropagation();
+ setActiveSection("local-models");
+ }}
+ className="inline-flex h-7 shrink-0 items-center gap-1.5 rounded-md border border-border/70 px-2.5 text-xs font-medium text-foreground/90 transition-colors hover:bg-secondary/60 hover:text-foreground"
+ >
+ <Cpu aria-hidden="true" className="h-3.5 w-3.5" />
+ {t("apikeys_view.local_models_open")}
+ </button>
+ )}
<ActiveControl
descriptor={
isCodexBrain
@@ -2892,15 +2911,20 @@ function ManagedServerPanel({
* stopped it offers Start, when it is absent it offers a confirmed Install
* (official ollama.com artifacts only, backend-authored status sentences
* rendered verbatim). Mounted on pull-capable cards and inside the managed
- * realtime card's blocked-brain state.
+ * realtime card's blocked-brain state. The Local models section mounts it
+ * with `alwaysVisible`, where a healthy server shows one green running line
+ * instead of disappearing — a dedicated Server tab must never look empty.
*/
-function OllamaRuntimePanel({
+export function OllamaRuntimePanel({
providerId,
onChanged,
+ alwaysVisible = false,
}: {
/** The pull-capable card whose runtime routes this panel drives. */
providerId: string;
onChanged: () => void;
+ /** Render the healthy state too (a green running line) instead of nothing. */
+ alwaysVisible?: boolean;
}) {
const t = useT();
const [status, setStatus] = useState<OllamaRuntimeStatus | null>(null);
@@ -2983,7 +3007,25 @@ function OllamaRuntimePanel({
};
if (status === null) return null;
- if (status.running && !installing) return null; // healthy — stay out of the way
+ if (status.running && !installing) {
+ if (!alwaysVisible) return null; // healthy — stay out of the way
+ return (
+ <div
+ className="flex items-start gap-2 text-xs"
+ data-testid="ollama-runtime-panel"
+ data-state="running"
+ >
+ <span
+ aria-hidden="true"
+ className="mt-1 h-2 w-2 shrink-0 rounded-full bg-emerald-500"
+ />
+ <span className="text-muted-foreground">
+ {status.detail ||
+ t("apikeys_view.ollama_running_line").replace("{0}", status.version || "")}
+ </span>
+ </div>
+ );
+ }
return (
<div
@@ -3057,7 +3099,7 @@ function OllamaRuntimePanel({
* the field still pulls whatever is typed, so a machine that cannot reach the
* public catalog keeps the exact-name path it always had.
*/
-function LibraryBrowser({
+export function LibraryBrowser({
providerId,
onPull,
onInstalledSelect,
@@ -3704,6 +3746,18 @@ export function AuthWidget({
coveredNote={descriptor.credential_note ?? null}
sharedWith={descriptor.secret_shared_with?.[k] ?? []}
credentialHelp={descriptor.credential_help}
+ // A pasted key is checked right away — the dictation polish
+ // family owns its own probe, so it keeps the manual Test button.
+ testAfterSave={
+ descriptor.tier === "dictation"
+ ? undefined
+ : {
+ id: descriptor.id,
+ label: descriptor.label,
+ section: descriptor.tier,
+ active: descriptor.active,
+ }
+ }
onChanged={onChanged}
onSavedActivate={onSavedActivate}
/>
diff --git a/jarvis/ui/web/frontend/src/i18n/index.ts b/jarvis/ui/web/frontend/src/i18n/index.ts
index 820d68fef1..4dbfa8ba06 100644
--- a/jarvis/ui/web/frontend/src/i18n/index.ts
+++ b/jarvis/ui/web/frontend/src/i18n/index.ts
@@ -79,7 +79,7 @@ const RESOURCES: Record<UiLanguage, Record<string, unknown>> = {
* it mounts. Until the chunk has arrived, `t()` returns the key, so a view
* that cares waits for `ready` before it paints.
*/
-export type LocaleChunk = "marketplace";
+export type LocaleChunk = "marketplace" | "local_models";
const CHUNK_LOADERS: Record<LocaleChunk, Record<UiLanguage, () => Promise<unknown>>> = {
marketplace: {
@@ -87,6 +87,11 @@ const CHUNK_LOADERS: Record<LocaleChunk, Record<UiLanguage, () => Promise<unknow
de: () => import("./locales/marketplace/de.json"),
es: () => import("./locales/marketplace/es.json"),
},
+ local_models: {
+ en: () => import("./locales/local_models/en.json"),
+ de: () => import("./locales/local_models/de.json"),
+ es: () => import("./locales/local_models/es.json"),
+ },
};
const EXTRA: Record<UiLanguage, Record<string, unknown>[]> = { en: [], de: [], es: [] };
diff --git a/jarvis/ui/web/frontend/src/i18n/locales/de.json b/jarvis/ui/web/frontend/src/i18n/locales/de.json
index c5c7769bb1..837a6965a1 100644
--- a/jarvis/ui/web/frontend/src/i18n/locales/de.json
+++ b/jarvis/ui/web/frontend/src/i18n/locales/de.json
@@ -91,6 +91,7 @@
"memory": "Notizen",
"wiki": "Wiki",
"apikeys": "API-Keys",
+ "local_models": "Lokale Modelle",
"settings": "Einstellungen",
"dictionary": "Wörterbuch",
"dictation": "Diktat",
@@ -1636,6 +1637,8 @@
"ollama_install_confirm": "Erneut klicken, um Ollama jetzt zu installieren",
"ollama_install_hint": "Lädt die offizielle Ollama-Laufzeit von ollama.com und startet sie — ganz ohne Terminal. Lokale Modelle laufen vollständig auf diesem Rechner.",
"ollama_start_cta": "Ollama starten",
+ "ollama_running_line": "Ollama {0} läuft.",
+ "local_models_open": "Öffnen",
"managed_brain_picker_title": "Denkmodell für den Sprachserver",
"managed_brain_current": "aktiv",
"managed_brain_recommended": "empfohlen",
diff --git a/jarvis/ui/web/frontend/src/i18n/locales/en.json b/jarvis/ui/web/frontend/src/i18n/locales/en.json
index 5cecabb74a..58ab8017f6 100644
--- a/jarvis/ui/web/frontend/src/i18n/locales/en.json
+++ b/jarvis/ui/web/frontend/src/i18n/locales/en.json
@@ -91,6 +91,7 @@
"memory": "Notes",
"wiki": "Wiki",
"apikeys": "API Keys",
+ "local_models": "Local models",
"settings": "Settings",
"dictionary": "Dictionary",
"dictation": "Dictation",
@@ -1636,6 +1637,8 @@
"ollama_install_confirm": "Click again to install Ollama now",
"ollama_install_hint": "Downloads the official Ollama runtime from ollama.com and starts it — no terminal needed. Local models run entirely on this machine.",
"ollama_start_cta": "Start Ollama",
+ "ollama_running_line": "Ollama {0} is running.",
+ "local_models_open": "Open",
"managed_brain_picker_title": "Brain model for the voice server",
"managed_brain_current": "active",
"managed_brain_recommended": "recommended",
diff --git a/jarvis/ui/web/frontend/src/i18n/locales/es.json b/jarvis/ui/web/frontend/src/i18n/locales/es.json
index e5028d560d..f4ed6034c0 100644
--- a/jarvis/ui/web/frontend/src/i18n/locales/es.json
+++ b/jarvis/ui/web/frontend/src/i18n/locales/es.json
@@ -91,6 +91,7 @@
"memory": "Notas",
"wiki": "Wiki",
"apikeys": "Claves API",
+ "local_models": "Modelos locales",
"settings": "Ajustes",
"dictionary": "Diccionario",
"dictation": "Dictado",
@@ -1634,6 +1635,8 @@
"ollama_install_confirm": "Haz clic de nuevo para instalar Ollama ahora",
"ollama_install_hint": "Descarga el runtime oficial de Ollama desde ollama.com y lo inicia — sin terminal. Los modelos locales se ejecutan por completo en esta máquina.",
"ollama_start_cta": "Iniciar Ollama",
+ "ollama_running_line": "Ollama {0} está en marcha.",
+ "local_models_open": "Abrir",
"managed_brain_picker_title": "Modelo de razonamiento del servidor de voz",
"managed_brain_current": "activo",
"managed_brain_recommended": "recomendado",
diff --git a/jarvis/ui/web/frontend/src/i18n/locales/local_models/de.json b/jarvis/ui/web/frontend/src/i18n/locales/local_models/de.json
new file mode 100644
index 0000000000..c9f3bf401f
--- /dev/null
+++ b/jarvis/ui/web/frontend/src/i18n/locales/local_models/de.json
@@ -0,0 +1,28 @@
+{
+ "local_models": {
+ "title": "Lokale Modelle",
+ "subtitle": "Modelle, die auf diesem Rechner oder auf einem Server deiner Wahl laufen.",
+ "back": "API-Keys",
+ "mode_label": "Detailgrad",
+ "mode_simple": "Einfach",
+ "mode_advanced": "Erweitert",
+ "tabs_label": "Bereiche der lokalen Modelle",
+ "tab_overview": "Überblick",
+ "tab_models": "Modelle",
+ "tab_catalogue": "Katalog",
+ "tab_huggingface": "Hugging Face",
+ "tab_server": "Server",
+ "overview_title": "Überblick",
+ "overview_placeholder": "Rollen, Grafikspeicher und Speicherplatz kommen im nächsten Schritt hierher. Bis dahin funktionieren Katalog und Server bereits.",
+ "models_title": "Installierte Modelle",
+ "models_placeholder": "Die Liste der installierten Modelle kommt mit dem nächsten Schritt.",
+ "catalogue_title": "Katalog",
+ "catalogue_subtitle": "Empfohlene Downloads und die gesamte öffentliche Bibliothek.",
+ "huggingface_title": "Hugging Face",
+ "huggingface_placeholder": "GGUF-Modelle von Hugging Face zu laden ist standardmäßig aus und kommt in einem späteren Schritt.",
+ "server_title": "Server",
+ "server_subtitle": "Wo die Modelle laufen und wie sie erreichbar sind.",
+ "no_provider": "In dieser Version gibt es keinen lokalen Modellserver. Hier kann nichts laufen, solange kein Anbieter Downloads unterstützt.",
+ "loading": "Suche den lokalen Modellserver…"
+ }
+}
diff --git a/jarvis/ui/web/frontend/src/i18n/locales/local_models/en.json b/jarvis/ui/web/frontend/src/i18n/locales/local_models/en.json
new file mode 100644
index 0000000000..f36d745493
--- /dev/null
+++ b/jarvis/ui/web/frontend/src/i18n/locales/local_models/en.json
@@ -0,0 +1,28 @@
+{
+ "local_models": {
+ "title": "Local models",
+ "subtitle": "Models that run on this machine or on a server you name.",
+ "back": "API Keys",
+ "mode_label": "Detail level",
+ "mode_simple": "Simple",
+ "mode_advanced": "Advanced",
+ "tabs_label": "Local model areas",
+ "tab_overview": "Overview",
+ "tab_models": "Models",
+ "tab_catalogue": "Catalogue",
+ "tab_huggingface": "Hugging Face",
+ "tab_server": "Server",
+ "overview_title": "Overview",
+ "overview_placeholder": "Roles, graphics memory and disk usage land here next. Until then the Catalogue and Server tabs already work.",
+ "models_title": "Installed models",
+ "models_placeholder": "The installed-models ledger arrives with the next step.",
+ "catalogue_title": "Catalogue",
+ "catalogue_subtitle": "Recommended downloads and the whole public library.",
+ "huggingface_title": "Hugging Face",
+ "huggingface_placeholder": "Pulling GGUF models from Hugging Face is off by default and arrives with a later step.",
+ "server_title": "Server",
+ "server_subtitle": "Where the models run and how to reach them.",
+ "no_provider": "No local model server is available in this build. Nothing here can run until a pull-capable provider exists.",
+ "loading": "Looking for the local model server…"
+ }
+}
diff --git a/jarvis/ui/web/frontend/src/i18n/locales/local_models/es.json b/jarvis/ui/web/frontend/src/i18n/locales/local_models/es.json
new file mode 100644
index 0000000000..dd5151dbde
--- /dev/null
+++ b/jarvis/ui/web/frontend/src/i18n/locales/local_models/es.json
@@ -0,0 +1,28 @@
+{
+ "local_models": {
+ "title": "Modelos locales",
+ "subtitle": "Modelos que se ejecutan en esta máquina o en un servidor que tú indiques.",
+ "back": "Claves API",
+ "mode_label": "Nivel de detalle",
+ "mode_simple": "Sencillo",
+ "mode_advanced": "Avanzado",
+ "tabs_label": "Áreas de modelos locales",
+ "tab_overview": "Resumen",
+ "tab_models": "Modelos",
+ "tab_catalogue": "Catálogo",
+ "tab_huggingface": "Hugging Face",
+ "tab_server": "Servidor",
+ "overview_title": "Resumen",
+ "overview_placeholder": "Los roles, la memoria gráfica y el uso de disco llegarán en el siguiente paso. Mientras tanto, Catálogo y Servidor ya funcionan.",
+ "models_title": "Modelos instalados",
+ "models_placeholder": "La lista de modelos instalados llega con el siguiente paso.",
+ "catalogue_title": "Catálogo",
+ "catalogue_subtitle": "Descargas recomendadas y toda la biblioteca pública.",
+ "huggingface_title": "Hugging Face",
+ "huggingface_placeholder": "Descargar modelos GGUF desde Hugging Face está desactivado por defecto y llegará en un paso posterior.",
+ "server_title": "Servidor",
+ "server_subtitle": "Dónde se ejecutan los modelos y cómo llegar a ellos.",
+ "no_provider": "Esta versión no incluye ningún servidor de modelos locales. Nada puede funcionar aquí hasta que exista un proveedor que admita descargas.",
+ "loading": "Buscando el servidor de modelos locales…"
+ }
+}
diff --git a/jarvis/ui/web/frontend/src/store/events.ts b/jarvis/ui/web/frontend/src/store/events.ts
index 2019e223ed..ccd47fe2a0 100644
--- a/jarvis/ui/web/frontend/src/store/events.ts
+++ b/jarvis/ui/web/frontend/src/store/events.ts
@@ -70,6 +70,9 @@ export type SectionId =
| "profile"
| "memory"
| "apikeys"
+ // Local models: the Ollama server, its installed models and the catalogue,
+ // in one section instead of a card body inside API Keys.
+ | "local-models"
| "settings"
| "telephony"
| "telephony-setup"
@@ -122,6 +125,7 @@ export const SECTION_IDS = [
"profile",
"memory",
"apikeys",
+ "local-models",
"settings",
"telephony",
"telephony-setup",
@@ -210,6 +214,7 @@ export const SECTION_LABELS: Record<SectionId, string> = {
profile: "Profile",
memory: "Notes",
apikeys: "API Keys",
+ "local-models": "Local models",
settings: "Settings",
telephony: "Telephony",
"telephony-setup": "Telephony setup",
diff --git a/jarvis/ui/web/frontend/src/views/LocalModelsView.test.tsx b/jarvis/ui/web/frontend/src/views/LocalModelsView.test.tsx
new file mode 100644
index 0000000000..0c61d18297
--- /dev/null
+++ b/jarvis/ui/web/frontend/src/views/LocalModelsView.test.tsx
@@ -0,0 +1,112 @@
+import { cleanup, fireEvent, render, screen } from "@testing-library/react";
+import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
+
+const { mockState, mockProviders } = vi.hoisted(() => ({
+ mockState: {
+ activeSection: "local-models" as string,
+ setActiveSection: vi.fn(),
+ },
+ mockProviders: {
+ providers: [] as Array<Record<string, unknown>>,
+ loading: false,
+ error: null as string | null,
+ refetch: vi.fn(async () => undefined),
+ },
+}));
+
+vi.mock("@/store/events", () => ({
+ useEventStore: (selector: (s: typeof mockState) => unknown) => selector(mockState),
+}));
+
+vi.mock("@/i18n", () => ({
+ // Identity translator: assertions match the keys themselves.
+ useT: () => (key: string) => key,
+ useLocaleChunk: () => true,
+}));
+
+vi.mock("@/hooks/useProviders", () => ({
+ useProviders: () => mockProviders,
+}));
+
+// The provider-card panels have their own tests; here only their mount matters.
+vi.mock("@/components/providers/ProviderTierSection", () => ({
+ OllamaRuntimePanel: ({ alwaysVisible }: { alwaysVisible?: boolean }) => (
+ <div data-testid="runtime-panel" data-always={alwaysVisible ? "true" : "false"} />
+ ),
+ BaseUrlField: () => <div data-testid="base-url-field" />,
+ LocalModelDownloadPanel: () => <div data-testid="download-panel" />,
+}));
+
+import { LOCAL_MODELS_MODE_KEY, LocalModelsView } from "@/views/LocalModelsView";
+
+const OLLAMA = {
+ id: "ollama",
+ label: "Ollama",
+ supports_model_pull: true,
+ supports_base_url: true,
+};
+
+beforeEach(() => {
+ window.localStorage.removeItem(LOCAL_MODELS_MODE_KEY);
+ mockState.setActiveSection = vi.fn();
+ mockProviders.providers = [OLLAMA];
+ mockProviders.loading = false;
+});
+
+afterEach(() => {
+ cleanup();
+ vi.clearAllMocks();
+});
+
+describe("LocalModelsView", () => {
+ it("renders the header, the Simple rail and the overview by default", () => {
+ render(<LocalModelsView />);
+
+ expect(screen.getByText("local_models.title")).toBeDefined();
+ expect(screen.getByRole("tab", { name: "local_models.tab_overview" })).toBeDefined();
+ expect(screen.getByRole("tab", { name: "local_models.tab_catalogue" })).toBeDefined();
+ expect(screen.getByRole("tab", { name: "local_models.tab_server" })).toBeDefined();
+ // Simple hides the Advanced-only tabs.
+ expect(screen.queryByRole("tab", { name: "local_models.tab_models" })).toBeNull();
+ expect(screen.queryByRole("tab", { name: "local_models.tab_huggingface" })).toBeNull();
+ expect(screen.getByTestId("local-models-overview")).toBeDefined();
+ });
+
+ it("switches tabs and mounts the existing panels on Catalogue and Server", () => {
+ render(<LocalModelsView />);
+
+ fireEvent.click(screen.getByRole("tab", { name: "local_models.tab_catalogue" }));
+ expect(screen.getByTestId("download-panel")).toBeDefined();
+ expect(screen.queryByTestId("local-models-overview")).toBeNull();
+
+ fireEvent.click(screen.getByRole("tab", { name: "local_models.tab_server" }));
+ expect(screen.getByTestId("base-url-field")).toBeDefined();
+ expect(screen.getByTestId("runtime-panel").getAttribute("data-always")).toBe("true");
+ });
+
+ it("reveals Models in Advanced and remembers the choice", () => {
+ render(<LocalModelsView />);
+
+ fireEvent.click(screen.getByRole("tab", { name: "local_models.mode_advanced" }));
+ expect(screen.getByRole("tab", { name: "local_models.tab_models" })).toBeDefined();
+ expect(screen.getByRole("tab", { name: "local_models.tab_huggingface" })).toBeDefined();
+ expect(window.localStorage.getItem(LOCAL_MODELS_MODE_KEY)).toBe("advanced");
+
+ fireEvent.click(screen.getByRole("tab", { name: "local_models.tab_models" }));
+ expect(screen.getByTestId("local-models-models")).toBeDefined();
+
+ // Back to Simple: the rail drops Models and the view falls back to Overview.
+ fireEvent.click(screen.getByRole("tab", { name: "local_models.mode_simple" }));
+ expect(screen.queryByRole("tab", { name: "local_models.tab_models" })).toBeNull();
+ expect(screen.getByTestId("local-models-overview")).toBeDefined();
+ });
+
+ it("goes back to API Keys and says so when no server can pull models", () => {
+ mockProviders.providers = [{ id: "openai", label: "OpenAI" }];
+ render(<LocalModelsView />);
+
+ expect(screen.getByText("local_models.no_provider")).toBeDefined();
+ fireEvent.click(screen.getByRole("button", { name: "local_models.back" }));
+ expect(mockState.setActiveSection).toHaveBeenCalledWith("apikeys");
+ });
+});
diff --git a/jarvis/ui/web/frontend/src/views/LocalModelsView.tsx b/jarvis/ui/web/frontend/src/views/LocalModelsView.tsx
new file mode 100644
index 0000000000..42e5d50956
--- /dev/null
+++ b/jarvis/ui/web/frontend/src/views/LocalModelsView.tsx
@@ -0,0 +1,202 @@
+/**
+ * Local models — the section for the models that run on this machine (or on
+ * a server the user names): the Ollama runtime, the installed models, the
+ * public catalogue and, later, Hugging Face.
+ *
+ * Step 1 of the plan: the skeleton. The column layout is the Costs view's,
+ * the header carries a Simple | Advanced switch (persisted per browser) and a
+ * rail of tabs. Models and Hugging Face are Advanced-only; the Catalogue and
+ * Server tabs already mount the existing provider-card panels, the others
+ * hold a placeholder until their own step lands.
+ *
+ * Everything is gated on the capability `supports_model_pull`, never on a
+ * provider name — a second pull-capable server later gets the same section.
+ */
+import { useCallback, useEffect, useMemo, useState } from "react";
+import { ScrollArea } from "@/components/ui/scroll-area";
+import {
+ BackLink,
+ Panel,
+ PanelHeader,
+ SegmentedFilter,
+} from "@/components/extensions/primitives";
+import {
+ BaseUrlField,
+ LocalModelDownloadPanel,
+ OllamaRuntimePanel,
+} from "@/components/providers/ProviderTierSection";
+import { useProviders } from "@/hooks/useProviders";
+import { useEventStore } from "@/store/events";
+import { useLocaleChunk, useT } from "@/i18n";
+
+export type LocalModelsMode = "simple" | "advanced";
+export type LocalModelsTab = "overview" | "models" | "catalogue" | "huggingface" | "server";
+
+/** Browser-local preference; a private window simply starts on Simple. */
+export const LOCAL_MODELS_MODE_KEY = "jarvis.localModels.mode";
+
+const ADVANCED_ONLY: ReadonlySet<LocalModelsTab> = new Set(["models", "huggingface"]);
+
+function readStoredMode(): LocalModelsMode {
+ try {
+ return window.localStorage.getItem(LOCAL_MODELS_MODE_KEY) === "advanced"
+ ? "advanced"
+ : "simple";
+ } catch {
+ // Storage can be blocked (privacy mode, embedded WebView policies); the
+ // preference is a convenience, so the default is the honest answer.
+ return "simple";
+ }
+}
+
+function storeMode(mode: LocalModelsMode): void {
+ try {
+ window.localStorage.setItem(LOCAL_MODELS_MODE_KEY, mode);
+ } catch {
+ // Same as above: nothing to recover, the in-memory state still applies.
+ }
+}
+
+export function LocalModelsView() {
+ const t = useT();
+ useLocaleChunk("local_models");
+ const setActiveSection = useEventStore((s) => s.setActiveSection);
+ const { providers, loading, refetch } = useProviders();
+
+ // The one server that can download models. Capability, not provider id.
+ const descriptor = useMemo(
+ () => providers.find((p) => Boolean(p.supports_model_pull)) ?? null,
+ [providers],
+ );
+
+ const [mode, setMode] = useState<LocalModelsMode>(readStoredMode);
+ const [tab, setTab] = useState<LocalModelsTab>("overview");
+
+ const changeMode = useCallback((next: LocalModelsMode) => {
+ setMode(next);
+ storeMode(next);
+ }, []);
+
+ // Leaving Advanced while on an Advanced-only tab must not strand the user on
+ // a tab the rail no longer shows.
+ useEffect(() => {
+ if (mode === "simple" && ADVANCED_ONLY.has(tab)) setTab("overview");
+ }, [mode, tab]);
+
+ const onChanged = useCallback(() => {
+ void refetch();
+ }, [refetch]);
+
+ const tabs = useMemo(() => {
+ const all: { id: LocalModelsTab; label: string }[] = [
+ { id: "overview", label: t("local_models.tab_overview") },
+ { id: "models", label: t("local_models.tab_models") },
+ { id: "catalogue", label: t("local_models.tab_catalogue") },
+ { id: "huggingface", label: t("local_models.tab_huggingface") },
+ { id: "server", label: t("local_models.tab_server") },
+ ];
+ return mode === "advanced" ? all : all.filter((o) => !ADVANCED_ONLY.has(o.id));
+ }, [mode, t]);
+
+ return (
+ <ScrollArea className="h-full">
+ <div className="mx-auto flex max-w-[1180px] flex-col gap-4 px-6 py-6">
+ <BackLink label={t("local_models.back")} onClick={() => setActiveSection("apikeys")} />
+ <PanelHeader
+ title={t("local_models.title")}
+ subtitle={t("local_models.subtitle")}
+ actions={
+ <SegmentedFilter<LocalModelsMode>
+ label={t("local_models.mode_label")}
+ value={mode}
+ onChange={changeMode}
+ options={[
+ { id: "simple", label: t("local_models.mode_simple") },
+ { id: "advanced", label: t("local_models.mode_advanced") },
+ ]}
+ />
+ }
+ />
+
+ <SegmentedFilter<LocalModelsTab>
+ label={t("local_models.tabs_label")}
+ value={tab}
+ onChange={setTab}
+ options={tabs}
+ />
+
+ {loading && !descriptor && (
+ <p className="text-sm text-muted-foreground">{t("local_models.loading")}</p>
+ )}
+
+ {!loading && !descriptor && (
+ <Panel className="p-4">
+ <p className="text-sm text-muted-foreground">{t("local_models.no_provider")}</p>
+ </Panel>
+ )}
+
+ {descriptor && tab === "overview" && (
+ <Panel className="p-4">
+ <div className="space-y-3" data-testid="local-models-overview">
+ <PanelHeader title={t("local_models.overview_title")} />
+ <OllamaRuntimePanel providerId={descriptor.id} onChanged={onChanged} alwaysVisible />
+ <p className="text-sm text-muted-foreground">
+ {t("local_models.overview_placeholder")}
+ </p>
+ </div>
+ </Panel>
+ )}
+
+ {descriptor && tab === "models" && (
+ <Panel className="p-4">
+ <div className="space-y-3" data-testid="local-models-models">
+ <PanelHeader title={t("local_models.models_title")} />
+ <p className="text-sm text-muted-foreground">
+ {t("local_models.models_placeholder")}
+ </p>
+ </div>
+ </Panel>
+ )}
+
+ {descriptor && tab === "catalogue" && (
+ <Panel className="p-4">
+ <div className="space-y-3" data-testid="local-models-catalogue">
+ <PanelHeader
+ title={t("local_models.catalogue_title")}
+ subtitle={t("local_models.catalogue_subtitle")}
+ />
+ {/* The download panel already embeds the library browser. */}
+ <LocalModelDownloadPanel descriptor={descriptor} onChanged={onChanged} />
+ </div>
+ </Panel>
+ )}
+
+ {descriptor && tab === "huggingface" && (
+ <Panel className="p-4">
+ <div className="space-y-3" data-testid="local-models-huggingface">
+ <PanelHeader title={t("local_models.huggingface_title")} />
+ <p className="text-sm text-muted-foreground">
+ {t("local_models.huggingface_placeholder")}
+ </p>
+ </div>
+ </Panel>
+ )}
+
+ {descriptor && tab === "server" && (
+ <Panel className="p-4">
+ <div className="space-y-3" data-testid="local-models-server">
+ <PanelHeader
+ title={t("local_models.server_title")}
+ subtitle={t("local_models.server_subtitle")}
+ />
+ <OllamaRuntimePanel providerId={descriptor.id} onChanged={onChanged} alwaysVisible />
+ {descriptor.supports_base_url && (
+ <BaseUrlField descriptor={descriptor} onChanged={onChanged} />
+ )}
+ </div>
+ </Panel>
+ )}
+ </div>
+ </ScrollArea>
+ );
+}