Python
Models & Keys: calmer cards, logos for llama.cpp and vLLM
Devika Verma1acd0476c8c5
diff --git a/surfaces/gui/e2e/settings.spec.ts b/surfaces/gui/e2e/settings.spec.tsindex 97812976..bc5c1045 100644--- a/surfaces/gui/e2e/settings.spec.ts+++ b/surfaces/gui/e2e/settings.spec.ts@@ -55,18 +55,21 @@ test("Models: provider gallery states; vendor form previews models", async ({ pa// Card states from the fixtures: openai configured with models in the picker, anthropic// configured, zai not. UX-055: a connected card counts its picker models; connected- // cards come first in their group, then a "not set up" rule; local servers group apart.+ // cards come first in their group, the rest sit quieter behind them; local servers group apart.await expect(page.getByTestId("set-provider-openai")).toContainText("✓ Connected · 4 models");await expect(page.getByTestId("set-provider-anthropic")).toContainText("✓ Connected");await expect(page.getByTestId("set-provider-zai")).toContainText("Not set up");await expect(page.getByTestId("set-provider-ollama")).toContainText("No key needed");await expect(page.getByTestId("provider-group-local")).toContainText("Ollama");- await expect(page.getByTestId("provider-rule-api_key")).toContainText("not set up");+ await expect(page.getByTestId("set-provider-zai")).not.toHaveClass(/bg-panel/);+ // Five API-key providers fit under the fold; the "Show N more" line only appears past six.+ await expect(page.getByTestId("provider-more-api_key")).toHaveCount(0);+ await expect(page.getByTestId("pick-model-btn")).toBeVisible();await expect(page.getByTestId("provider-search")).toBeVisible();// The composer-picker card lists the curated models with provider tags.const picker = page.getByTestId("composer-picker");- await expect(picker).toContainText("In the composer's picker");+ await expect(picker).toContainText("Select what shows up for sessions");// Vendor form: blurb renders; the prefilled endpoint hides behind the disclosure.await page.getByTestId("set-provider-zai").click();diff --git a/surfaces/gui/src/components/ManageTabs.tsx b/surfaces/gui/src/components/ManageTabs.tsxindex 8f05bb18..1d19ab9d 100644--- a/surfaces/gui/src/components/ManageTabs.tsx+++ b/surfaces/gui/src/components/ManageTabs.tsx@@ -20,6 +20,7 @@ import {type ProviderInfo,} from "../api";import { CloudSignInInline, CloudStatusPending } from "./connectors/CloudSignIn";+import { Icon } from "./Icon";import { ModelChecklist } from "./ModelChecklist";import { LocalModelsTable, YourSystem } from "./models/LocalModels";import { PickModelDialog } from "./models/PickModelDialog";@@ -224,6 +225,15 @@ function ComposerPickerCard({const p = providers.find((x) => x.name === provOf(id));return (p?.title || provOf(id)).split(" (")[0];};+ // "ollama:qwen3-coder:30b" reads as "qwen3-coder:30b"; the provider sits beside it.+ const shortId = (id: string) => (id.startsWith(provOf(id) + ":") ? id.slice(provOf(id).length + 1) : id);+ // The card says the provider on its second line, so a label that ends in it+ // ("GPT-5.6 Sol · OpenAI") loses that tail on the first.+ const title = (id: string) => {+ const label = settings.model_labels?.[id] || shortId(id);+ const tail = ` · ${tag(id)}`;+ return label.endsWith(tail) ? label.slice(0, -tail.length) : label;+ };const detail = (id: string) => {const cfg = settings.model_config?.[id];const bits = [tag(id)];@@ -234,48 +244,64 @@ function ComposerPickerCard({const q = query.trim().toLowerCase();const shown = settings.models.filter((id) => !q || id.toLowerCase().includes(q) || (settings.model_labels?.[id] || "").toLowerCase().includes(q));return (- <div className="mt-2" data-testid="composer-picker">+ <div className="mt-10" data-testid="composer-picker"><div className="flex items-center mb-2"><div className={SEC_H + " uppercase tracking-wide"}>{t("manage.composer_picker_title")}</div><label className="ml-auto flex items-center gap-1.5 rounded-lg border border-line bg-panel px-2.5 py-1 w-[220px] text-meta">- <span className="text-faint">⌕</span>+ <Icon name="search" size={12} className="text-faint shrink-0" /><input className="flex-1 bg-transparent outline-none" placeholder={t("manage.picker_search")} value={query} onChange={(e) => setQuery(e.target.value)} data-testid="picker-search" /></label>+ <button+ className="ml-2 grid place-items-center w-[30px] h-[30px] rounded-lg border border-line bg-panel text-muted hover:text-ink hover:border-lineStrong transition-colors"+ title={t("manage.pick_model_btn")}+ onClick={onPick}+ data-testid="pick-model-btn"+ >+ <Icon name="plus" size={14} />+ </button></div>- <div className="rounded-xl border border-line bg-panel max-h-[214px] overflow-auto">+ {/* Each model is a card like the provider cards above: name, then provider and any+ saved settings; ✕ and "Make default" show on hover. No table, no dividers. */}+ <div className={"grid grid-cols-2 xl:grid-cols-3 gap-3" + (shown.length > 9 ? " max-h-[262px] overflow-y-auto pr-1 -mr-1" : "")}>{shown.map((id) => {const isDefault = id === settings.model;return (- <div className="flex items-center gap-2.5 px-3.5 py-2 border-b border-line last:border-b-0 text-ui" key={id} data-testid={`picker-row-${id}`}>- <button className="truncate text-left hover:underline underline-offset-2" title={t("manage.configure_model")} onClick={() => onConfigure(id)}>- {settings.model_labels?.[id] || id}- </button>- <span className="text-meta text-faint truncate">· {detail(id)}</span>- {isDefault ? (- <span className="mlist-default">{t("models.default_badge")}</span>- ) : (- <button className="mlist-make" onClick={() => setDefaultModel(id).then(() => onChanged())}>- {t("models.make_default")}+ <div+ className="mlist-row group relative flex items-center gap-3 rounded-xl border border-line bg-panel/50 px-5 py-4 min-h-[70px] text-ui hover:border-lineStrong transition-colors"+ key={id}+ data-testid={`picker-row-${id}`}+ >+ <span className="min-w-0 flex-1">+ <button className="block w-full truncate text-left leading-tight hover:underline underline-offset-2" title={t("manage.configure_model")} onClick={() => onConfigure(id)}>+ {title(id)}+ </button>+ <span className="flex items-center gap-2 mt-1 text-meta text-faint">+ <span className="truncate">{detail(id)}</span>+ {isDefault ? (+ <span className="mlist-default">{t("models.default_badge")}</span>+ ) : (+ <button className="mlist-make" onClick={() => setDefaultModel(id).then(() => onChanged())}>+ {t("models.make_default")}+ </button>+ )}+ </span>+ </span>+ {!isDefault && (+ <button+ className="text-faint hover:text-ink opacity-0 group-hover:opacity-100 transition-opacity"+ title={t("manage.remove_from_picker")}+ onClick={() => removeModel(id).then((r) => r.ok && onChanged())}+ data-testid={`picker-remove-${id}`}+ >+ ✕</button>)}- <button- className="ml-auto text-faint hover:text-ink disabled:opacity-40"- title={isDefault ? t("models.default_locked") : t("manage.remove_from_picker")}- disabled={isDefault}- onClick={() => removeModel(id).then((r) => r.ok && onChanged())}- data-testid={`picker-remove-${id}`}- >- ✕- </button></div>);})}- {shown.length === 0 && <div className="px-3.5 py-3 text-meta text-faint">—</div>}+ {shown.length === 0 && <div className="px-1 py-2 text-meta text-faint">—</div>}</div>- <p className="text-meta text-muted mt-2 leading-relaxed">{t("manage.composer_picker_help_v2")}</p>- <button className="mt-2.5 rounded-lg border border-lineStrong bg-panel px-3 py-1.5 text-ui font-medium" onClick={onPick} data-testid="pick-model-btn">- + {t("manage.pick_model_btn")}- </button>+ <p className="text-meta text-muted mt-3 leading-relaxed">{t("manage.composer_picker_help_v3")}</p></div>);}diff --git a/surfaces/gui/src/components/models/ProviderGroups.tsx b/surfaces/gui/src/components/models/ProviderGroups.tsxindex eacbbe43..cba51e8b 100644--- a/surfaces/gui/src/components/models/ProviderGroups.tsx+++ b/surfaces/gui/src/components/models/ProviderGroups.tsx@@ -1,6 +1,6 @@// Models & Keys, the provider cards (UX-055): three groups by kind — on your own-// hardware, subscriptions, API keys — connected cards first in each group, then a-// thin "not set up" rule, a search box over all three, and more air in each card.+// hardware, subscriptions, API keys — connected cards first in each group and filled,+// the rest quieter behind them, a search box over all three, and more air in each card.// The card grid and the open-in-place detail are the page's existing shape; only the// order, the grouping and the spacing change here.import { useState } from "react";@@ -8,9 +8,11 @@ import { useTranslation } from "react-i18next";import type { ProviderInfo } from "../../api";import { ProviderMark, type ProviderSetupState } from "../../providers/ProviderSetup";+import { Icon } from "../Icon";type Kind = "local" | "subscription" | "api_key";const KINDS: Kind[] = ["local", "subscription", "api_key"];+const FOLD = 6; // cards shown before "Show N more" (two rows of three)export function providerKind(p: ProviderInfo): Kind {return p.kind || "api_key";@@ -44,20 +46,28 @@ export function ProviderGroups({}) {const { t } = useTranslation();const [query, setQuery] = useState("");+ const [expanded, setExpanded] = useState<Set<Kind>>(new Set());const known = ps.providers.map((p) => p.name);const q = query.trim().toLowerCase();const shown = ps.ordered.filter((p) => !q || p.title.toLowerCase().includes(q) || p.name.includes(q));+ // Connected cards are filled; the rest sit on the page background with a quieter+ // title, so the eye lands on what is set up without a divider saying so.const card =- "flex items-center gap-3 rounded-xl border border-line bg-panel px-4 py-4 min-h-[74px] text-left hover:border-lineStrong transition-colors";+ "flex items-center gap-3 rounded-xl border border-line px-4 py-4 min-h-[74px] text-left hover:border-lineStrong transition-colors";const cardFor = (p: ProviderInfo) => {const connected = providerConnected(p, ps.keylessOk);const count = connected ? modelCountFor(p.name, models, known) : 0;return (- <button key={p.name} className={card} data-testid={`${tp}-provider-${p.name}`} onClick={() => ps.openProvider(p.name)}>+ <button+ key={p.name}+ className={card + (connected ? " bg-panel" : " bg-transparent")}+ data-testid={`${tp}-provider-${p.name}`}+ onClick={() => ps.openProvider(p.name)}+ ><ProviderMark name={p.name} title={p.title} /><span className="min-w-0 flex-1">- <span className="block text-ui font-semibold leading-tight truncate">{p.title}</span>+ <span className={"block text-ui font-semibold leading-tight truncate" + (connected ? "" : " text-muted")}>{p.title}</span>{connected && count > 0 ? (<span className="block text-meta text-ok font-medium truncate">{t(p.needs_key || p.auth === "oauth" ? "provider.connected_count" : "provider.running_count", { count })}@@ -78,7 +88,7 @@ export function ProviderGroups({return (<div data-testid="provider-groups"><label className="flex items-center gap-2 rounded-lg border border-lineStrong bg-panel px-3 py-2 mb-5">- <span className="text-faint text-meta">⌕</span>+ <Icon name="search" size={14} className="text-faint shrink-0" /><inputclassName="flex-1 bg-transparent outline-none text-ui"placeholder={t("manage.search_providers")}@@ -87,25 +97,29 @@ export function ProviderGroups({data-testid="provider-search"/></label>+ {shown.length === 0 && <p className="text-meta text-faint mb-6" data-testid="provider-search-empty">{t("manage.no_providers_match")}</p>}{KINDS.map((kind) => {const inKind = shown.filter((p) => providerKind(p) === kind);if (inKind.length === 0) return null;const connected = inKind.filter((p) => providerConnected(p, ps.keylessOk));const rest = inKind.filter((p) => !providerConnected(p, ps.keylessOk));+ const cards = [...connected, ...rest];return (<section key={kind} className="mb-6" data-testid={`provider-group-${kind}`}><div className="text-label text-faint font-semibold tracking-wide uppercase mb-2.5">{t(`manage.group_${kind}`)}</div>- {connected.length > 0 && (- <div className="grid grid-cols-2 xl:grid-cols-3 gap-3">{connected.map(cardFor)}</div>+ {/* A long group (API keys) shows two rows, then a "Show N more" line expands it in place. */}+ <div className="grid grid-cols-2 xl:grid-cols-3 gap-3" data-testid={`provider-grid-${kind}`}>+ {(expanded.has(kind) || q ? cards : cards.slice(0, FOLD)).map(cardFor)}+ </div>+ {!q && cards.length > FOLD && (+ <button+ className="mt-3 text-meta text-muted hover:text-ink"+ onClick={() => setExpanded((prev) => { const next = new Set(prev); next.has(kind) ? next.delete(kind) : next.add(kind); return next; })}+ data-testid={`provider-more-${kind}`}+ >+ {expanded.has(kind) ? t("manage.show_fewer") : t("manage.show_more", { count: cards.length - FOLD })}+ </button>)}- {connected.length > 0 && rest.length > 0 && (- <div className="flex items-center gap-3 my-3.5 text-label text-faint" data-testid={`provider-rule-${kind}`}>- <span className="flex-1 border-t border-lineStrong" />- {t("manage.not_set_up_rule")}- <span className="flex-1 border-t border-lineStrong" />- </div>- )}- {rest.length > 0 && <div className="grid grid-cols-2 xl:grid-cols-3 gap-3">{rest.map(cardFor)}</div>}</section>);})}diff --git a/surfaces/gui/src/locales/en.json b/surfaces/gui/src/locales/en.jsonindex db9ff6ed..9fd6f610 100644--- a/surfaces/gui/src/locales/en.json+++ b/surfaces/gui/src/locales/en.json@@ -1258,7 +1258,7 @@"check_browser": "Check your browser…","coming_soon": "Coming soon","composer_picker_help": "The models offered when starting a session; the black badge marks the default. Add more from a provider's card above.",- "composer_picker_title": "In the composer's picker",+ "composer_picker_title": "Select what shows up for sessions","connect": "Connect","connect_one_click": "Connect {{title}} with one click","connector_no_tools": "No tools for this connector yet.",@@ -1323,11 +1323,13 @@"group_local": "On your own hardware","group_subscription": "Subscriptions","group_api_key": "API keys",- "not_set_up_rule": "not set up",+ "no_providers_match": "No providers match.",+ "show_more": "Show {{count}} more",+ "show_fewer": "Show fewer","search_providers": "Search providers…","picker_search": "Search…","pick_model_btn": "Pick a model…",- "composer_picker_help_v2": "The models offered when starting a session. Remove one with ✕; add or configure one with Pick a model.",+ "composer_picker_help_v3": "The models offered when starting a session. Add or configure one with +; remove one with ✕.","your_system": "Your system","sys_processor": "Processor","sys_graphics": "Graphics",diff --git a/surfaces/gui/src/locales/zh.json b/surfaces/gui/src/locales/zh.jsonindex 1b017f39..78679ffb 100644--- a/surfaces/gui/src/locales/zh.json+++ b/surfaces/gui/src/locales/zh.json@@ -1241,7 +1241,7 @@"check_browser": "请查看你的浏览器…","coming_soon": "即将推出","composer_picker_help": "新建会话时可选的模型;黑色徽标表示默认模型。可从上方提供方卡片添加更多模型。",- "composer_picker_title": "输入框的模型选择器",+ "composer_picker_title": "选择会话中可用的模型","connect": "连接","connect_one_click": "一键连接 {{title}}","connector_no_tools": "此连接器暂无工具。",@@ -1306,11 +1306,13 @@"group_local": "在你自己的硬件上","group_subscription": "订阅","group_api_key": "API 密钥",- "not_set_up_rule": "未设置",+ "no_providers_match": "没有匹配的提供商。",+ "show_more": "再显示 {{count}} 个",+ "show_fewer": "收起","search_providers": "搜索提供商…","picker_search": "搜索…","pick_model_btn": "选择模型…",- "composer_picker_help_v2": "开始会话时可选的模型。用 ✕ 移除;用“选择模型”添加或配置。",+ "composer_picker_help_v3": "开始会话时可选的模型。用 + 添加或配置;用 ✕ 移除。","your_system": "你的系统","sys_processor": "处理器","sys_graphics": "图形",diff --git a/surfaces/gui/src/providers/logos.ts b/surfaces/gui/src/providers/logos.tsindex cbedcfb7..7289b0f8 100644--- a/surfaces/gui/src/providers/logos.ts+++ b/surfaces/gui/src/providers/logos.ts@@ -11,6 +11,9 @@ import gemini from "./logos/gemini.svg";import byteplus from "./logos/byteplus.svg";import volcengine from "./logos/volcengine.svg";import ollama from "./logos/ollama.svg";+// llama.cpp: selfhst/icons (CC BY 4.0); vLLM: homarr-labs/dashboard-icons (Apache 2.0).+import llamacpp from "./logos/llamacpp.svg";+import vllm from "./logos/vllm.svg";import bedrock from "./logos/bedrock.svg";import vertex from "./logos/vertex.svg";import openrouter from "./logos/openrouter.svg";@@ -36,6 +39,8 @@ export const PROVIDER_LOGOS: Record<string, string> = {"ark-agent-plan-cn": volcengine,meta,ollama,+ llamacpp,+ vllm,bedrock,vertex,openrouter,@@ -58,6 +63,8 @@ export const PROVIDER_ORDER = ["ark-agent-plan-cn","meta","ollama",+ "llamacpp",+ "vllm","bedrock","vertex","openrouter",diff --git a/surfaces/gui/src/providers/logos/llamacpp.svg b/surfaces/gui/src/providers/logos/llamacpp.svgnew file mode 100644index 00000000..019ea69b--- /dev/null+++ b/surfaces/gui/src/providers/logos/llamacpp.svg@@ -0,0 +1 @@+<svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" viewBox="0 0 512 512"><path d="m356.4 201.3-32.8 58.3c-43.3-33.3-107.4-38.2-150.7-2.4-69.8 57.6-64.9 190.8 43.7 191.6 30.4 0 56.2-14.3 83.9-23.8l14.6 58.1c-24.6 11.4-49.6 23.1-76.6 26.7-246 33.5-231.9-321.6-9.5-340.1 46.7-3.9 87.8 8.3 127.6 31.6zm-169.9-55.9c-37.4 11.2-72.2 31.8-98.5 60.8-4.9-58.8 8.3-177.7 73.7-201 9.7-3.4 43-11.9 42.1 5.3-1 17.3-24.1 46.9-29.7 63-9.7 28.2-.7 47.6 12.6 72.2zm92.4 252.8h-36.5v-41.3h-41.3v-34h37.7l3.6-3.6v-40.1h36.5V323h38.9v34h-38.9zm133.7-41.3v41.3h-36.5v-41.3h-38.9v-34h38.9v-43.8h36.5v40.1l3.6 3.6h37.7v34h-41.3zM305.4 31.4c4.9 7.3-22.6 38.7-27 46.7-12.6 23.8-4.1 37.4 5.3 60-27.5-4.1-53-.7-80.2 2.4C209.6 88.3 239 12.2 305.4 31.4" style="fill:#ff8236"/></svg>\ No newline at end of filediff --git a/surfaces/gui/src/providers/logos/vllm.svg b/surfaces/gui/src/providers/logos/vllm.svgnew file mode 100644index 00000000..6b9e5d1d--- /dev/null+++ b/surfaces/gui/src/providers/logos/vllm.svg@@ -0,0 +1 @@+<svg version="1.1" viewBox="0.0 0.0 96.0 96.0" fill="none" stroke="none" stroke-linecap="square" stroke-miterlimit="10" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg"><clipPath id="g31e21232314_0_33.0"><path d="m0 0l96.0 0l0 96.0l-96.0 0l0 -96.0z" clip-rule="nonzero"/></clipPath><g clip-path="url(#g31e21232314_0_33.0)"><path fill="#d9d9d9" d="m41.04961 80.271324l1.8897629 0l0 2.3307114l-1.8897629 0z" fill-rule="evenodd"/><path fill="#d9d9d9" d="m42.221855 81.45145l1.8897629 0l0 2.3307037l-1.8897629 0z" fill-rule="evenodd"/><g filter="url(#shadowFilter-g31e21232314_0_33.1)"><use xlink:href="#g31e21232314_0_33.1" transform="matrix(1.0 0.0 0.0 1.0 0.0 2.0)"/></g><defs><filter id="shadowFilter-g31e21232314_0_33.1" filterUnits="userSpaceOnUse"><feGaussianBlur in="SourceAlpha" stdDeviation="2.0" result="blur"/><feComponentTransfer in="blur" color-interpolation-filters="sRGB"><feFuncR type="linear" slope="0" intercept="0.0"/><feFuncG type="linear" slope="0" intercept="0.0"/><feFuncB type="linear" slope="0" intercept="0.0"/><feFuncA type="linear" slope="0.0" intercept="0"/></feComponentTransfer></filter></defs><g id="g31e21232314_0_33.1"><path fill="#d9d9d9" d="m42.22417 28.470434l0 55.307083l-27.653543 -55.307083z" fill-rule="evenodd"/></g><g filter="url(#shadowFilter-g31e21232314_0_33.2)"><use xlink:href="#g31e21232314_0_33.2" transform="matrix(1.0 0.0 0.0 1.0 0.0 2.0)"/></g><defs><filter id="shadowFilter-g31e21232314_0_33.2" filterUnits="userSpaceOnUse"><feGaussianBlur in="SourceAlpha" stdDeviation="2.0" result="blur"/><feComponentTransfer in="blur" color-interpolation-filters="sRGB"><feFuncR type="linear" slope="0" intercept="0.0"/><feFuncG type="linear" slope="0" intercept="0.0"/><feFuncB type="linear" slope="0" intercept="0.0"/><feFuncA type="linear" slope="0.0" intercept="0"/></feComponentTransfer></filter></defs><g id="g31e21232314_0_33.2"><path fill="#d9d9d9" d="m42.223038 83.77752l21.729656 0l18.653545 -70.385826l-25.574802 13.461943z" fill-rule="evenodd"/></g><g filter="url(#shadowFilter-g31e21232314_0_33.3)"><use xlink:href="#g31e21232314_0_33.3" transform="matrix(1.0 0.0 0.0 1.0 0.0 2.0)"/></g><defs><filter id="shadowFilter-g31e21232314_0_33.3" filterUnits="userSpaceOnUse"><feGaussianBlur in="SourceAlpha" stdDeviation="2.0" result="blur"/><feComponentTransfer in="blur" color-interpolation-filters="sRGB"><feFuncR type="linear" slope="0" intercept="0.0"/><feFuncG type="linear" slope="0" intercept="0.0"/><feFuncB type="linear" slope="0" intercept="0.0"/><feFuncA type="linear" slope="0.0" intercept="0"/></feComponentTransfer></filter></defs><g id="g31e21232314_0_33.3"><path fill="#fdb515" d="m41.0477 27.293962l0 55.30709l-27.653542 -55.30709z" fill-rule="evenodd"/></g><g filter="url(#shadowFilter-g31e21232314_0_33.4)"><use xlink:href="#g31e21232314_0_33.4" transform="matrix(1.0 0.0 0.0 1.0 0.0 2.0)"/></g><defs><filter id="shadowFilter-g31e21232314_0_33.4" filterUnits="userSpaceOnUse"><feGaussianBlur in="SourceAlpha" stdDeviation="2.0" result="blur"/><feComponentTransfer in="blur" color-interpolation-filters="sRGB"><feFuncR type="linear" slope="0" intercept="0.0"/><feFuncG type="linear" slope="0" intercept="0.0"/><feFuncB type="linear" slope="0" intercept="0.0"/><feFuncA type="linear" slope="0.0" intercept="0"/></feComponentTransfer></filter></defs><g id="g31e21232314_0_33.4"><path fill="#30a2ff" d="m41.046566 82.60105l21.72966 0l18.653545 -70.385826l-25.574806 13.461943z" fill-rule="evenodd"/></g></g></svg>\ No newline at end of file