Python
Models & Keys: grouped providers, Your system, local model table, Pick a model
Devika Verma5e12694cb76a
diff --git a/coworker/providers/registry.py b/coworker/providers/registry.pyindex 2a4e4c74..76acaa4e 100644--- a/coworker/providers/registry.py+++ b/coworker/providers/registry.py@@ -693,7 +693,7 @@ DESCRIPTORS: list[ProviderDescriptor] = [),ProviderDescriptor(name="ollama",- title="Ollama (local models)",+ title="Ollama",needs_key=False,fields=[ProviderField(diff --git a/coworker/server/manager.py b/coworker/server/manager.pyindex 25e42837..afbbf3af 100644--- a/coworker/server/manager.py+++ b/coworker/server/manager.py@@ -4065,6 +4065,10 @@ class SessionManager:d.name),}+ if d.kind == "local":+ # A keyless server is "connected" when it answers (cached probes), not+ # when a form was saved; the page groups connected providers first.+ row["alive"] = self._ollama_alive() if d.name == "ollama" else self._local_server_alive(d.name)if d.auth == "oauth":# Sign-in state instead of key state; the token values themselves# never leave the SecretStore.diff --git a/surfaces/gui/src/api.ts b/surfaces/gui/src/api.tsindex f431dae5..02ae6cb4 100644--- a/surfaces/gui/src/api.ts+++ b/surfaces/gui/src/api.ts@@ -1200,6 +1200,8 @@ export interface ModelSettings {auto_approve_shadow?: boolean;// Curated-matrix display names ({full id → "GLM-5.2 · via Together"}); custom models absent.model_labels?: Record<string, string>;+ // Per-model settings the user saved (model_config.json), keyed by model id.+ model_config?: Record<string, ModelConfigRecord>;// {full id → context window in tokens}, verified matrix entries only — drives the// composer's context-fill meter (absent id → the meter hides). Optional for older backends.model_context_windows?: Record<string, number>;@@ -2419,6 +2421,11 @@ export interface ProviderInfo {last_used_at?: number | null; // epoch secs the provider last served a completion// OAuth providers (auth === "oauth"): browser sign-in instead of a key form.auth?: string | null;+ // How Models & Keys groups it: a server on the user's own hardware, a plan signed+ // into, or an API key. Absent on an older backend → treated as an API key.+ kind?: "local" | "subscription" | "api_key";+ // Local servers only: whether the server answers right now (cached probe).+ alive?: boolean;signed_in?: boolean;account?: string | null; // signed-in account label (email or id)authorizing?: boolean;@@ -2449,6 +2456,118 @@ export async function codexSignout(): Promise<{ ok: boolean }> {return res.json();}+// -- per-model settings, the machine, and what local servers hold ----------------------++export interface ModelConfigRecord {+ context_size?: number;+ max_output_tokens?: number;+ thinking?: boolean;+ reasoning_effort?: string;+ temperature?: number;+ top_p?: number;+ compaction_threshold_pct?: number;+ default?: boolean;+}++export interface ModelSettingValue {+ value: number | boolean | string;+ from: "user" | "recommended";+}++export interface ModelRecommendation {+ name: string;+ context_max: number | null;+ context_for_agents: number | null;+ max_output_tokens: number | null;+ thinking: { available: boolean; default: boolean };+ sampling: Record<string, number>;+ notes: string;+ source: string;+}++/** One model's settings in force, each with where it came from. */+export interface ModelConfigView {+ model: string;+ context_size?: ModelSettingValue;+ max_output_tokens?: ModelSettingValue;+ thinking?: ModelSettingValue;+ reasoning_effort?: ModelSettingValue;+ temperature?: ModelSettingValue;+ top_p?: ModelSettingValue;+ compaction_threshold_pct?: ModelSettingValue;+ default: ModelSettingValue;+ recommendation?: ModelRecommendation;+}++export async function getModelConfig(model: string): Promise<ModelConfigView> {+ const res = await fetch(`${httpBase()}/v1/settings/model-config?model=${encodeURIComponent(model)}`);+ return res.json();+}++export async function setModelConfig(+ model: string,+ values: Partial<Record<keyof ModelConfigRecord, number | boolean | string | null>>,+): Promise<ModelConfigView & { ok: boolean; error?: string }> {+ const res = await fetch(`${httpBase()}/v1/settings/model-config`, {+ method: "POST",+ headers: { "Content-Type": "application/json" },+ body: JSON.stringify({ model, values }),+ });+ return res.json();+}++export async function removeModelConfig(model: string): Promise<{ ok: boolean }> {+ const res = await fetch(`${httpBase()}/v1/settings/model-config/remove`, {+ method: "POST",+ headers: { "Content-Type": "application/json" },+ body: JSON.stringify({ model }),+ });+ return res.json();+}++/** This machine, for the "Your system" section. */+export interface SystemFacts {+ processor: string;+ graphics: string;+ kind: "apple_silicon" | "nvidia" | "dgx_spark" | "jetson" | "cpu";+ memory_bytes: number | null;+ gpu_memory_bytes: number | null;+ storage_free_bytes: number | null;+ storage_total_bytes: number | null;+ model_memory_bytes: number | null;+ runs_well_up_to_bytes: number | null;+}++export async function getSystemFacts(): Promise<SystemFacts> {+ const res = await fetch(`${httpBase()}/v1/system`);+ return res.json();+}++/** One model a local server holds, as the settings table shows it. */+export interface LocalModelRow {+ model: string; // full id, e.g. ollama:qwen3-coder:30b+ name: string;+ size_bytes: number | null;+ tools: boolean | null; // null: the server did not say+ thinking: boolean | null;+ vision: boolean | null;+ remote: boolean;+ parameter_size: string | null;+ quantization: string | null;+ context_max: number | null;+ context: number | null;+ context_from: "user" | "machine" | "server";+ fit: "runs_well" | "tight" | "too_large" | "cloud" | "unknown";+ recommendation: string | null;+}++export async function getLocalModels(+ provider: string,+): Promise<{ provider: string; models: LocalModelRow[]; alive?: boolean; error?: string }> {+ const res = await fetch(`${httpBase()}/v1/providers/${encodeURIComponent(provider)}/models`);+ return res.json();+}+export async function getProviders(): Promise<ProviderInfo[]> {const res = await fetch(`${httpBase()}/v1/providers`);const data = await res.json();diff --git a/surfaces/gui/src/components/ManageTabs.tsx b/surfaces/gui/src/components/ManageTabs.tsxindex 6598b3ed..37d35e5d 100644--- a/surfaces/gui/src/components/ManageTabs.tsx+++ b/surfaces/gui/src/components/ManageTabs.tsx@@ -21,7 +21,10 @@ import {} from "../api";import { CloudSignInInline, CloudStatusPending } from "./connectors/CloudSignIn";import { ModelChecklist } from "./ModelChecklist";-import { ProviderCards, ProviderForm, useProviderSetup } from "../providers/ProviderSetup";+import { LocalModelsTable, YourSystem } from "./models/LocalModels";+import { PickModelDialog } from "./models/PickModelDialog";+import { ProviderGroups } from "./models/ProviderGroups";+import { ProviderForm, useProviderSetup } from "../providers/ProviderSetup";import { WalletChips } from "./WalletChips";// "2h ago"-style label for the providers' Last-used line (null when never used).@@ -61,6 +64,8 @@ function initials(name: string): string {export function ModelsTab() {const { t } = useTranslation();const [settings, setSettings] = useState<ModelSettings | null>(null);+ // The Pick a model dialog (UX-055): "" closed, "+" picking, else the model to configure.+ const [dialog, setDialog] = useState<string>("");const refreshSettings = () => getSettings().then(setSettings).catch(() => setSettings(null));const ps = useProviderSetup({ onSaved: refreshSettings });useEffect(() => {@@ -71,12 +76,26 @@ export function ModelsTab() {const info = ps.info;const knownNames = ps.providers.map((p) => p.name);+ const dialogEl = dialog ? (+ <PickModelDialog+ providers={ps.providers}+ settings={settings}+ keylessOk={ps.keylessOk}+ configure={dialog === "+" ? null : dialog}+ onClose={() => setDialog("")}+ onChanged={() => {+ refreshSettings();+ ps.refreshProviders();+ }}+ />+ ) : null;if (ps.sel === null) {return (<div>- <ProviderCards ps={ps} tp="set" gridClass="grid grid-cols-2 xl:grid-cols-3 gap-2.5" lastUsed />- <ComposerPickerCard settings={settings} providers={ps.providers} onChanged={refreshSettings} />+ <ProviderGroups ps={ps} tp="set" models={settings.models} />+ <ComposerPickerCard settings={settings} providers={ps.providers} onChanged={refreshSettings} onPick={() => setDialog("+")} onConfigure={(m) => setDialog(m)} />+ {dialogEl}</div>);}@@ -112,7 +131,20 @@ export function ModelsTab() {have nothing in the wallet — no row. */}{ps.credentialed && ps.sel && <WalletChips profiles={[`provider:${ps.sel}`]} />}- {info?.configured ? (+ {info?.kind === "local" ? (+ // A local provider: the machine, then what the server holds (UX-055).+ <>+ <YourSystem />+ <LocalModelsTable+ provider={ps.sel}+ curated={settings.models}+ defaultModel={settings.model}+ onChanged={refreshSettings}+ onConfigure={(m) => setDialog(m)}+ />+ {dialogEl}+ </>+ ) : info?.configured ? (<div className="mt-6"><div className={SEC_H + " mb-1.5"}>{t("manage.models")}</div><p className="text-meta text-muted mb-2.5 leading-relaxed">@@ -165,12 +197,17 @@ function ComposerPickerCard({settings,providers,onChanged,+ onPick,+ onConfigure,}: {settings: ModelSettings;providers: ProviderInfo[];onChanged: () => void;+ onPick: () => void;+ onConfigure: (model: string) => void;}) {const { t } = useTranslation();+ const [query, setQuery] = useState("");const names = providers.map((p) => p.name);const provOf = (id: string) => {const i = id.indexOf(":");@@ -180,30 +217,33 @@ function ComposerPickerCard({const p = providers.find((x) => x.name === provOf(id));return (p?.title || provOf(id)).split(" (")[0];};+ const detail = (id: string) => {+ const cfg = settings.model_config?.[id];+ const bits = [tag(id)];+ if (cfg?.context_size) bits.push(`${Math.round(cfg.context_size / 1024)}K`);+ if (cfg?.thinking) bits.push(t("manage.thinking_tag"));+ return bits.join(" · ");+ };+ 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-6" data-testid="composer-picker">- <div className={SEC_H + " mb-1.5"}>{t("manage.composer_picker_title")}</div>- <p className="text-meta text-muted mb-2.5 leading-relaxed">- {t("manage.composer_picker_help")}- </p>- <div className="mlist">- {settings.models.map((id) => {+ <div className="mt-2" 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>+ <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>+ </div>+ <div className="rounded-xl border border-line bg-panel max-h-[214px] overflow-auto">+ {shown.map((id) => {const isDefault = id === settings.model;return (- <div className="mlist-row" key={id}>- <label className="mlist-main">- <input- type="checkbox"- checked- disabled={isDefault}- title={isDefault ? t("models.default_locked") : t("manage.remove_from_picker")}- onChange={() => removeModel(id).then((r) => r.ok && onChanged())}- />- <span className="mlist-name" title={id}>- {settings.model_labels?.[id] || id}- </span>- </label>- <span className="text-label text-faint mr-2 shrink-0">{tag(id)}</span>+ <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>) : (@@ -211,10 +251,24 @@ function ComposerPickerCard({{t("models.make_default")}</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>}</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></div>);}diff --git a/surfaces/gui/src/components/models/LocalModels.tsx b/surfaces/gui/src/components/models/LocalModels.tsxnew file mode 100644index 00000000..b69aa350--- /dev/null+++ b/surfaces/gui/src/components/models/LocalModels.tsx@@ -0,0 +1,180 @@+// A local provider opened in place (UX-055): "Your system" laid out like the Mac's+// About panel, then the models the server holds with size, tools, reasoning, how each+// sits on this machine and the context it runs at. Tick = in the picker, ⚙ = the+// model's settings, ✕ = out of the picker.+import { useEffect, useState } from "react";+import { useTranslation } from "react-i18next";++import {+ addModel,+ getLocalModels,+ getSystemFacts,+ removeModel,+ type LocalModelRow,+ type SystemFacts,+} from "../../api";++export function fmtBytes(n: number | null | undefined): string {+ if (!n || n <= 0) return "—";+ const gb = n / 1024 ** 3;+ if (gb >= 100) return `${Math.round(gb)} GB`;+ if (gb >= 10) return `${gb.toFixed(0)} GB`;+ if (gb >= 1) return `${gb.toFixed(1)} GB`;+ return `${Math.round(n / 1024 ** 2)} MB`;+}++export function fmtContext(n: number | null | undefined): string {+ if (!n) return "—";+ if (n >= 1_000_000) return `${Math.round(n / 1_048_576)}M`;+ return `${Math.round(n / 1024)}K`;+}++export function YourSystem() {+ const { t } = useTranslation();+ const [facts, setFacts] = useState<SystemFacts | null>(null);+ useEffect(() => {+ getSystemFacts().then(setFacts).catch(() => setFacts(null));+ }, []);+ if (!facts) return null;+ const row = (label: string, value: string, key: string) => (+ <div className="flex items-center px-4 py-2.5 border-b border-line last:border-b-0 text-ui" key={key} data-testid={`sys-${key}`}>+ <span>{label}</span>+ <span className="ml-auto text-muted text-right">{value}</span>+ </div>+ );+ return (+ <div className="mt-5" data-testid="your-system">+ <div className="text-label text-faint font-semibold tracking-wide uppercase mb-2">{t("manage.your_system")}</div>+ <div className="rounded-xl border border-line bg-panel">+ {row(t("manage.sys_processor"), facts.processor, "processor")}+ {row(t("manage.sys_graphics"), facts.graphics, "graphics")}+ {row(t("manage.sys_memory"), fmtBytes(facts.memory_bytes), "memory")}+ {row(+ t("manage.sys_storage"),+ t("manage.sys_storage_free", { free: fmtBytes(facts.storage_free_bytes), total: fmtBytes(facts.storage_total_bytes) }),+ "storage",+ )}+ </div>+ {facts.runs_well_up_to_bytes ? (+ <p className="text-meta text-muted mt-2">{t("manage.sys_runs_well", { size: fmtBytes(facts.runs_well_up_to_bytes) })}</p>+ ) : null}+ </div>+ );+}++export function LocalModelsTable({+ provider,+ curated,+ defaultModel,+ onChanged,+ onConfigure,+}: {+ provider: string;+ curated: string[]; // the picker's models+ defaultModel: string;+ onChanged: () => void;+ onConfigure: (model: string) => void;+}) {+ const { t } = useTranslation();+ const [rows, setRows] = useState<LocalModelRow[] | null>(null);+ const [alive, setAlive] = useState<boolean | undefined>(undefined);+ const load = () =>+ getLocalModels(provider)+ .then((r) => {+ setRows(r.models || []);+ setAlive(r.alive);+ })+ .catch(() => setRows([]));+ useEffect(() => {+ load();+ // eslint-disable-next-line react-hooks/exhaustive-deps+ }, [provider]);+ if (rows === null) return null;+ const inPicker = (id: string) => curated.includes(id);+ const toggle = async (row: LocalModelRow) => {+ if (inPicker(row.model)) {+ if (row.model === defaultModel) return;+ await removeModel(row.model);+ } else {+ await addModel(row.model);+ }+ onChanged();+ };+ const fitLabel = (row: LocalModelRow) => {+ if (row.tools === false) return <span className="text-faint">{t("manage.fit_not_usable")}</span>;+ const cls = row.fit === "runs_well" ? "text-ok" : row.fit === "tight" || row.fit === "too_large" ? "text-warnInk" : "text-faint";+ return <span className={cls}>{t(`manage.fit_${row.fit}`)}</span>;+ };+ const vllmOff = provider === "vllm" && rows.some((r) => r.tools === false);+ return (+ <div className="mt-6" data-testid="local-models">+ <div className="flex items-center mb-2">+ <div className="text-label text-faint font-semibold tracking-wide uppercase">+ {t(provider === "ollama" ? "manage.local_models_title" : "manage.local_models_title_server")}+ </div>+ {provider === "ollama" && (+ <a className="ml-auto text-meta text-accent" href="https://ollama.com/search?c=tools" target="_blank" rel="noreferrer">+ {t("manage.get_more_models")} ↗+ </a>+ )}+ </div>+ {alive === false && <p className="text-meta text-warnInk mb-2">{t("manage.local_server_not_answering")}</p>}+ {vllmOff && (+ <div className="rounded-lg border border-line bg-warnSoft text-warnInk text-meta px-3 py-2 mb-2" data-testid="vllm-tools-off">+ {t("manage.vllm_tools_off")}+ <code className="block mt-1 text-[11px]">--enable-auto-tool-choice --tool-call-parser <name></code>+ </div>+ )}+ <div className="rounded-xl border border-line bg-panel">+ <div className="grid grid-cols-[22px_1fr_56px_52px_72px_104px_52px_22px_22px] items-center gap-2.5 px-3.5 py-1.5 text-label text-faint">+ <span />+ <span>{t("manage.col_model")}</span>+ <span>{t("manage.col_size")}</span>+ <span>{t("manage.col_tools")}</span>+ <span>{t("manage.col_reasoning")}</span>+ <span>{t("manage.col_fit")}</span>+ <span>{t("manage.col_context")}</span>+ <span />+ <span />+ </div>+ {rows.map((row) => {+ const usable = row.tools !== false;+ const ticked = inPicker(row.model);+ return (+ <div+ key={row.model}+ className={"grid grid-cols-[22px_1fr_56px_52px_72px_104px_52px_22px_22px] items-center gap-2.5 px-3.5 py-2.5 border-t border-line" + (usable ? "" : " opacity-60")}+ data-testid={`local-model-${row.name}`}+ >+ <input type="checkbox" checked={ticked} disabled={!usable || row.model === defaultModel} onChange={() => toggle(row)} />+ <span className="min-w-0">+ <span className="block font-mono text-[12.5px] truncate" title={row.model}>{row.name}</span>+ {!usable && <span className="block text-meta text-muted">{t("manage.no_tools_note")}</span>}+ </span>+ <span className="text-meta text-muted">{row.remote ? t("manage.fit_cloud") : fmtBytes(row.size_bytes)}</span>+ <span className={"text-meta " + (row.tools ? "text-ok" : "text-faint")}>{row.tools === null ? "—" : row.tools ? "✓" : "✗"}</span>+ <span className={"text-meta " + (row.thinking ? "text-ok" : "text-faint")}>{row.thinking ? `✓ ${t("manage.thinking_tag")}` : "—"}</span>+ <span className="text-meta">{fitLabel(row)}</span>+ <span className="text-meta text-muted">{fmtContext(row.context)}</span>+ {usable ? (+ <button className="text-faint hover:text-ink" title={t("manage.configure_model")} onClick={() => onConfigure(row.model)} data-testid={`local-model-configure-${row.name}`}>+ ⚙+ </button>+ ) : (+ <span />+ )}+ {usable && ticked && row.model !== defaultModel ? (+ <button className="text-faint hover:text-ink" title={t("manage.remove_from_picker")} onClick={() => toggle(row)}>+ ✕+ </button>+ ) : (+ <span />+ )}+ </div>+ );+ })}+ </div>+ <p className="text-meta text-muted mt-2 leading-relaxed">{t("manage.local_models_help")}</p>+ </div>+ );+}diff --git a/surfaces/gui/src/components/models/PickModelDialog.tsx b/surfaces/gui/src/components/models/PickModelDialog.tsxnew file mode 100644index 00000000..12dad753--- /dev/null+++ b/surfaces/gui/src/components/models/PickModelDialog.tsx@@ -0,0 +1,384 @@+// "Pick a model" (UX-055): one short dialog, three steps as a vertical flow. Provider+// (connected ones only, filtered by kind), model (what the server holds, or a typed+// name), settings (compact selects with the recommended value as a quiet note). Opened+// with a model id it is the settings step alone, with Remove at the bottom.+import { useEffect, useMemo, useState } from "react";+import { useTranslation } from "react-i18next";++import {+ addModel,+ getLocalModels,+ getModelConfig,+ removeModel,+ removeModelConfig,+ setModelConfig,+ type LocalModelRow,+ type ModelConfigView,+ type ModelSettings,+ type ProviderInfo,+} from "../../api";+import { fmtBytes, fmtContext } from "./LocalModels";+import { providerConnected, providerKind } from "./ProviderGroups";++type Kind = "local" | "subscription" | "api_key";+const KINDS: Kind[] = ["local", "subscription", "api_key"];+const CONTEXT_STEPS = [16384, 32768, 65536, 131072, 262144, 1048576];+const REPLY_STEPS = [4096, 8192, 16384, 32768, 65536];+const COMPACT_STEPS = [0.6, 0.7, 0.8, 0.9];++export function fullModelId(provider: ProviderInfo, bare: string): string {+ return provider.name === "openai" ? bare : `${provider.name}:${bare}`;+}++type Draft = {+ context_size?: number;+ max_output_tokens?: number;+ thinking?: boolean;+ reasoning_effort?: string;+ temperature?: number;+ top_p?: number;+ compaction_threshold_pct?: number | null; // null = the machine setting+ default?: boolean;+ custom_sampling?: boolean;+};++export function PickModelDialog({+ providers,+ settings,+ keylessOk,+ configure,+ onClose,+ onChanged,+}: {+ providers: ProviderInfo[];+ settings: ModelSettings;+ keylessOk: Set<string>;+ configure?: string | null; // a model id → settings only+ onClose: () => void;+ onChanged: () => void;+}) {+ const { t } = useTranslation();+ const configuring = !!configure;+ const [kinds, setKinds] = useState<Set<Kind>>(new Set(KINDS));+ const [step, setStep] = useState<1 | 2 | 3>(configuring ? 3 : 1);+ const [provider, setProvider] = useState<ProviderInfo | null>(() => {+ if (!configure) return null;+ const i = configure.indexOf(":");+ const name = i > 0 && providers.some((p) => p.name === configure.slice(0, i)) ? configure.slice(0, i) : "openai";+ return providers.find((p) => p.name === name) || null;+ });+ const [model, setModel] = useState<string>(configure || "");+ const [typed, setTyped] = useState("");+ const [query, setQuery] = useState("");+ const [rows, setRows] = useState<LocalModelRow[] | null>(null);+ const [view, setView] = useState<ModelConfigView | null>(null);+ const [draft, setDraft] = useState<Draft>({});+ const [busy, setBusy] = useState(false);+ const [error, setError] = useState("");++ const connected = providers.filter((p) => providerConnected(p, keylessOk) && kinds.has(providerKind(p)));+ const isLocal = provider ? providerKind(provider) === "local" : false;+ const fixedContext = provider?.name === "llamacpp" || provider?.name === "vllm";++ // Step 2: the models the chosen provider offers. Also read when the dialog opens on+ // step 3 for a local model, since the settings need the model's own facts.+ useEffect(() => {+ if (!provider || (step !== 2 && !(step === 3 && providerKind(provider) === "local" && rows === null))) return;+ setRows(null);+ if (providerKind(provider) === "local") {+ getLocalModels(provider.name).then((r) => setRows((r.models || []).filter((m) => m.tools !== false))).catch(() => setRows([]));+ } else {+ setRows(provider.suggested_models.map((bare) => ({+ model: fullModelId(provider, bare), name: bare, size_bytes: null, tools: true, thinking: null, vision: null, remote: true,+ parameter_size: null, quantization: null, context_max: null, context: null, context_from: "server", fit: "cloud", recommendation: null,+ })));+ }+ // eslint-disable-next-line react-hooks/exhaustive-deps+ }, [provider, step]);++ // Step 3: the settings in force for the chosen model.+ useEffect(() => {+ if (!model || step !== 3) return;+ setView(null);+ getModelConfig(model)+ .then((v) => {+ setView(v);+ setDraft({+ context_size: num(v.context_size),+ max_output_tokens: num(v.max_output_tokens),+ thinking: bool(v.thinking),+ reasoning_effort: str(v.reasoning_effort),+ temperature: num(v.temperature),+ top_p: num(v.top_p),+ compaction_threshold_pct: v.compaction_threshold_pct ? num(v.compaction_threshold_pct) : null,+ default: !!v.default?.value || settings.model === model,+ custom_sampling: v.temperature?.from === "user" || v.top_p?.from === "user",+ });+ })+ .catch(() => setView({ model, default: { value: false, from: "user" } }));+ }, [model, step, settings.model]);++ const row = useMemo(() => rows?.find((r) => r.model === model) || null, [rows, model]);+ const rec = view?.recommendation;+ const contextMax = row?.context_max || rec?.context_max || null;+ const machineContext = row?.context_from === "machine" ? row.context : null;+ const thinkingAvailable = row?.thinking || rec?.thinking.available || false;++ const save = async () => {+ if (!model) return;+ setBusy(true);+ setError("");+ const values: Record<string, number | boolean | string | null> = {+ max_output_tokens: draft.max_output_tokens ?? null,+ thinking: thinkingAvailable ? (draft.thinking ?? null) : null,+ reasoning_effort: draft.reasoning_effort || null,+ temperature: draft.custom_sampling ? (draft.temperature ?? null) : null,+ top_p: draft.custom_sampling ? (draft.top_p ?? null) : null,+ compaction_threshold_pct: draft.compaction_threshold_pct ?? null,+ default: !!draft.default,+ };+ if (isLocal && !fixedContext) values.context_size = draft.context_size ?? null;+ const saved = await setModelConfig(model, values);+ if (!saved.ok) {+ setError(saved.error || "");+ setBusy(false);+ return;+ }+ if (!settings.models.includes(model)) await addModel(model);+ setBusy(false);+ onChanged();+ onClose();+ };++ const remove = async () => {+ if (!model) return;+ await removeModel(model);+ await removeModelConfig(model);+ onChanged();+ onClose();+ };++ const reset = () => {+ if (!view) return;+ setDraft((d) => ({+ ...d,+ context_size: machineContext || d.context_size,+ max_output_tokens: rec?.max_output_tokens || undefined,+ thinking: rec?.thinking.available ? rec.thinking.default : d.thinking,+ reasoning_effort: undefined,+ custom_sampling: false,+ compaction_threshold_pct: null,+ }));+ };++ const marker = (n: number, state: "done" | "now" | "todo") => (+ <span+ className={+ "w-[18px] h-[18px] rounded-full border flex items-center justify-center text-[10px] font-medium shrink-0 " ++ (state === "now" ? "bg-ink border-ink text-panel" : state === "done" ? "bg-chrome border-lineStrong text-ink" : "border-lineStrong text-faint")+ }+ >+ {state === "done" ? "✓" : n}+ </span>+ );+ const line = (n: number, state: "done" | "now" | "todo", label: string, value?: string, onChange?: () => void, hint?: string, mono?: boolean) => (+ <div className={"flex items-center gap-3 min-h-[20px] text-ui " + (state === "todo" ? "text-faint" : "font-medium")}>+ {marker(n, state)}+ <span>{label}</span>+ {value && <span className={"font-normal text-muted truncate " + (mono ? "font-mono text-[12.5px]" : "")}>{value}</span>}+ {onChange && !configuring && (+ <button className="ml-auto text-meta text-muted hover:text-ink font-normal" onClick={onChange}>{t("pick.change")}</button>+ )}+ {hint && <span className="ml-auto text-meta text-faint font-normal">{hint}</span>}+ </div>+ );+ const select = (key: string, value: string, options: { v: string; label: string }[], onPick: (v: string) => void) => (+ <select+ className="rounded-lg border border-line bg-panel px-2 py-1.5 text-ui outline-none"+ value={value}+ onChange={(e) => onPick(e.target.value)}+ data-testid={`pick-${key}`}+ >+ {options.map((o) => (+ <option key={o.v} value={o.v}>{o.label}</option>+ ))}+ </select>+ );+ const setting = (key: string, label: string, control: JSX.Element, note: string) => (+ <div className="grid grid-cols-[110px_150px_1fr] items-center gap-3 py-1.5 text-ui" key={key}>+ <span>{label}</span>+ {control}+ <span className="text-meta text-faint">{note}</span>+ </div>+ );+ const recNote = (from: "user" | "recommended" | undefined, extra?: string) =>+ [from === "recommended" ? t("pick.recommended") : "", extra || ""].filter(Boolean).join(" ");++ return (+ <div className="fixed inset-0 z-50 bg-ink/30 grid place-items-center" data-testid="pick-model-dialog" onClick={onClose}>+ <div className="w-[520px] max-w-[94vw] max-h-[90vh] overflow-auto rounded-xl bg-panel shadow-2xl p-5" onClick={(e) => e.stopPropagation()}>+ <h3 className="text-heading font-semibold mb-3.5">{configuring ? settings.model_labels?.[model] || model : t("pick.title")}</h3>++ <div className="flex flex-col gap-4">+ {/* 1 · provider */}+ <div className="relative">+ {step === 1 ? (+ <>+ {line(1, "now", t("pick.provider"))}+ <div className="ml-[30px] mt-2.5">+ <div className="flex gap-3.5 mb-2.5 text-meta text-muted">+ {KINDS.map((k) => (+ <label key={k} className="flex items-center gap-1.5">+ <input type="checkbox" checked={kinds.has(k)} onChange={() => setKinds((s) => { const n = new Set(s); n.has(k) ? n.delete(k) : n.add(k); return n; })} />+ {t(`pick.kind_${k}`)}+ </label>+ ))}+ </div>+ <div className="rounded-lg border border-line max-h-[236px] overflow-auto">+ {connected.map((p) => (+ <button+ key={p.name}+ className={"w-full flex items-center gap-2 px-3 py-2 text-ui text-left border-t border-line first:border-t-0 " + (provider?.name === p.name ? "bg-chrome" : "hover:bg-chrome")}+ onClick={() => { setProvider(p); setModel(""); setStep(2); }}+ data-testid={`pick-provider-${p.name}`}+ >+ {p.title}+ <span className="text-[11px] text-faint ml-1.5">{t(`pick.kind_${providerKind(p)}`)}</span>+ <span className="ml-auto text-meta text-ok">{p.auth === "oauth" ? t("provider.signed_in") : p.needs_key ? t("provider.connected_ok") : t("provider.running")}</span>+ </button>+ ))}+ {connected.length === 0 && <div className="px-3 py-3 text-meta text-faint">{t("pick.none_connected")}</div>}+ </div>+ <p className="text-meta text-faint mt-2">{t("pick.only_connected")}</p>+ </div>+ </>+ ) : (+ line(1, "done", t("pick.provider"), provider?.title, () => setStep(1))+ )}+ </div>++ {/* 2 · model */}+ <div>+ {step < 2 ? (+ line(2, "todo", t("pick.model"), undefined, undefined, t("pick.after_provider"))+ ) : step === 2 ? (+ <>+ {line(2, "now", t("pick.model"))}+ <div className="ml-[30px] mt-2.5">+ <div className="rounded-lg border border-line max-h-[260px] overflow-auto">+ <input+ className="w-full px-3 py-2 text-ui outline-none border-b border-line bg-transparent"+ placeholder={isLocal ? t("pick.search_or_pull") : t("pick.search_or_type")}+ value={query}+ onChange={(e) => { setQuery(e.target.value); setTyped(e.target.value); }}+ data-testid="pick-model-search"+ />+ {(rows || []).filter((r) => !query || r.name.toLowerCase().includes(query.toLowerCase())).map((r) => (+ <button+ key={r.model}+ className="w-full flex items-center gap-2 px-3 py-2 text-ui text-left border-t border-line hover:bg-chrome"+ onClick={() => { setModel(r.model); setStep(3); }}+ data-testid={`pick-model-${r.name}`}+ >+ <span className="truncate">{settings.model_labels?.[r.model] || r.name}</span>+ <span className="ml-auto text-meta text-faint shrink-0">+ {[r.size_bytes ? fmtBytes(r.size_bytes) : "", r.tools ? t("pick.tools") : "", r.thinking ? t("manage.thinking_tag") : ""].filter(Boolean).join(" · ")}+ </span>+ </button>+ ))}+ {rows === null && <div className="px-3 py-3 text-meta text-faint">{t("manage.loading")}</div>}+ </div>+ {typed.trim() && provider && !isLocal && (+ <button className="mt-2 text-meta text-accent" onClick={() => { setModel(fullModelId(provider, typed.trim())); setStep(3); }} data-testid="pick-model-typed">+ {t("pick.use_typed", { name: typed.trim() })}+ </button>+ )}+ </div>+ </>+ ) : (+ line(2, "done", t("pick.model"), settings.model_labels?.[model] || model.replace(/^[^:]+:/, ""), () => setStep(2), undefined, true)+ )}+ </div>++ {/* 3 · settings */}+ <div>+ {step < 3 ? (+ line(3, "todo", t("pick.settings"), undefined, undefined, t("pick.after_model"))+ ) : (+ <>+ {line(3, "now", t("pick.settings"), undefined, undefined, [rec?.name, row?.size_bytes ? fmtBytes(row.size_bytes) : "", row?.tools || rec ? t("pick.tools") : "", thinkingAvailable ? t("manage.thinking_tag") : ""].filter(Boolean).join(" · "))}+ {view && (+ <div className="ml-[30px] mt-2" data-testid="pick-settings">+ {isLocal && !fixedContext &&+ setting("context", t("pick.context_size"),+ select("context", String(draft.context_size || machineContext || ""), CONTEXT_STEPS.filter((c) => !contextMax || c <= contextMax).map((c) => ({ v: String(c), label: fmtContext(c) })), (v) => setDraft((d) => ({ ...d, context_size: Number(v) }))),+ recNote(draft.context_size === machineContext || !draft.context_size ? "recommended" : "user", rec?.context_for_agents ? t("pick.maker_suggests", { ctx: fmtContext(rec.context_for_agents) }) : ""))}+ {fixedContext && row?.context &&+ setting("context", t("pick.context_size"), <span className="text-ui text-muted">{fmtContext(row.context)}</span>, t("pick.set_at_start"))}+ {setting("reply", t("pick.longest_reply"),+ select("reply", String(draft.max_output_tokens || ""), [{ v: "", label: t("pick.provider_default") }, ...REPLY_STEPS.map((c) => ({ v: String(c), label: `${fmtContext(c)} ${t("pick.tokens")}` }))], (v) => setDraft((d) => ({ ...d, max_output_tokens: v ? Number(v) : undefined }))),+ recNote(rec?.max_output_tokens && draft.max_output_tokens === rec.max_output_tokens ? "recommended" : undefined))}+ {thinkingAvailable &&+ setting("thinking", t("pick.thinking"),+ select("thinking", draft.thinking === false ? "off" : "on", [{ v: "on", label: t("pick.on") }, { v: "off", label: t("pick.off") }], (v) => setDraft((d) => ({ ...d, thinking: v === "on" }))),+ rec ? t("pick.makers_default", { value: rec.thinking.default ? t("pick.on") : t("pick.off") }) : "")}+ {!isLocal &&+ setting("effort", t("pick.effort"),+ select("effort", draft.reasoning_effort || "", [{ v: "", label: t("pick.provider_default") }, { v: "low", label: t("pick.low") }, { v: "medium", label: t("pick.medium") }, { v: "high", label: t("pick.high") }], (v) => setDraft((d) => ({ ...d, reasoning_effort: v || undefined }))),+ t("pick.effort_note"))}+ {(rec?.sampling.temperature !== undefined || draft.custom_sampling) &&+ setting("sampling", t("pick.sampling"),+ select("sampling", draft.custom_sampling ? "custom" : "rec", [{ v: "rec", label: rec ? t("pick.makers_settings") : t("pick.provider_default") }, { v: "custom", label: t("pick.custom") }], (v) => setDraft((d) => ({ ...d, custom_sampling: v === "custom", temperature: d.temperature ?? rec?.sampling.temperature, top_p: d.top_p ?? rec?.sampling.top_p }))),+ rec ? `${t("pick.temperature")} ${rec.sampling.temperature}, top-p ${rec.sampling.top_p}.` : "")}+ {draft.custom_sampling && (+ <div className="grid grid-cols-[110px_150px_1fr] items-center gap-3 py-1 text-ui">+ <span />+ <span className="flex gap-2">+ <input className="w-[70px] rounded-lg border border-line px-2 py-1 text-ui" type="number" step="0.1" min="0" max="2" value={draft.temperature ?? ""} onChange={(e) => setDraft((d) => ({ ...d, temperature: Number(e.target.value) }))} data-testid="pick-temperature" />+ <input className="w-[70px] rounded-lg border border-line px-2 py-1 text-ui" type="number" step="0.05" min="0" max="1" value={draft.top_p ?? ""} onChange={(e) => setDraft((d) => ({ ...d, top_p: Number(e.target.value) }))} data-testid="pick-top-p" />+ </span>+ <span className="text-meta text-faint">{t("pick.temperature")} · top-p</span>+ </div>+ )}+ {setting("compact", t("pick.auto_compact"),+ select("compact", draft.compaction_threshold_pct == null ? "" : String(draft.compaction_threshold_pct), [{ v: "", label: t("pick.machine_setting") }, ...COMPACT_STEPS.map((c) => ({ v: String(c), label: `${Math.round(c * 100)}%` }))], (v) => setDraft((d) => ({ ...d, compaction_threshold_pct: v ? Number(v) : null }))),+ t("pick.compact_note", { pct: Math.round((settings.compaction_threshold_pct || 0.8) * 100) }))}+ <label className="flex items-center gap-2 text-ui mt-2.5">+ <input type="checkbox" checked={!!draft.default} disabled={settings.model === model} onChange={(e) => setDraft((d) => ({ ...d, default: e.target.checked }))} data-testid="pick-default" />+ {t("pick.make_default")}+ </label>+ </div>+ )}+ </>+ )}+ </div>+ </div>++ {error && <p className="text-meta text-danger mt-3">{error}</p>}+ <div className="flex items-center gap-2 mt-4 pt-3.5 border-t border-line">+ {step === 3 && !configuring && <button className="text-meta text-accent" onClick={reset}>{t("pick.reset")}</button>}+ {configuring && (+ <button className="text-ui text-danger/80 hover:text-danger" onClick={remove} disabled={settings.model === model} data-testid="pick-remove">+ {t("manage.remove_from_picker_btn")}+ </button>+ )}+ <span className="flex-1" />+ <button className="rounded-lg border border-lineStrong px-3 py-1.5 text-ui" onClick={onClose}>{t("pick.cancel")}</button>+ {step === 3 ? (+ <button className="rounded-lg bg-accent text-panel px-3 py-1.5 text-ui font-medium" onClick={save} disabled={busy || !view} data-testid="pick-save">+ {configuring ? t("pick.save") : t("pick.add")}+ </button>+ ) : (+ <button className="rounded-lg bg-accent text-panel px-3 py-1.5 text-ui font-medium" disabled={step === 1 ? !provider : !model} onClick={() => setStep((s) => (s === 1 ? 2 : 3))}>+ {t("pick.next")}+ </button>+ )}+ </div>+ </div>+ </div>+ );+}++const num = (v?: { value: unknown }) => (typeof v?.value === "number" ? v.value : undefined);+const bool = (v?: { value: unknown }) => (typeof v?.value === "boolean" ? v.value : undefined);+const str = (v?: { value: unknown }) => (typeof v?.value === "string" ? v.value : undefined);diff --git a/surfaces/gui/src/components/models/ProviderGroups.tsx b/surfaces/gui/src/components/models/ProviderGroups.tsxnew file mode 100644index 00000000..eacbbe43--- /dev/null+++ b/surfaces/gui/src/components/models/ProviderGroups.tsx@@ -0,0 +1,114 @@+// 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.+// 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";+import { useTranslation } from "react-i18next";++import type { ProviderInfo } from "../../api";+import { ProviderMark, type ProviderSetupState } from "../../providers/ProviderSetup";++type Kind = "local" | "subscription" | "api_key";+const KINDS: Kind[] = ["local", "subscription", "api_key"];++export function providerKind(p: ProviderInfo): Kind {+ return p.kind || "api_key";+}++/** Connected = usable now: a key or sign-in stored, or a keyless local server that+ * answers (the setup state's `keylessOk`). */+export function providerConnected(p: ProviderInfo, keylessOk: Set<string>): boolean {+ if (p.auth === "oauth") return !!p.signed_in;+ if (!p.needs_key) return !!p.alive || keylessOk.has(p.name);+ return p.configured;+}++/** How many of the picker's models belong to a provider. */+export function modelCountFor(name: string, models: string[], known: string[]): number {+ return models.filter((id) => {+ const i = id.indexOf(":");+ const prov = i > 0 && known.includes(id.slice(0, i)) ? id.slice(0, i) : "openai";+ return prov === name;+ }).length;+}++export function ProviderGroups({+ ps,+ tp,+ models,+}: {+ ps: ProviderSetupState;+ tp: string;+ models: string[]; // the picker's models, for the count on each card+}) {+ const { t } = useTranslation();+ const [query, setQuery] = useState("");+ 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));+ 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";++ 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)}>+ <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>+ {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 })}+ </span>+ ) : connected && !p.needs_key && p.auth !== "oauth" ? (+ <span className="block text-meta text-ok font-medium truncate">{t("provider.running")}</span>+ ) : !connected && !p.needs_key && p.auth !== "oauth" && p.kind === "local" && p.name !== "ollama" ? (+ <span className="block text-meta text-faint truncate">{t("provider.not_connected")}</span>+ ) : (+ ps.statusFor(p, { lastUsed: true })+ )}+ </span>+ <span className="text-faint text-body">›</span>+ </button>+ );+ };++ 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>+ <input+ className="flex-1 bg-transparent outline-none text-ui"+ placeholder={t("manage.search_providers")}+ value={query}+ onChange={(e) => setQuery(e.target.value)}+ data-testid="provider-search"+ />+ </label>+ {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));+ 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>+ )}+ {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>+ );+ })}+ </div>+ );+}diff --git a/surfaces/gui/src/locales/en.json b/surfaces/gui/src/locales/en.jsonindex 964b7f83..1f2156c1 100644--- a/surfaces/gui/src/locales/en.json+++ b/surfaces/gui/src/locales/en.json@@ -1302,7 +1302,44 @@"tool_asks_approval": "{{name}} · {{kind}} · asks approval","tools_exposed": "Tools exposed to OpenWorker","unknown": "unknown",- "validating": "Validating…"+ "validating": "Validating…",+ "group_local": "On your own hardware",+ "group_subscription": "Subscriptions",+ "group_api_key": "API keys",+ "not_set_up_rule": "not set up",+ "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.",+ "your_system": "Your system",+ "sys_processor": "Processor",+ "sys_graphics": "Graphics",+ "sys_memory": "Memory",+ "sys_storage": "Storage",+ "sys_storage_free": "{{free}} free of {{total}}",+ "sys_runs_well": "Models up to about {{size}} run well on this system.",+ "local_models_title": "Models on this computer",+ "local_models_title_server": "What the server reports",+ "get_more_models": "Get more models",+ "col_model": "Model",+ "col_size": "Size",+ "col_tools": "Tools",+ "col_reasoning": "Reasoning",+ "col_fit": "On this computer",+ "col_context": "Context",+ "fit_runs_well": "Runs well",+ "fit_tight": "Tight fit",+ "fit_too_large": "Too large",+ "fit_cloud": "In the cloud",+ "fit_unknown": "—",+ "fit_not_usable": "Not usable",+ "no_tools_note": "Cannot use tools, so coworkers cannot work with it.",+ "thinking_tag": "thinking",+ "local_models_help": "Ticked models appear in the picker. ⚙ sets a model's context, reply length, thinking and sampling; ✕ takes it out of the picker.",+ "local_server_not_answering": "Nothing answers at this address.",+ "vllm_tools_off": "This server cannot use tools yet, so coworkers cannot work with it. Start vLLM with tool calling turned on, then check again.",+ "configure_model": "Settings for this model",+ "remove_from_picker_btn": "Remove from the picker"},"models": {"add_btn": "Add",@@ -1521,7 +1558,10 @@"oauth_start_error": "Couldn't start the sign-in.","copy_command": "Copy command","test_save_hint": "Runs one read-only check, then saves.",- "test_save_btn": "Test & save"+ "test_save_btn": "Test & save",+ "connected_count": "✓ Connected · {{count}} models",+ "running_count": "✓ Running · {{count}} models",+ "not_connected": "Not connected"},"workspace_trust": {"title": "Trust this workspace’s commands?",@@ -2696,5 +2736,52 @@"not_sub": "It was opened before the sandbox was switched on. Its commands run on this computer without the sandbox. Start a new session to use the sandbox.","open_settings": "Open Settings ▸ Sandbox","session_sites_label": "Sites allowed for this session only"+ },+ "pick": {+ "title": "Pick a model",+ "provider": "Provider",+ "model": "Model",+ "settings": "Settings",+ "change": "Change",+ "after_provider": "after the provider",+ "after_model": "after the model",+ "kind_local": "Local",+ "kind_subscription": "Subscription",+ "kind_api_key": "API key",+ "none_connected": "No connected provider matches.",+ "only_connected": "Only connected providers are listed. Others are set up in Models & Keys.",+ "search_or_pull": "Search, or type a name to pull…",+ "search_or_type": "Search, or type a model name…",+ "use_typed": "Use \"{{name}}\"",+ "tools": "tools",+ "recommended": "Recommended.",+ "maker_suggests": "The maker suggests {{ctx}} or more for agent work.",+ "context_size": "Context size",+ "set_at_start": "Set when the server starts.",+ "longest_reply": "Longest reply",+ "tokens": "tokens",+ "provider_default": "Provider default",+ "thinking": "Thinking",+ "on": "On",+ "off": "Off",+ "makers_default": "The maker's default is {{value}}.",+ "effort": "Effort",+ "low": "Low",+ "medium": "Medium",+ "high": "High",+ "effort_note": "For models with effort levels. Each session can change it.",+ "sampling": "Sampling",+ "makers_settings": "The maker's settings",+ "custom": "Custom…",+ "temperature": "Temperature",+ "auto_compact": "Auto-compact",+ "machine_setting": "Machine setting",+ "compact_note": "Summarises at {{pct}}% of the context unless changed here.",+ "make_default": "Make this the default for new sessions",+ "reset": "Reset",+ "cancel": "Cancel",+ "next": "Next",+ "add": "Add",+ "save": "Save"}}diff --git a/surfaces/gui/src/locales/zh.json b/surfaces/gui/src/locales/zh.jsonindex 5330f9d2..52cc6a57 100644--- a/surfaces/gui/src/locales/zh.json+++ b/surfaces/gui/src/locales/zh.json@@ -1285,7 +1285,44 @@"tool_asks_approval": "{{name}} · {{kind}} · 需审批","tools_exposed": "向 OpenWorker 提供的工具","unknown": "未知",- "validating": "验证中…"+ "validating": "验证中…",+ "group_local": "在你自己的硬件上",+ "group_subscription": "订阅",+ "group_api_key": "API 密钥",+ "not_set_up_rule": "未设置",+ "search_providers": "搜索提供商…",+ "picker_search": "搜索…",+ "pick_model_btn": "选择模型…",+ "composer_picker_help_v2": "开始会话时可选的模型。用 ✕ 移除;用“选择模型”添加或配置。",+ "your_system": "你的系统",+ "sys_processor": "处理器",+ "sys_graphics": "图形",+ "sys_memory": "内存",+ "sys_storage": "存储",+ "sys_storage_free": "{{total}} 中剩余 {{free}}",+ "sys_runs_well": "约 {{size}} 以内的模型在此系统上运行良好。",+ "local_models_title": "这台电脑上的模型",+ "local_models_title_server": "服务器报告",+ "get_more_models": "获取更多模型",+ "col_model": "模型",+ "col_size": "大小",+ "col_tools": "工具",+ "col_reasoning": "推理",+ "col_fit": "在这台电脑上",+ "col_context": "上下文",+ "fit_runs_well": "运行良好",+ "fit_tight": "勉强运行",+ "fit_too_large": "太大",+ "fit_cloud": "在云端",+ "fit_unknown": "—",+ "fit_not_usable": "不可用",+ "no_tools_note": "无法使用工具,因此同事无法使用它。",+ "thinking_tag": "思考",+ "local_models_help": "勾选的模型会出现在选择器中。⚙ 设置模型的上下文、回复长度、思考和采样;✕ 将其从选择器中移除。",+ "local_server_not_answering": "该地址没有响应。",+ "vllm_tools_off": "此服务器尚不能使用工具,因此同事无法使用它。请开启工具调用后重新启动 vLLM,然后再检查。",+ "configure_model": "此模型的设置",+ "remove_from_picker_btn": "从选择器中移除"},"models": {"add_btn": "添加",@@ -1501,7 +1538,10 @@"oauth_start_error": "无法启动登录。","copy_command": "复制命令","test_save_hint": "运行一次只读检查,然后保存。",- "test_save_btn": "测试并保存"+ "test_save_btn": "测试并保存",+ "connected_count": "✓ 已连接 · {{count}} 个模型",+ "running_count": "✓ 运行中 · {{count}} 个模型",+ "not_connected": "未连接"},"workspace_trust": {"title": "信任此工作区的命令?",@@ -2656,5 +2696,52 @@"not_sub": "它在开启沙盒之前打开,其命令在本机上不经沙盒运行。新建会话即可使用沙盒。","open_settings": "打开 设置 ▸ 沙盒","session_sites_label": "仅本次会话允许的网站"+ },+ "pick": {+ "title": "选择模型",+ "provider": "提供商",+ "model": "模型",+ "settings": "设置",+ "change": "更改",+ "after_provider": "先选提供商",+ "after_model": "先选模型",+ "kind_local": "本地",+ "kind_subscription": "订阅",+ "kind_api_key": "API 密钥",+ "none_connected": "没有匹配的已连接提供商。",+ "only_connected": "仅列出已连接的提供商。其他提供商在“模型与密钥”中设置。",+ "search_or_pull": "搜索,或输入名称以拉取…",+ "search_or_type": "搜索,或输入模型名称…",+ "use_typed": "使用“{{name}}”",+ "tools": "工具",+ "recommended": "推荐。",+ "maker_suggests": "厂商建议代理工作使用 {{ctx}} 或更大。",+ "context_size": "上下文大小",+ "set_at_start": "在服务器启动时设定。",+ "longest_reply": "最长回复",+ "tokens": "token",+ "provider_default": "提供商默认",+ "thinking": "思考",+ "on": "开",+ "off": "关",+ "makers_default": "厂商默认为{{value}}。",+ "effort": "推理强度",+ "low": "低",+ "medium": "中",+ "high": "高",+ "effort_note": "适用于有推理强度等级的模型。每个会话可单独更改。",+ "sampling": "采样",+ "makers_settings": "厂商设置",+ "custom": "自定义…",+ "temperature": "温度",+ "auto_compact": "自动压缩",+ "machine_setting": "机器设置",+ "compact_note": "除非在此更改,否则在上下文达到 {{pct}}% 时进行摘要。",+ "make_default": "设为新会话的默认模型",+ "reset": "重置",+ "cancel": "取消",+ "next": "下一步",+ "add": "添加",+ "save": "保存"}}