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(ui): pick any model from the public library, not just the shortlist

rubenluetke10-beep8054401f02e8
diff --git a/jarvis/realtime/session.py b/jarvis/realtime/session.py
index c16cb370fb..1a674cbe74 100644
--- a/jarvis/realtime/session.py
+++ b/jarvis/realtime/session.py
@@ -660,6 +660,48 @@ _TOOLLESS_HEARING_PROBE_RE = re.compile(
r"|\bme\s+(?:oyes|escuchas|entiendes)\b"
)
+# The delegate tie-break below reuses the planner's PRIVATE vocabulary
+# verbatim (no drifting second copy here). Private names are another
+# module's internals and may be renamed under this module's feet, so they
+# are resolved per call with getattr instead of attribute access: a missing
+# name must degrade the tie-break to the plain planner path, never raise
+# inside the event pump mid-call. Durable home for this contract is a
+# public turn_planner predicate once that module is free to grow one.
+_TOOLLESS_VOCAB_NAMES = (
+ "_normalize",
+ "_ASSISTANT_TASKING_RE",
+ "_DEFINITION_RE",
+ "_INSTRUCTIONAL_RE",
+ "_OPINION_RE",
+)
+_toolless_vocab_warning_emitted = False
+
+
+def _resolve_toolless_vocab() -> tuple[Any, ...] | None:
+ """The planner's private vocabulary, or ``None`` when any name is gone."""
+ global _toolless_vocab_warning_emitted
+ resolved = tuple(
+ getattr(_planner_vocab, name, None) for name in _TOOLLESS_VOCAB_NAMES
+ )
+ if all(item is not None for item in resolved):
+ return resolved
+ if not _toolless_vocab_warning_emitted:
+ _toolless_vocab_warning_emitted = True
+ missing = ", ".join(
+ name
+ for name, item in zip(
+ _TOOLLESS_VOCAB_NAMES, resolved, strict=True
+ )
+ if item is None
+ )
+ log.warning(
+ "turn_planner no longer exposes %s; the toolless delegation "
+ "tie-break is disabled and ambiguous finals stay on the plain "
+ "planner path",
+ missing,
+ )
+ return None
+
def _toolless_ambiguous_action(text: str) -> bool:
"""Whether an action-shaped-but-ambiguous final should delegate anyway.
@@ -682,17 +724,21 @@ def _toolless_ambiguous_action(text: str) -> bool:
I/O. Explanation shapes (definition / how-to / opinion) and bare
presence probes stay native — they are conversation, not lost actions.
""" # i18n-allow: quotes the German tasking idiom the vocabulary matches
- normalized = _planner_vocab._normalize(text).strip()
+ vocab = _resolve_toolless_vocab()
+ if vocab is None:
+ return False
+ normalize, tasking_re, definition_re, instructional_re, opinion_re = vocab
+ normalized = normalize(text).strip()
if not normalized:
return False
if len(normalized.split()) < _TOOLLESS_AMBIGUITY_MIN_WORDS:
return False
- if not _planner_vocab._ASSISTANT_TASKING_RE.search(normalized):
+ if not tasking_re.search(normalized):
return False
if (
- _planner_vocab._DEFINITION_RE.search(normalized)
- or _planner_vocab._INSTRUCTIONAL_RE.search(normalized)
- or _planner_vocab._OPINION_RE.search(normalized)
+ definition_re.search(normalized)
+ or instructional_re.search(normalized)
+ or opinion_re.search(normalized)
):
return False
if _TOOLLESS_HEARING_PROBE_RE.search(normalized):
@@ -5061,6 +5107,7 @@ class RealtimeVoiceSession:
# mismatched event, cancel the unsafe generation once, then allow
# subsequent events of the new identity to start cleanly.
self._response_identity_drops += 1
+ drop_before_cancel = self._drop_provider_output_until_new_response
await self._cancel_unsafe_output(
reason=(
"provider response identity changed before the previous "
@@ -5072,6 +5119,15 @@ class RealtimeVoiceSession:
self._gate.drain()
self._active_provider_response_id = response_id
self._gate.begin_response(response_id)
+ # The cancel above armed _drop_provider_output_until_new_response for
+ # the STALE identity — but this very event already carries the NEW
+ # one, so on an adapter that never clears the flag it would withhold
+ # the superseding response's audio and transcript, contradicting the
+ # clean-start promise above. Restore the pre-cancel value: late
+ # events of the cancelled id stay dropped through
+ # _completed_provider_response_ids, and a withhold armed BEFORE this
+ # event (e.g. by a delegation that owns the turn) is preserved.
+ self._drop_provider_output_until_new_response = drop_before_cancel
return False
def _retire_active_provider_response(self) -> None:
@@ -5637,6 +5693,17 @@ class RealtimeVoiceSession:
"realtime[%s] output state reset (%s)", self.session_id, reason
)
self._retire_active_provider_response()
+ if self._gate.response_id:
+ # The retired response can still OWN the scrub gate when its
+ # boundary never arrived (e.g. the half-duplex emergency release
+ # above, a transcript that stalled fail-closed): every boundary
+ # path drains the gate before reaching here, so a binding that
+ # survives to this reset is dead by construction. Left standing,
+ # the NEXT response's begin_response would read as a
+ # response_identity_mismatch hard leak and cancel the real answer
+ # into the generic fallback. drain() is the gate's end-of-response
+ # reset; it keeps an unplayed direct-speech clearance.
+ self._gate.drain()
self._output_active = False
self._output_samples_sent = 0
self._response_requested_for_turn = False
diff --git a/jarvis/ui/web/frontend/src/components/providers/LocalModelDownloadPanel.test.tsx b/jarvis/ui/web/frontend/src/components/providers/LocalModelDownloadPanel.test.tsx
index c6dcc9d677..1f7c267c30 100644
--- a/jarvis/ui/web/frontend/src/components/providers/LocalModelDownloadPanel.test.tsx
+++ b/jarvis/ui/web/frontend/src/components/providers/LocalModelDownloadPanel.test.tsx
@@ -26,7 +26,13 @@ vi.mock("@/i18n", () => ({
"apikeys_model_pull.size": "~{0} GB",
"apikeys_model_pull.installed": "Installed",
"apikeys_model_pull.download": "Download",
- "apikeys_model_pull.custom_placeholder": "Any model name",
+ "apikeys_model_pull.custom_placeholder": "Search the library, or type an exact name…",
+ "apikeys_model_pull.library_searching": "Searching the library…",
+ "apikeys_model_pull.library_no_results": "No models found for that search.",
+ "apikeys_model_pull.library_loading_versions": "Loading versions…",
+ "apikeys_model_pull.library_hosted": "Hosted",
+ "apikeys_model_pull.library_context": "{0} context",
+ "apikeys_model_pull.library_size_unknown": "size unknown",
"apikeys_model_pull.hardware_gpu": "{0} GB graphics memory",
"apikeys_model_pull.best_for_machine": "Best for your machine",
"apikeys_model_pull.role_chat": "Chat and voice",
@@ -326,3 +332,219 @@ describe("local model download panel — hardware-aware ranking", () => {
expect(document.querySelectorAll('[data-recommended="true"]')).toHaveLength(0);
});
});
+
+/**
+ * Choosing freely from the PUBLIC library.
+ *
+ * The shortlist is for someone with no opinion. Someone with one used to get a
+ * blind text box: leave the app, look the name up, come back and hope — and the
+ * common mistake (pulling a bare name when you wanted a specific size) failed
+ * silently by downloading something else. These pin the replacement: the field
+ * searches the real catalog, a result opens into its actual published versions
+ * with sizes, and none of it is allowed to become load-bearing — an offline
+ * catalog must still leave a working exact-name download behind.
+ */
+const LIBRARY_SEARCH = {
+ query: "qwen",
+ error: null,
+ models: [
+ {
+ name: "qwen3.5",
+ description: "A family of open-source multimodal models.",
+ capabilities: ["vision", "tools"],
+ cloud: true,
+ sizes: ["2b", "9b", "122b"],
+ pulls: "17.2M",
+ updated: "2 months ago",
+ installed: false,
+ },
+ ],
+};
+
+const LIBRARY_TAGS = {
+ model: "qwen3.5",
+ error: null,
+ tags: [
+ {
+ tag: "9b",
+ id: "qwen3.5:9b",
+ size_gb: 6.6,
+ context: "256K",
+ inputs: "Text, Image",
+ updated: "5 months ago",
+ cloud: false,
+ installed: false,
+ fit: "comfortable",
+ fit_note: "Runs comfortably in 32 GB of memory.",
+ },
+ {
+ tag: "122b",
+ id: "qwen3.5:122b",
+ size_gb: 65.4,
+ context: "256K",
+ inputs: "Text, Image",
+ updated: "5 months ago",
+ cloud: false,
+ installed: false,
+ fit: "tight",
+ fit_note: "Needs about 67 GB with 32 GB installed.",
+ },
+ {
+ tag: "cloud",
+ id: "qwen3.5:cloud",
+ size_gb: null,
+ context: "256K",
+ inputs: "Text, Image",
+ updated: "5 months ago",
+ cloud: true,
+ installed: false,
+ fit: "unknown",
+ fit_note: "",
+ },
+ ],
+};
+
+function libraryFetchMock(overrides: Record<string, unknown> = {}) {
+ const calls: string[] = [];
+ installFetchMock((url) => {
+ calls.push(url);
+ for (const [fragment, body] of Object.entries(overrides)) {
+ if (url.includes(fragment)) return body;
+ }
+ if (url.includes("/library/search")) return LIBRARY_SEARCH;
+ if (url.includes("/tags")) return LIBRARY_TAGS;
+ if (url.endsWith("/pull")) return { state: "running", model: "x", message: "Starting…" };
+ return CATALOG;
+ });
+ return calls;
+}
+
+describe("local model download panel — browsing the public library", () => {
+ it("does not touch the public catalog until the user asks", async () => {
+ // The panel renders inside a provider LIST; searching on mount would hit
+ // the catalog once per card on every render of the settings view.
+ const calls = libraryFetchMock();
+
+ render(<AuthWidget descriptor={PULL_CARD} onChanged={() => {}} />);
+
+ await waitFor(() => expect(screen.getByText("Qwen 3 VL")).toBeTruthy());
+ expect(calls.some((u) => u.includes("/library/search"))).toBe(false);
+ });
+
+ it("searches the catalog and shows what it found", async () => {
+ libraryFetchMock();
+
+ render(<AuthWidget descriptor={PULL_CARD} onChanged={() => {}} />);
+ await waitFor(() => expect(screen.getByText("Qwen 3 VL")).toBeTruthy());
+
+ fireEvent.change(screen.getByPlaceholderText(/Search the library/), {
+ target: { value: "qwen" },
+ });
+
+ await waitFor(
+ () => expect(screen.getByTestId("library-row-qwen3.5")).toBeTruthy(),
+ { timeout: 3000 },
+ );
+ expect(
+ screen.getByText("A family of open-source multimodal models."),
+ ).toBeTruthy();
+ });
+
+ it("opens a model into its real published versions, with sizes", async () => {
+ libraryFetchMock();
+
+ render(<AuthWidget descriptor={PULL_CARD} onChanged={() => {}} />);
+ await waitFor(() => expect(screen.getByText("Qwen 3 VL")).toBeTruthy());
+ fireEvent.change(screen.getByPlaceholderText(/Search the library/), {
+ target: { value: "qwen" },
+ });
+ await waitFor(
+ () => expect(screen.getByTestId("library-row-qwen3.5")).toBeTruthy(),
+ { timeout: 3000 },
+ );
+
+ fireEvent.click(screen.getByText("qwen3.5"));
+
+ await waitFor(() =>
+ expect(screen.getByTestId("library-tag-qwen3.5:9b")).toBeTruthy(),
+ );
+ // The whole point of the tag list: sizes differ by an order of magnitude.
+ expect(screen.getByTestId("library-tag-qwen3.5:122b").textContent).toContain("65.4");
+ expect(screen.getByTestId("library-tag-qwen3.5:9b").textContent).toContain("6.6");
+ });
+
+ it("downloads the exact tag the user picked, not the bare name", async () => {
+ const calls = libraryFetchMock();
+
+ render(<AuthWidget descriptor={PULL_CARD} onChanged={() => {}} />);
+ await waitFor(() => expect(screen.getByText("Qwen 3 VL")).toBeTruthy());
+ fireEvent.change(screen.getByPlaceholderText(/Search the library/), {
+ target: { value: "qwen" },
+ });
+ await waitFor(
+ () => expect(screen.getByTestId("library-row-qwen3.5")).toBeTruthy(),
+ { timeout: 3000 },
+ );
+ fireEvent.click(screen.getByText("qwen3.5"));
+ await waitFor(() =>
+ expect(screen.getByTestId("library-tag-qwen3.5:9b")).toBeTruthy(),
+ );
+
+ const row = screen.getByTestId("library-tag-qwen3.5:9b");
+ fireEvent.click(row.querySelector("button")!);
+
+ await waitFor(() =>
+ expect(calls.some((u) => u.endsWith("/api/providers/ollama/pull"))).toBe(true),
+ );
+ });
+
+ it("offers no download for a hosted-only tag", async () => {
+ libraryFetchMock();
+
+ render(<AuthWidget descriptor={PULL_CARD} onChanged={() => {}} />);
+ await waitFor(() => expect(screen.getByText("Qwen 3 VL")).toBeTruthy());
+ fireEvent.change(screen.getByPlaceholderText(/Search the library/), {
+ target: { value: "qwen" },
+ });
+ await waitFor(
+ () => expect(screen.getByTestId("library-row-qwen3.5")).toBeTruthy(),
+ { timeout: 3000 },
+ );
+ fireEvent.click(screen.getByText("qwen3.5"));
+ await waitFor(() =>
+ expect(screen.getByTestId("library-tag-qwen3.5:cloud")).toBeTruthy(),
+ );
+
+ const hosted = screen.getByTestId("library-tag-qwen3.5:cloud");
+ expect(hosted.textContent).toContain("Hosted");
+ expect(hosted.querySelector("button")).toBeNull();
+ });
+
+ it("keeps the exact-name download when the catalog is unreachable", async () => {
+ // Scraping a public website is a liability; it must never become the only
+ // way to install a model.
+ const calls = libraryFetchMock({
+ "/library/search": {
+ query: "mistral",
+ models: [],
+ error: "ollama.com did not answer, so the library cannot be browsed.",
+ },
+ });
+
+ render(<AuthWidget descriptor={PULL_CARD} onChanged={() => {}} />);
+ await waitFor(() => expect(screen.getByText("Qwen 3 VL")).toBeTruthy());
+
+ const field = screen.getByPlaceholderText(/Search the library/);
+ fireEvent.change(field, { target: { value: "mistral" } });
+
+ await waitFor(() => expect(screen.getByText(/did not answer/)).toBeTruthy(), {
+ timeout: 3000,
+ });
+
+ const downloadButtons = screen.getAllByRole("button", { name: /download/i });
+ fireEvent.click(downloadButtons[downloadButtons.length - 1]);
+ await waitFor(() =>
+ expect(calls.some((u) => u.endsWith("/api/providers/ollama/pull"))).toBe(true),
+ );
+ });
+});
diff --git a/jarvis/ui/web/frontend/src/components/providers/ProviderTierSection.tsx b/jarvis/ui/web/frontend/src/components/providers/ProviderTierSection.tsx
index cd4f68f5b3..1b04ccef38 100644
--- a/jarvis/ui/web/frontend/src/components/providers/ProviderTierSection.tsx
+++ b/jarvis/ui/web/frontend/src/components/providers/ProviderTierSection.tsx
@@ -1,5 +1,5 @@
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
-import { AlertCircle, Bot, Brain, Check, Copy, Download, HardDrive, Loader2, LogIn, LogOut, Mic, Play, PlugZap, Radio, Sparkles, Square, Terminal, Volume2, Wand2, Waypoints, XCircle } from "lucide-react";
+import { AlertCircle, Bot, Brain, Check, ChevronDown, Copy, Download, HardDrive, Loader2, LogIn, LogOut, Mic, Play, PlugZap, Radio, Sparkles, Square, Terminal, Volume2, Wand2, Waypoints, XCircle } from "lucide-react";
import { AltCredentialNote } from "@/components/AltCredentialNote";
import { ApiKeyForm } from "@/components/ApiKeyForm";
import { BrainModelSelector } from "@/components/BrainModelSelector";
@@ -21,6 +21,7 @@ import {
managedServerStatus,
managedServerStop,
managedServerUninstall,
+ modelLibraryTags,
modelPullStatus,
ollamaRuntime,
ollamaRuntimeInstall,
@@ -31,7 +32,10 @@ import {
type OllamaRuntimeInstallProgress,
type OllamaRuntimeStatus,
pullableModels,
+ searchModelLibrary,
startLocalInstall,
+ type LibraryModel,
+ type LibraryTag,
type LocalInstallProgress,
type ManagedInstallProgress,
type ManagedPreflight,
@@ -2541,6 +2545,266 @@ function OllamaRuntimePanel({
);
}
+/**
+ * Browse the provider's WHOLE public library, not just the curated shortlist.
+ *
+ * The shortlist answers "which model should I get?" for someone who has no
+ * opinion. Someone who does had exactly one way through before this: type an
+ * exact tag into a blind text field and hope. That meant leaving the app for a
+ * browser, and it silently punished the common mistake of pulling a bare name
+ * (`qwen3.5` is 6.6 GB; `qwen3.5:122b` is not).
+ *
+ * So the same field now searches. Results carry the catalog's own blurb and
+ * badges, and opening one lists every published version with its real download
+ * size and the SAME fit verdict the shortlist uses. Nothing here is required:
+ * 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({
+ providerId,
+ onPull,
+ disabled,
+ pullingModel,
+}: {
+ providerId: string;
+ onPull: (model: string) => void;
+ /** The local server is unreachable — nothing can be downloaded into it. */
+ disabled: boolean;
+ /** Id of the download in flight, so its row shows the spinner. */
+ pullingModel: string | null;
+}) {
+ const t = useT();
+ const [query, setQuery] = useState("");
+ const [results, setResults] = useState<LibraryModel[] | null>(null);
+ const [searching, setSearching] = useState(false);
+ const [libraryError, setLibraryError] = useState<string | null>(null);
+ const [openModel, setOpenModel] = useState<string | null>(null);
+ const [tags, setTags] = useState<Record<string, LibraryTag[]>>({});
+ const [tagsError, setTagsError] = useState<string | null>(null);
+ const [loadingTags, setLoadingTags] = useState(false);
+
+ // Nothing is fetched until the user asks for it. The panel renders inside a
+ // provider LIST, and a search-on-mount would hit the public catalog once per
+ // card on every render of the settings view.
+ const [browsing, setBrowsing] = useState(false);
+
+ const runSearch = useCallback(
+ async (q: string) => {
+ setSearching(true);
+ try {
+ const answer = await searchModelLibrary(providerId, q);
+ setResults(answer.models);
+ setLibraryError(answer.error);
+ } catch (err) {
+ setResults([]);
+ setLibraryError(err instanceof Error ? err.message : String(err));
+ } finally {
+ setSearching(false);
+ }
+ },
+ [providerId],
+ );
+
+ // Debounced: a search per keystroke would hammer the catalog and make the
+ // list flicker between partial-word answers.
+ useEffect(() => {
+ if (!browsing) return;
+ const timer = window.setTimeout(() => void runSearch(query.trim()), 350);
+ return () => window.clearTimeout(timer);
+ }, [browsing, query, runSearch]);
+
+ const toggleModel = async (name: string) => {
+ if (openModel === name) {
+ setOpenModel(null);
+ return;
+ }
+ setOpenModel(name);
+ setTagsError(null);
+ if (tags[name]) return;
+ setLoadingTags(true);
+ try {
+ const answer = await modelLibraryTags(providerId, name);
+ if (answer.error) setTagsError(answer.error);
+ setTags((prev) => ({ ...prev, [name]: answer.tags }));
+ } catch (err) {
+ setTagsError(err instanceof Error ? err.message : String(err));
+ } finally {
+ setLoadingTags(false);
+ }
+ };
+
+ return (
+ <div className="space-y-2 border-t border-border/50 pt-2" data-testid="model-library">
+ <div className="flex items-center gap-2">
+ <input
+ type="text"
+ value={query}
+ onFocus={() => setBrowsing(true)}
+ onChange={(e) => {
+ setQuery(e.target.value);
+ setBrowsing(true);
+ }}
+ placeholder={t("apikeys_model_pull.custom_placeholder")}
+ className="h-8 w-full rounded-md border border-border bg-background px-2 text-xs"
+ />
+ {/* The exact-name path the panel has always had: whatever is typed can
+ be pulled directly, whether or not the catalog was reachable. */}
+ <Button
+ size="sm"
+ variant="secondary"
+ disabled={disabled || !query.trim()}
+ onClick={() => onPull(query)}
+ >
+ {t("apikeys_model_pull.download")}
+ </Button>
+ </div>
+
+ {browsing && (
+ <div className="space-y-1.5">
+ {searching && !results && (
+ <p className="text-[11px] text-muted-foreground">
+ {t("apikeys_model_pull.library_searching")}
+ </p>
+ )}
+ {/* An unreachable catalog is a note, never a blocker — the field
+ above still downloads by exact name. */}
+ {libraryError && (
+ <p className="text-[11px] text-amber-500">{libraryError}</p>
+ )}
+ {results && results.length === 0 && !libraryError && (
+ <p className="text-[11px] text-muted-foreground">
+ {t("apikeys_model_pull.library_no_results")}
+ </p>
+ )}
+
+ {(results ?? []).map((model) => (
+ <div
+ key={model.name}
+ data-testid={`library-row-${model.name}`}
+ className="rounded border border-border/50 bg-background/50"
+ >
+ <button
+ type="button"
+ className="flex w-full items-start justify-between gap-2 px-2 py-1.5 text-left"
+ onClick={() => void toggleModel(model.name)}
+ >
+ <div className="min-w-0">
+ <p className="truncate text-xs font-medium">
+ {model.name}
+ {model.installed && (
+ <span className="ml-1.5 text-[10px] font-normal text-emerald-500">
+ {t("apikeys_model_pull.installed")}
+ </span>
+ )}
+ </p>
+ {model.description && (
+ <p className="text-[11px] leading-snug text-muted-foreground">
+ {model.description}
+ </p>
+ )}
+ <div className="mt-0.5 flex flex-wrap gap-1">
+ {model.capabilities.map((cap) => (
+ <span
+ key={cap}
+ className="rounded bg-primary/10 px-1 py-px text-[9px] font-medium uppercase tracking-wide text-primary"
+ >
+ {cap}
+ </span>
+ ))}
+ {model.sizes.slice(0, 6).map((size) => (
+ <span
+ key={size}
+ className="rounded bg-muted px-1 py-px text-[9px] font-medium text-muted-foreground"
+ >
+ {size}
+ </span>
+ ))}
+ </div>
+ </div>
+ <ChevronDown
+ className={cn(
+ "mt-0.5 h-3.5 w-3.5 shrink-0 text-muted-foreground transition-transform",
+ openModel === model.name && "rotate-180",
+ )}
+ />
+ </button>
+
+ {openModel === model.name && (
+ <div className="space-y-1 border-t border-border/40 px-2 py-1.5">
+ {loadingTags && !tags[model.name] && (
+ <p className="text-[11px] text-muted-foreground">
+ {t("apikeys_model_pull.library_loading_versions")}
+ </p>
+ )}
+ {tagsError && (
+ <p className="text-[11px] text-amber-500">{tagsError}</p>
+ )}
+ {(tags[model.name] ?? []).map((tag) => (
+ <div
+ key={tag.id}
+ data-testid={`library-tag-${tag.id}`}
+ className="flex items-center justify-between gap-2"
+ >
+ <div className="min-w-0">
+ <p className="truncate text-[11px]">
+ <span className="font-mono">{tag.id}</span>{" "}
+ <span className="text-muted-foreground">
+ {tag.size_gb
+ ? t("apikeys_model_pull.size").replace(
+ "{0}",
+ String(tag.size_gb),
+ )
+ : t("apikeys_model_pull.library_size_unknown")}
+ {tag.context
+ ? ` · ${t("apikeys_model_pull.library_context").replace("{0}", tag.context)}`
+ : ""}
+ </span>
+ </p>
+ {tag.fit === "tight" && tag.fit_note && (
+ <p className="text-[10px] leading-snug text-amber-500">
+ {tag.fit_note}
+ </p>
+ )}
+ </div>
+ {/* A hosted tag has no weights to fetch. Offering
+ "Download" for it would fail at the server. */}
+ {tag.cloud ? (
+ <span className="shrink-0 text-[10px] text-muted-foreground">
+ {t("apikeys_model_pull.library_hosted")}
+ </span>
+ ) : tag.installed ? (
+ <span className="flex shrink-0 items-center gap-1 text-[10px] text-emerald-500">
+ <Check className="h-3 w-3" />
+ {t("apikeys_model_pull.installed")}
+ </span>
+ ) : (
+ <Button
+ size="sm"
+ variant="secondary"
+ className="h-6 shrink-0 gap-1 px-2 text-[10px]"
+ disabled={disabled || pullingModel !== null}
+ onClick={() => onPull(tag.id)}
+ >
+ {pullingModel === tag.id ? (
+ <Loader2 className="h-3 w-3 animate-spin" />
+ ) : (
+ <Download className="h-3 w-3" />
+ )}
+ {t("apikeys_model_pull.download")}
+ </Button>
+ )}
+ </div>
+ ))}
+ </div>
+ )}
+ </div>
+ ))}
+ </div>
+ )}
+ </div>
+ );
+}
+
/**
* The download half of a keyless local brain card: which models this machine
* could run, which it already has, and the one button that fetches one.
@@ -2569,7 +2833,6 @@ export function LocalModelDownloadPanel({
const t = useT();
const [catalog, setCatalog] = useState<PullableModels | null>(null);
const [error, setError] = useState<string | null>(null);
- const [custom, setCustom] = useState("");
const [progress, setProgress] = useState<ModelPullProgress | null>(null);
const running = progress?.state === "running";
@@ -2771,23 +3034,12 @@ export function LocalModelDownloadPanel({
{/* Any name the library knows — the shortlist is a starting point, not a
gate, and a user who wants a specific model should not have to leave
the app for it. */}
- <div className="flex items-center gap-2">
- <input
- type="text"
- value={custom}
- onChange={(e) => setCustom(e.target.value)}
- placeholder={t("apikeys_model_pull.custom_placeholder")}
- className="h-8 w-full rounded-md border border-border bg-background px-2 text-xs"
- />
- <Button
- size="sm"
- variant="secondary"
- disabled={running || !custom.trim() || !catalog?.server_reachable}
- onClick={() => void pull(custom)}
- >
- {t("apikeys_model_pull.download")}
- </Button>
- </div>
+ <LibraryBrowser
+ providerId={descriptor.id}
+ onPull={(model) => void pull(model)}
+ disabled={running || !catalog?.server_reachable}
+ pullingModel={running ? (progress?.model ?? null) : null}
+ />
{progress && progress.state !== "idle" && (
<div className="space-y-1">
diff --git a/jarvis/ui/web/frontend/src/hooks/useProviders.ts b/jarvis/ui/web/frontend/src/hooks/useProviders.ts
index c89349a2d8..35421461a7 100644
--- a/jarvis/ui/web/frontend/src/hooks/useProviders.ts
+++ b/jarvis/ui/web/frontend/src/hooks/useProviders.ts
@@ -1142,6 +1142,76 @@ export async function startModelPull(
return body as ModelPullProgress;
}
+/** One model in the provider's PUBLIC library — mirror of `ollama_library`. */
+export interface LibraryModel {
+ name: string;
+ description: string;
+ /** "vision" | "tools" | "thinking" | "embedding", in the catalog's order. */
+ capabilities: string[];
+ /** The catalog offers a hosted variant of this model as well. */
+ cloud: boolean;
+ /** Parameter-count badges ("4b", "122b") — a preview of the tag list. */
+ sizes: string[];
+ pulls: string;
+ updated: string;
+ /** Whether any tag of this model is already on the local server. */
+ installed?: boolean;
+}
+
+/** One installable tag of a library model, judged against THIS machine. */
+export interface LibraryTag {
+ tag: string;
+ /** The full pullable id, e.g. "qwen3.5:4b". */
+ id: string;
+ /** Download size from the catalog; null when it could not be read. */
+ size_gb: number | null;
+ context: string;
+ inputs: string;
+ updated: string;
+ /** Hosted-only tag: nothing to download, so it is never offered as a pull. */
+ cloud: boolean;
+ installed?: boolean;
+ /** Same verdict vocabulary as the curated shortlist; "unknown" if no size. */
+ fit?: string;
+ fit_note?: string;
+}
+
+/**
+ * Search the provider's public model library.
+ *
+ * `error` is a normal outcome, not an exception: the catalog lives on the
+ * public internet, and an offline machine must still see a working panel with
+ * its free-text download field.
+ */
+export async function searchModelLibrary(
+ providerId: string,
+ query: string,
+): Promise<{ query: string; models: LibraryModel[]; error: string | null }> {
+ const res = await fetch(
+ `/api/providers/${encodeURIComponent(providerId)}/library/search?q=${encodeURIComponent(query)}`,
+ );
+ const body = await res.json().catch(() => ({}));
+ if (!res.ok) {
+ throw new Error(body.detail ?? `HTTP ${res.status}`);
+ }
+ return body as { query: string; models: LibraryModel[]; error: string | null };
+}
+
+/** Every published tag of one library model, with size and fit verdict. */
+export async function modelLibraryTags(
+ providerId: string,
+ model: string,
+): Promise<{ model: string; tags: LibraryTag[]; error: string | null }> {
+ const res = await fetch(
+ `/api/providers/${encodeURIComponent(providerId)}/library/${encodeURIComponent(model)}/tags`,
+ );
+ const body = await res.json().catch(() => ({}));
+ if (!res.ok) {
+ throw new Error(body.detail ?? `HTTP ${res.status}`);
+ }
+ return body as { model: string; tags: LibraryTag[]; error: string | null };
+}
+
/** Poll one download; `installed` reflects the server's inventory, not the run. */
export async function modelPullStatus(
providerId: string,
diff --git a/jarvis/ui/web/frontend/src/i18n/locales/de.json b/jarvis/ui/web/frontend/src/i18n/locales/de.json
index b276b7964b..57ecff23b6 100644
--- a/jarvis/ui/web/frontend/src/i18n/locales/de.json
+++ b/jarvis/ui/web/frontend/src/i18n/locales/de.json
@@ -1368,7 +1368,13 @@
"size": "~{0} GB",
"installed": "Installiert",
"download": "Laden",
- "custom_placeholder": "Beliebiger Modellname, z. B. mistral",
+ "custom_placeholder": "Bibliothek durchsuchen oder genauen Namen eingeben…",
+ "library_searching": "Bibliothek wird durchsucht…",
+ "library_no_results": "Keine Modelle für diese Suche gefunden.",
+ "library_loading_versions": "Versionen werden geladen…",
+ "library_hosted": "Gehostet",
+ "library_context": "{0} Kontext",
+ "library_size_unknown": "Größe unbekannt",
"hardware_gpu": "{0} GB Grafikspeicher",
"best_for_machine": "Am besten für deinen Rechner",
"role_chat": "Chat und Sprache",
diff --git a/jarvis/ui/web/frontend/src/i18n/locales/en.json b/jarvis/ui/web/frontend/src/i18n/locales/en.json
index b302a04380..aedeca8506 100644
--- a/jarvis/ui/web/frontend/src/i18n/locales/en.json
+++ b/jarvis/ui/web/frontend/src/i18n/locales/en.json
@@ -1368,7 +1368,13 @@
"size": "~{0} GB",
"installed": "Installed",
"download": "Download",
- "custom_placeholder": "Any model name, e.g. mistral",
+ "custom_placeholder": "Search the library, or type an exact name…",
+ "library_searching": "Searching the library…",
+ "library_no_results": "No models found for that search.",
+ "library_loading_versions": "Loading versions…",
+ "library_hosted": "Hosted",
+ "library_context": "{0} context",
+ "library_size_unknown": "size unknown",
"hardware_gpu": "{0} GB graphics memory",
"best_for_machine": "Best for your machine",
"role_chat": "Chat and voice",
diff --git a/jarvis/ui/web/frontend/src/i18n/locales/es.json b/jarvis/ui/web/frontend/src/i18n/locales/es.json
index 3311ac2932..e71da4cdca 100644
--- a/jarvis/ui/web/frontend/src/i18n/locales/es.json
+++ b/jarvis/ui/web/frontend/src/i18n/locales/es.json
@@ -1368,7 +1368,13 @@
"size": "~{0} GB",
"installed": "Instalado",
"download": "Descargar",
- "custom_placeholder": "Cualquier nombre de modelo, p. ej. mistral",
+ "custom_placeholder": "Busca en la biblioteca o escribe un nombre exacto…",
+ "library_searching": "Buscando en la biblioteca…",
+ "library_no_results": "No se encontraron modelos para esa búsqueda.",
+ "library_loading_versions": "Cargando versiones…",
+ "library_hosted": "Alojado",
+ "library_context": "{0} de contexto",
+ "library_size_unknown": "tamaño desconocido",
"hardware_gpu": "{0} GB de memoria gráfica",
"best_for_machine": "Lo mejor para tu equipo",
"role_chat": "Chat y voz",