Open-source AI browser agent for Chrome and Firefox (monorepo) 🧠
JavaScript ai-agentai-agentsai-toolsbrowser-aibrowser-automationbrowser-extensionchrome-aichrome-devtoolschrome-extensionchrome-extensionsfirefox-addonfirefox-addonsfirefox-extensionfirefox-extensionsgemmagemma4minimaxoffline-aioffline-llmqwen
Add ODS local provider support
Emre Sokullu1bb2e6633f93
diff --git a/README.md b/README.mdindex af846998b..fbc0950c1 100644--- a/README.md+++ b/README.md@@ -112,7 +112,7 @@ preview `ollama launch webbrain --model <model>` handoff. Details:**Cloud APIs** — OpenAI, Anthropic Claude, Google Gemini, Azure OpenAI, AWSBedrock, Mistral, DeepSeek, xAI Grok, MiniMax, Kimi, Qwen, z.ai GLM, Groq,Together, Cloudflare, Nvidia NIM, Hugging Face, Fireworks, OpenRouter, and more.-Settings ships **106 built-in provider cards on Chromium** (105 on Firefox),+Settings ships **112 built-in provider cards on Chromium** (111 on Firefox),including an endpoint-free local WebGPU option with the tested LFM2.5 2.6Bpreset and an experimental custom Hugging Face ONNX repository option —see the [full catalog](docs/providers-and-models.md#extended-provider-catalog).@@ -198,7 +198,7 @@ Chrome side panel shortcuts work when the WebBrain side panel has focus.| [Architecture](docs/architecture.md) | System overview, turn flow, subsystems || [Agent tools](docs/agent-tools.md) | Tiers, modes, and the full tool matrix || [Slash commands](docs/slash-commands.md) | Every command and flag |-| [Providers and models](docs/providers-and-models.md) | All 105 provider cards, local setup, tiers |+| [Providers and models](docs/providers-and-models.md) | All provider cards, local setup, tiers || [Skills](docs/skills.md) | Bundled skills, importing, skill tools || [Security model](docs/security-model.md) | Permissions, credentials, trust boundaries || [Prompt-injection defense](docs/prompt-injection-defense.md) | Defense layers and known gaps |diff --git a/docs/providers-and-models.md b/docs/providers-and-models.mdindex a40656887..1775d768e 100644--- a/docs/providers-and-models.md+++ b/docs/providers-and-models.md@@ -86,6 +86,7 @@ class BaseLLMProvider {| `webbrain_cloud` | `openai` | cloud | `webbrain-cloud 1.0` | Yes || `llamacpp` | `llamacpp` | local | (loaded model) | Auto metadata / override || `ollama` | `openai` | local | (loaded model) | Auto via `/api/show` / override |+| `ods` | `openai` | local | (loaded model) | Auto via `/props` / override || `lmstudio` | `openai` | local | (loaded model) | Auto metadata / override || `osaurus` | `openai` | local | (required) | Off / manual toggle || `jan` | `openai` | local | (loaded model) | Yes (default on) |@@ -122,7 +123,7 @@ WebBrain also ships 79 disabled-by-default provider cards. Most are sourcedfrom the OpenCode provider catalog snapshot at commit`62e4641235d7847dadc60da37cca8a023dd54fc1`; provider-specific additions usetheir official API documentation. Together with the original cards, Settings-contains **111 built-in providers on Chromium** and **110 on Firefox**; the+contains **112 built-in providers on Chromium** and **111 on Firefox**; thedifference is the Chromium-only in-browser WebGPU runtime.| IDs |@@ -251,12 +252,13 @@ URL, localhost server, or OpenAI-compatible endpoint. Firefox does not exposethe card because its build does not package the Chromium MV3 offscreen/WebGPUruntime.-Eleven local endpoint providers are enabled by default. The model runtimes need no+Twelve local endpoint providers are enabled by default. The model runtimes need noAPI key unless the server was started with auth; Unsloth Studio and the genericproxy card require their configured client keys:- **llama.cpp**: `http://localhost:8080` — runs `llama-server -m model.gguf`- **Ollama**: `http://localhost:11434/v1` — `ollama serve`, or `ollama launch webbrain --model <model>`+- **ODS**: `http://localhost:11434/v1` — Osmantic ODS's local llama-server; set the URL to the port in ODS's `.env` (often `8080` on macOS)- **LM Studio**: `http://localhost:1234/v1` — LM Studio's local inference server- **Osaurus**: `http://127.0.0.1:1337/v1` — `osaurus serve --port 1337` on macOS- **Jan**: `http://localhost:1337/v1` — Jan's local OpenAI-compatible API server@@ -269,6 +271,17 @@ proxy card require their configured client keys:- **Unsloth Studio**: `http://127.0.0.1:8888/v1` by default, with a configurableport — Studio's API URL, loaded model, and generated API key are required+#### ODS++Open **Settings → Providers → ODS (Local)**, set the server URL to the local+inference port in ODS's `.env`, click **Load Models**, select the running model,+and click **Test Connection**. ODS exposes OpenAI-compatible `/v1/models` and+`/v1/chat/completions`; WebBrain reads `/props` for the live context window and+vision support when the installed backend exposes it. Add an API key only if+you configured ODS to require one. When ODS switches models, select the new+model in WebBrain unless your ODS installation exposes a stable alias. See the+[ODS quickstart](https://github.com/Osmantic/ODS/blob/main/ods/QUICKSTART.md).+#### OsaurusStart the Osaurus server on your Mac, then open **Settings → Providers →@@ -320,7 +333,7 @@ Keep the listener on `127.0.0.1`, require a strong random client key, and neverpublish the endpoint to a LAN or the internet. Official provider API keys remainthe stable default.-Ollama, llama.cpp, LM Studio, and LocalAI default to `visionMode: auto`. WebBrain asks+Ollama, llama.cpp, ODS, LM Studio, and LocalAI default to `visionMode: auto`. WebBrain asksthe selected server for model capability metadata before enrichment and sendsscreenshots only when the response explicitly reports image input. A failed ormalformed metadata request is text-only for that turn and is retried later;@@ -365,7 +378,7 @@ additionally depends on the model's tool-use training, the runtime's chattemplate/parser, and a current runtime version (LocalAI added tool streaming in3.10).-**Context window.** Load local models with **at least a 16k-token context window** for reliable agent runs — that's the usable minimum. 8k can work with the Compact tier selected; 4k is too small to hold the system prompt + tool schemas. The agent reads the window from `provider.contextWindow` (`providers/base.js`) to drive auto-compaction; when a provider config doesn't set `contextWindow`, local providers default to a conservative **16k** (cloud/router default to 128k). **Test connection** / **Load models** auto-detect for **llama.cpp**, **Ollama**, and **LM Studio** when reported (llama.cpp `GET /props` `n_ctx`, Ollama `GET /api/ps` live context then `/api/show` `num_ctx`, LM Studio `/api/v0/models` `loaded_context_length`). Detection refreshes the 16k default; it shrinks a larger manual override only from live/runtime context (not from Ollama `/api/show` alone). Jan / vLLM / SGLang / LocalAI / Unsloth Studio do not auto-detect yet. You can still set `config.contextWindow` explicitly, and the model server must actually be started with that much context (e.g. `llama-server -c 16384`).+**Context window.** Load local models with **at least a 16k-token context window** for reliable agent runs — that's the usable minimum. 8k can work with the Compact tier selected; 4k is too small to hold the system prompt + tool schemas. The agent reads the window from `provider.contextWindow` (`providers/base.js`) to drive auto-compaction; when a provider config doesn't set `contextWindow`, local providers default to a conservative **16k** (cloud/router default to 128k). **Test connection** / **Load models** auto-detect for **llama.cpp**, **ODS**, **Ollama**, and **LM Studio** when reported (llama.cpp / ODS `GET /props` `n_ctx`, Ollama `GET /api/ps` live context then `/api/show` `num_ctx`, LM Studio `/api/v0/models` `loaded_context_length`). Detection refreshes the 16k default; it shrinks a larger manual override only from live/runtime context (not from Ollama `/api/show` alone). Jan / vLLM / SGLang / LocalAI / Unsloth Studio do not auto-detect yet. You can still set `config.contextWindow` explicitly, and the model server must actually be started with that much context (e.g. `llama-server -c 16384`).### Prompt/tool tiers and modesdiff --git a/src/chrome/icons/providers/SOURCES.md b/src/chrome/icons/providers/SOURCES.mdindex 157f46436..c95d00446 100644--- a/src/chrome/icons/providers/SOURCES.md+++ b/src/chrome/icons/providers/SOURCES.md@@ -12,6 +12,7 @@ Most brand marks come from [Lobe Icons](https://github.com/lobehub/lobe-icons)| localai | LocalAI official logo (`mudler/LocalAI`) || gpt4all | Simple mark (not an official GPT4All brand asset) || local_openai_proxy, webgpu | WebBrain-authored generic local-runtime marks |+| ods | WebBrain-authored text mark for ODS (not an official ODS brand asset) || unsloth | Unsloth official `images/unsloth logo only.png` (`unslothai/unsloth`), vectorized || sglang | SGLang official `logo_square` (`sgl-project/sglang`) || webbrain_cloud | WebBrain extension icon |diff --git a/src/chrome/icons/providers/ods.svg b/src/chrome/icons/providers/ods.svgnew file mode 100644index 000000000..eec60107d--- /dev/null+++ b/src/chrome/icons/providers/ods.svg@@ -0,0 +1,5 @@+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" role="img" aria-labelledby="title">+ <title id="title">ODS</title>+ <rect width="24" height="24" rx="5" fill="#315DCA"/>+ <text x="12" y="15.2" fill="#fff" font-family="Arial, sans-serif" font-size="8" font-weight="700" text-anchor="middle">ODS</text>+</svg>diff --git a/src/chrome/src/providers/manager.js b/src/chrome/src/providers/manager.jsindex 421b833b8..dc063b0d0 100644--- a/src/chrome/src/providers/manager.js+++ b/src/chrome/src/providers/manager.js@@ -79,7 +79,7 @@ import {const WEBBRAIN_CLOUD_PROVIDER_ID = 'webbrain_cloud';const WEBBRAIN_CLOUD_PROVIDER_LABEL = 'WebBrain Compass';const DUPLICATE_PROVIDER_SUFFIX = '__duplicate';-const LOCAL_MODEL_LIST_PROVIDER_IDS = ['llamacpp', 'ollama', 'lmstudio', 'osaurus', 'jan', 'vllm', 'sglang', 'localai', 'gpt4all', 'local_openai_proxy', 'unsloth'];+const LOCAL_MODEL_LIST_PROVIDER_IDS = ['llamacpp', 'ollama', 'ods', 'lmstudio', 'osaurus', 'jan', 'vllm', 'sglang', 'localai', 'gpt4all', 'local_openai_proxy', 'unsloth'];const WEBBRAIN_CLOUD_CONTEXT_WINDOW = 1000000;const WEBBRAIN_CLOUD_LEGACY_CONTEXT_WINDOW = 256000;const WEBBRAIN_DEVICE_GUID_KEY = 'webbrainDeviceGuid';@@ -538,6 +538,21 @@ export class ProviderManager {visionDetection: null,enabled: true,},+ ods: {+ type: 'openai',+ category: 'local',+ label: 'ODS (Local)',+ providerName: 'ods',+ requiresModel: true,+ baseUrl: 'http://localhost:11434/v1',+ model: '',+ contextWindow: 16384,+ apiKey: '',+ supportsAskStreaming: true,+ visionMode: 'auto',+ visionDetection: null,+ enabled: true,+ },lmstudio: {type: 'openai',category: 'local',@@ -1276,7 +1291,7 @@ export class ProviderManager {static categoryFor(id, config) {if (config && config.category) return config.category;if (config?.type === 'llamacpp' || config?.type === 'webgpu') return 'local';- if (['llamacpp', 'ollama', 'lmstudio', 'osaurus', 'jan', 'vllm', 'sglang', 'localai', 'gpt4all', 'local_openai_proxy', 'unsloth', 'webgpu'].includes(id)) return 'local';+ if (['llamacpp', 'ollama', 'ods', 'lmstudio', 'osaurus', 'jan', 'vllm', 'sglang', 'localai', 'gpt4all', 'local_openai_proxy', 'unsloth', 'webgpu'].includes(id)) return 'local';if (ROUTER_PROVIDER_IDS.includes(id)) return 'router';return 'cloud';}@@ -1398,7 +1413,7 @@ export class ProviderManager {};const request = (async () => {try {- if (providerId === 'llamacpp') {+ if (providerId === 'llamacpp' || providerId === 'ods') {const query = identity.model ? `?model=${encodeURIComponent(identity.model)}` : '';const result = await fetchJson(`${root}/props${query}`);if (!result.ok) return result;@@ -2316,7 +2331,7 @@ export class ProviderManager {/*** Fetch selectable models for local providers. Ollama uses its native- * /api/tags endpoint; llama.cpp, LM Studio, Osaurus, Jan, vLLM, SGLang, LocalAI,+ * /api/tags endpoint; ODS, llama.cpp, LM Studio, Osaurus, Jan, vLLM, SGLang, LocalAI,* GPT4All, Unsloth Studio, and generic local proxies use* OpenAI-compatible /v1/models.*/@@ -2392,6 +2407,15 @@ export class ProviderManager {continue;}const data = await res.json();+ // ODS commonly shares Ollama's port. During automatic onboarding,+ // require its llama-server /props endpoint before offering an ODS card.+ if (detectServerIdentity && provider.config.configured !== true && definitionId === 'ods') {+ try {+ const root = candidate.configBaseUrl.replace(/\/v1$/i, '');+ const identity = await fetchWithFallback(`${root}/props`, { method: 'GET', headers });+ if (!identity.ok) return { ok: true, models: [] };+ } catch { return { ok: true, models: [] }; }+ }// Jan and Osaurus share port 1337. Successful OpenAI model discovery// alone cannot identify which server answered an unconfigured card.if (detectServerIdentity && provider.config.configured !== true@@ -2632,7 +2656,7 @@ export class ProviderManager {};}- if (definitionId === 'llamacpp') {+ if (definitionId === 'llamacpp' || definitionId === 'ods') {const res = await fetchWithFallback(`${root}/props`, { method: 'GET', headers });if (!res.ok) return null;const contextWindow = parseLlamaCppPropsContextWindow(await res.json());diff --git a/src/chrome/src/providers/provider-compatibility.js b/src/chrome/src/providers/provider-compatibility.jsindex d05026293..63101f53c 100644--- a/src/chrome/src/providers/provider-compatibility.js+++ b/src/chrome/src/providers/provider-compatibility.js@@ -17,6 +17,7 @@ export const OPENROUTER_ROUTING_VARIANTS = Object.freeze(['standard', 'nitro', 'const STRUCTURED_OUTPUT_PROVIDER_NAMES = new Set(['azure-openai','llamacpp',+ 'ods','lmstudio','localai','ollama',@@ -27,6 +28,7 @@ const STRUCTURED_OUTPUT_PROVIDER_NAMES = new Set([]);const LOCAL_OPENAI_COMPAT_PROVIDER_NAMES = new Set(['llamacpp',+ 'ods','lmstudio','localai','ollama',diff --git a/src/chrome/src/providers/vision-capabilities.js b/src/chrome/src/providers/vision-capabilities.jsindex 830178c9b..cae05412e 100644--- a/src/chrome/src/providers/vision-capabilities.js+++ b/src/chrome/src/providers/vision-capabilities.js@@ -1,8 +1,9 @@-export const AUTO_VISION_PROVIDER_IDS = new Set(['llamacpp', 'lmstudio', 'localai']);+export const AUTO_VISION_PROVIDER_IDS = new Set(['llamacpp', 'ods', 'lmstudio', 'localai']);export const VISION_MODES = new Set(['auto', 'on', 'off']);const DETECTION_SOURCES = {llamacpp: 'llamacpp_props',+ ods: 'llamacpp_props',lmstudio: 'lmstudio_models',localai: 'localai_capabilities',};diff --git a/src/chrome/src/ui/provider-icons.js b/src/chrome/src/ui/provider-icons.jsindex ebabe0823..0f7e8573a 100644--- a/src/chrome/src/ui/provider-icons.js+++ b/src/chrome/src/ui/provider-icons.js@@ -14,6 +14,7 @@ export const PROVIDER_ICON_FILES = {webbrain_cloud: 'webbrain_cloud.png',llamacpp: 'llamacpp.svg',ollama: 'ollama.svg',+ ods: 'ods.svg',lmstudio: 'lmstudio.svg',osaurus: 'osaurus.svg',jan: 'jan.png',@@ -83,6 +84,7 @@ export const PROVIDER_SHORT_LABELS = {webbrain_cloud: 'WebBrain Compass',llamacpp: 'llama.cpp',ollama: 'Ollama',+ ods: 'ODS',lmstudio: 'LM Studio',osaurus: 'Osaurus',jan: 'Jan',diff --git a/src/chrome/src/ui/settings.js b/src/chrome/src/ui/settings.jsindex 4812fc8f0..d26029ecc 100644--- a/src/chrome/src/ui/settings.js+++ b/src/chrome/src/ui/settings.js@@ -3045,6 +3045,16 @@ function renderProviders() {PROMPT_TIER_FIELD,],},+ ods: {+ fields: [+ { key: 'baseUrl', labelKey: 'st.provider.field.server_url', type: 'text', placeholder: 'http://localhost:11434/v1' },+ OPTIONAL_LOCAL_API_KEY_FIELD,+ { key: 'model', labelKey: 'st.provider.field.model', type: 'text', placeholder: 'select the running ODS model' },+ CONTEXT_WINDOW_FIELD,+ VISION_MODE_FIELD,+ PROMPT_TIER_FIELD,+ ],+ },lmstudio: {fields: [{ key: 'baseUrl', labelKey: 'st.provider.field.server_url', type: 'text', placeholder: 'http://localhost:1234/v1' },@@ -3513,7 +3523,7 @@ function renderProviders() {</div>`;} else {- const localModelProviders = ['llamacpp', 'ollama', 'lmstudio', 'osaurus', 'jan', 'vllm', 'sglang', 'localai', 'gpt4all', 'local_openai_proxy', 'unsloth'];+ const localModelProviders = ['llamacpp', 'ollama', 'ods', 'lmstudio', 'osaurus', 'jan', 'vllm', 'sglang', 'localai', 'gpt4all', 'local_openai_proxy', 'unsloth'];const canLoadModels = localModelProviders.includes(definitionId) && field.key === 'model';const listAttr = canLoadModels ? `list="models-${id}"` : '';const datalistHTML = canLoadModels ? `<datalist id="models-${id}"></datalist>` : '';diff --git a/src/chrome/src/ui/sidepanel.js b/src/chrome/src/ui/sidepanel.jsindex ee6f06e70..593a4ad4a 100644--- a/src/chrome/src/ui/sidepanel.js+++ b/src/chrome/src/ui/sidepanel.js@@ -250,7 +250,7 @@ const pinCoachmarkDismissed = (async function initPinCoachmark() {const localModels = document.getElementById('ob-local-models');const localModelList = document.getElementById('ob-local-model-list');const totalSteps = steps.length;- const LOCAL_PROVIDER_ORDER = ['unsloth', 'local_openai_proxy', 'jan', 'osaurus', 'lmstudio', 'ollama', 'llamacpp', 'vllm', 'sglang', 'localai', 'gpt4all'];+ const LOCAL_PROVIDER_ORDER = ['unsloth', 'local_openai_proxy', 'jan', 'osaurus', 'lmstudio', 'ollama', 'ods', 'llamacpp', 'vllm', 'sglang', 'localai', 'gpt4all'];let current = 0;let localScanStarted = false;let localModelChoices = [];diff --git a/src/firefox/icons/providers/SOURCES.md b/src/firefox/icons/providers/SOURCES.mdindex d422323b6..7aa3f5b4e 100644--- a/src/firefox/icons/providers/SOURCES.md+++ b/src/firefox/icons/providers/SOURCES.md@@ -12,6 +12,7 @@ Most brand marks come from [Lobe Icons](https://github.com/lobehub/lobe-icons)| localai | LocalAI official logo (`mudler/LocalAI`) || gpt4all | Simple mark (not an official GPT4All brand asset) || local_openai_proxy | WebBrain-authored generic proxy mark |+| ods | WebBrain-authored text mark for ODS (not an official ODS brand asset) || unsloth | Unsloth official `images/unsloth logo only.png` (`unslothai/unsloth`), vectorized || sglang | SGLang official `logo_square` (`sgl-project/sglang`) || webbrain_cloud | WebBrain extension icon |diff --git a/src/firefox/icons/providers/ods.svg b/src/firefox/icons/providers/ods.svgnew file mode 100644index 000000000..eec60107d--- /dev/null+++ b/src/firefox/icons/providers/ods.svg@@ -0,0 +1,5 @@+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" role="img" aria-labelledby="title">+ <title id="title">ODS</title>+ <rect width="24" height="24" rx="5" fill="#315DCA"/>+ <text x="12" y="15.2" fill="#fff" font-family="Arial, sans-serif" font-size="8" font-weight="700" text-anchor="middle">ODS</text>+</svg>diff --git a/src/firefox/src/providers/manager.js b/src/firefox/src/providers/manager.jsindex 8a8e096d9..f01e04629 100644--- a/src/firefox/src/providers/manager.js+++ b/src/firefox/src/providers/manager.js@@ -53,7 +53,7 @@ import {const WEBBRAIN_CLOUD_PROVIDER_ID = 'webbrain_cloud';const WEBBRAIN_CLOUD_PROVIDER_LABEL = 'WebBrain Compass';const DUPLICATE_PROVIDER_SUFFIX = '__duplicate';-const LOCAL_MODEL_LIST_PROVIDER_IDS = ['llamacpp', 'ollama', 'lmstudio', 'osaurus', 'jan', 'vllm', 'sglang', 'localai', 'gpt4all', 'local_openai_proxy', 'unsloth'];+const LOCAL_MODEL_LIST_PROVIDER_IDS = ['llamacpp', 'ollama', 'ods', 'lmstudio', 'osaurus', 'jan', 'vllm', 'sglang', 'localai', 'gpt4all', 'local_openai_proxy', 'unsloth'];const WEBBRAIN_CLOUD_CONTEXT_WINDOW = 1000000;const WEBBRAIN_CLOUD_LEGACY_CONTEXT_WINDOW = 256000;const WEBBRAIN_DEVICE_GUID_KEY = 'webbrainDeviceGuid';@@ -447,6 +447,21 @@ export class ProviderManager {visionDetection: null,enabled: true,},+ ods: {+ type: 'openai',+ category: 'local',+ label: 'ODS (Local)',+ providerName: 'ods',+ requiresModel: true,+ baseUrl: 'http://localhost:11434/v1',+ model: '',+ contextWindow: 16384,+ apiKey: '',+ supportsAskStreaming: true,+ visionMode: 'auto',+ visionDetection: null,+ enabled: true,+ },lmstudio: {type: 'openai',category: 'local',@@ -1133,7 +1148,7 @@ export class ProviderManager {static categoryFor(id, config) {if (config && config.category) return config.category;if (config?.type === 'llamacpp') return 'local';- if (['llamacpp', 'ollama', 'lmstudio', 'osaurus', 'jan', 'vllm', 'sglang', 'localai', 'gpt4all', 'local_openai_proxy', 'unsloth'].includes(id)) return 'local';+ if (['llamacpp', 'ollama', 'ods', 'lmstudio', 'osaurus', 'jan', 'vllm', 'sglang', 'localai', 'gpt4all', 'local_openai_proxy', 'unsloth'].includes(id)) return 'local';if (ROUTER_PROVIDER_IDS.includes(id)) return 'router';return 'cloud';}@@ -1253,7 +1268,7 @@ export class ProviderManager {};const request = (async () => {try {- if (providerId === 'llamacpp') {+ if (providerId === 'llamacpp' || providerId === 'ods') {const query = identity.model ? `?model=${encodeURIComponent(identity.model)}` : '';const result = await fetchJson(`${root}/props${query}`);if (!result.ok) return result;@@ -1854,7 +1869,7 @@ export class ProviderManager {/*** Fetch selectable models for local providers. Ollama uses its native- * /api/tags endpoint; llama.cpp, LM Studio, Osaurus, Jan, vLLM, SGLang, LocalAI,+ * /api/tags endpoint; ODS, llama.cpp, LM Studio, Osaurus, Jan, vLLM, SGLang, LocalAI,* GPT4All, Unsloth Studio, and generic local proxies use* OpenAI-compatible /v1/models.*/@@ -1930,6 +1945,15 @@ export class ProviderManager {continue;}const data = await res.json();+ // ODS commonly shares Ollama's port. During automatic onboarding,+ // require its llama-server /props endpoint before offering an ODS card.+ if (detectServerIdentity && provider.config.configured !== true && definitionId === 'ods') {+ try {+ const root = candidate.configBaseUrl.replace(/\/v1$/i, '');+ const identity = await fetchWithTimeout(`${root}/props`, { method: 'GET', headers });+ if (!identity.ok) return { ok: true, models: [] };+ } catch { return { ok: true, models: [] }; }+ }// Jan and Osaurus share port 1337. Successful OpenAI model discovery// alone cannot identify which server answered an unconfigured card.if (detectServerIdentity && provider.config.configured !== true@@ -2170,7 +2194,7 @@ export class ProviderManager {};}- if (definitionId === 'llamacpp') {+ if (definitionId === 'llamacpp' || definitionId === 'ods') {const res = await fetch(`${root}/props`, { method: 'GET', headers });if (!res.ok) return null;const contextWindow = parseLlamaCppPropsContextWindow(await res.json());diff --git a/src/firefox/src/providers/provider-compatibility.js b/src/firefox/src/providers/provider-compatibility.jsindex d05026293..63101f53c 100644--- a/src/firefox/src/providers/provider-compatibility.js+++ b/src/firefox/src/providers/provider-compatibility.js@@ -17,6 +17,7 @@ export const OPENROUTER_ROUTING_VARIANTS = Object.freeze(['standard', 'nitro', 'const STRUCTURED_OUTPUT_PROVIDER_NAMES = new Set(['azure-openai','llamacpp',+ 'ods','lmstudio','localai','ollama',@@ -27,6 +28,7 @@ const STRUCTURED_OUTPUT_PROVIDER_NAMES = new Set([]);const LOCAL_OPENAI_COMPAT_PROVIDER_NAMES = new Set(['llamacpp',+ 'ods','lmstudio','localai','ollama',diff --git a/src/firefox/src/providers/vision-capabilities.js b/src/firefox/src/providers/vision-capabilities.jsindex 830178c9b..cae05412e 100644--- a/src/firefox/src/providers/vision-capabilities.js+++ b/src/firefox/src/providers/vision-capabilities.js@@ -1,8 +1,9 @@-export const AUTO_VISION_PROVIDER_IDS = new Set(['llamacpp', 'lmstudio', 'localai']);+export const AUTO_VISION_PROVIDER_IDS = new Set(['llamacpp', 'ods', 'lmstudio', 'localai']);export const VISION_MODES = new Set(['auto', 'on', 'off']);const DETECTION_SOURCES = {llamacpp: 'llamacpp_props',+ ods: 'llamacpp_props',lmstudio: 'lmstudio_models',localai: 'localai_capabilities',};diff --git a/src/firefox/src/ui/provider-icons.js b/src/firefox/src/ui/provider-icons.jsindex 96a4bc3d5..c9de530e9 100644--- a/src/firefox/src/ui/provider-icons.js+++ b/src/firefox/src/ui/provider-icons.js@@ -14,6 +14,7 @@ export const PROVIDER_ICON_FILES = {webbrain_cloud: 'webbrain_cloud.png',llamacpp: 'llamacpp.svg',ollama: 'ollama.svg',+ ods: 'ods.svg',lmstudio: 'lmstudio.svg',osaurus: 'osaurus.svg',jan: 'jan.png',@@ -82,6 +83,7 @@ export const PROVIDER_SHORT_LABELS = {webbrain_cloud: 'WebBrain Compass',llamacpp: 'llama.cpp',ollama: 'Ollama',+ ods: 'ODS',lmstudio: 'LM Studio',osaurus: 'Osaurus',jan: 'Jan',diff --git a/src/firefox/src/ui/settings.js b/src/firefox/src/ui/settings.jsindex 0de2b605c..ac8bdadb6 100644--- a/src/firefox/src/ui/settings.js+++ b/src/firefox/src/ui/settings.js@@ -2447,6 +2447,16 @@ function renderProviders() {PROMPT_TIER_FIELD,],},+ ods: {+ fields: [+ { key: 'baseUrl', labelKey: 'st.provider.field.server_url', type: 'text', placeholder: 'http://localhost:11434/v1' },+ OPTIONAL_LOCAL_API_KEY_FIELD,+ { key: 'model', labelKey: 'st.provider.field.model', type: 'text', placeholder: 'select the running ODS model' },+ CONTEXT_WINDOW_FIELD,+ VISION_MODE_FIELD,+ PROMPT_TIER_FIELD,+ ],+ },lmstudio: {fields: [{ key: 'baseUrl', labelKey: 'st.provider.field.server_url', type: 'text', placeholder: 'http://localhost:1234/v1' },@@ -2893,7 +2903,7 @@ function renderProviders() {</div>`;} else {- const localModelProviders = ['llamacpp', 'ollama', 'lmstudio', 'osaurus', 'jan', 'vllm', 'sglang', 'localai', 'gpt4all', 'local_openai_proxy', 'unsloth'];+ const localModelProviders = ['llamacpp', 'ollama', 'ods', 'lmstudio', 'osaurus', 'jan', 'vllm', 'sglang', 'localai', 'gpt4all', 'local_openai_proxy', 'unsloth'];const canLoadModels = localModelProviders.includes(definitionId) && field.key === 'model';const listAttr = canLoadModels ? `list="models-${id}"` : '';const datalistHTML = canLoadModels ? `<datalist id="models-${id}"></datalist>` : '';diff --git a/src/firefox/src/ui/sidepanel.js b/src/firefox/src/ui/sidepanel.jsindex 42bbe5427..4d4e0b2b6 100644--- a/src/firefox/src/ui/sidepanel.js+++ b/src/firefox/src/ui/sidepanel.js@@ -132,7 +132,7 @@ if (globalThis.browser?.storage?.onChanged) {const localModels = document.getElementById('ob-local-models');const localModelList = document.getElementById('ob-local-model-list');const totalSteps = steps.length;- const LOCAL_PROVIDER_ORDER = ['unsloth', 'local_openai_proxy', 'jan', 'osaurus', 'lmstudio', 'ollama', 'llamacpp', 'vllm', 'sglang', 'localai', 'gpt4all'];+ const LOCAL_PROVIDER_ORDER = ['unsloth', 'local_openai_proxy', 'jan', 'osaurus', 'lmstudio', 'ollama', 'ods', 'llamacpp', 'vllm', 'sglang', 'localai', 'gpt4all'];let current = 0;let localScanStarted = false;let localModelChoices = [];diff --git a/test/run.js b/test/run.jsindex 37bd76e17..ec9bd3582 100644--- a/test/run.js+++ b/test/run.js@@ -67043,6 +67043,66 @@ test('Osaurus requires a selected model and uses the local Chat Completions cont}});+test('ODS local provider discovers its running model and uses Chat Completions', async () => {+ const originalFetch = globalThis.fetch;+ const calls = [];+ globalThis.fetch = async (url, options = {}) => {+ calls.push({ url: String(url), options });+ if (String(url).endsWith('/v1/models')) {+ return new Response(JSON.stringify({ data: [{ id: 'qwen-ods' }] }), { status: 200 });+ }+ if (new URL(url).pathname === '/props') {+ return new Response(JSON.stringify({ n_ctx: 16384, modalities: { vision: false } }), { status: 200 });+ }+ if (String(url).endsWith('/v1/chat/completions')) {+ return new Response(JSON.stringify({ choices: [{ message: { content: 'Hello from ODS' } }] }), { status: 200 });+ }+ return new Response('', { status: 404 });+ };+ try {+ for (const PM of [ProviderManagerCh, ProviderManagerFx]) {+ const manager = new PM();+ const defaults = manager._defaultConfigs().ods;+ assert.equal(defaults.category, 'local');+ assert.equal(defaults.baseUrl, 'http://localhost:11434/v1');+ assert.throws(() => manager._createProvider('ods', defaults).model, /model is required/);+ manager.providers.set('ods', manager._createProvider('ods', defaults));+ assert.deepEqual(await manager.listProviderModels('ods', { detectServerIdentity: true }), {+ ok: true, models: ['qwen-ods'], contextWindow: 16384,+ });+ assert.ok(calls.some(call => call.url === 'http://localhost:11434/props'));+ assert.deepEqual(await manager._fetchVisionCapability('ods', { config: defaults }, {+ baseUrl: defaults.baseUrl, model: 'qwen-ods',+ }), { ok: true, supportsVision: false });++ const provider = manager._createProvider('ods', { ...defaults, model: 'qwen-ods', apiKey: 'local-secret' });+ assert.equal(provider.supportsVision, false);+ const result = await provider.chat([{ role: 'user', content: 'Hello' }]);+ assert.equal(result.content, 'Hello from ODS');+ const call = calls.at(-1);+ assert.equal(call.url, 'http://localhost:11434/v1/chat/completions');+ assert.equal(call.options.headers.Authorization, 'Bearer local-secret');+ assert.equal(JSON.parse(call.options.body).model, 'qwen-ods');+ }++ globalThis.fetch = async (url) => String(url).endsWith('/props')+ ? new Response('', { status: 404 })+ : new Response(JSON.stringify({ data: [{ id: 'ollama-model' }] }), { status: 200 });+ for (const PM of [ProviderManagerCh, ProviderManagerFx]) {+ const manager = new PM();+ const defaults = manager._defaultConfigs().ods;+ manager.providers.set('ods', manager._createProvider('ods', defaults));+ assert.deepEqual(await manager.listProviderModels('ods', { detectServerIdentity: true }), {+ ok: true, models: [],+ }, 'automatic onboarding must not mistake Ollama for ODS on port 11434');+ assert.deepEqual(await manager.listProviderModels('ods'), { ok: true, models: ['ollama-model'] },+ 'manual setup should allow a compatible endpoint without /props');+ }+ } finally {+ globalThis.fetch = originalFetch;+ }+});+test('Osaurus discovers models and handles chat, streaming, tools, and access keys', async () => {const originalFetch = globalThis.fetch;const calls = [];@@ -67212,7 +67272,7 @@ test('Osaurus identity checks preserve manual model loading and configured provitest('categoryFor: local family', () => {for (const PM of [ProviderManagerCh, ProviderManagerFx]) {- for (const id of ['llamacpp', 'ollama', 'lmstudio', 'osaurus', 'jan', 'vllm', 'sglang', 'localai', 'gpt4all', 'local_openai_proxy', 'unsloth']) {+ for (const id of ['llamacpp', 'ollama', 'ods', 'lmstudio', 'osaurus', 'jan', 'vllm', 'sglang', 'localai', 'gpt4all', 'local_openai_proxy', 'unsloth']) {assert.equal(PM.categoryFor(id, { type: id === 'llamacpp' ? 'llamacpp' : 'openai' }), 'local');}assert.equal(PM.categoryFor('custom_llama_cpp', { type: 'llamacpp' }), 'local');@@ -69699,7 +69759,7 @@ test('extended provider catalog is complete, mirrored, safe, and excluded-provid['firefox', ProviderManagerFx, 'src/firefox'],]) {const defaults = new PM()._defaultConfigs();- const expectedDefaultCount = label === 'chrome' ? 111 : 110;+ const expectedDefaultCount = label === 'chrome' ? 112 : 111;assert.equal(Object.keys(defaults).length,expectedDefaultCount,diff --git a/web/docs/providers/index.html b/web/docs/providers/index.htmlindex ef8ae8ff7..36512762c 100644--- a/web/docs/providers/index.html+++ b/web/docs/providers/index.html@@ -19,17 +19,17 @@<aside class="docs-sidebar" aria-label="Documentation"><div class="sidebar-group"><div class="sidebar-label">Start here</div><nav><a href="/docs/">Overview</a><a href="/docs/faq/">FAQ</a></nav></div><div class="sidebar-group"><div class="sidebar-label">Use WebBrain</div><nav><a href="/docs/settings/">Settings, explained</a><a href="/docs/providers/" aria-current="page">Providers & models</a><a href="/docs/easy-cli-proxy/">Subscription proxy</a><a href="/docs/safety/">Modes, safety & privacy</a><a href="/docs/apocalypse-mode/">Apocalypse Mode</a><a href="/docs/formats/">Exports & workflows</a><a href="/docs/mcp/">MCP server</a><a href="/docs/lm-studio/">LM Studio plugin</a><a href="/docs/ollama/">Ollama</a></nav></div><div class="sidebar-group"><div class="sidebar-label">For builders</div><nav><a href="https://github.com/webbrain-one/webbrain/blob/main/docs/providers-and-models.md">Provider internals ↗</a></nav></div><div class="sidebar-group"><div class="sidebar-label">Community</div><nav><a href="https://discord.gg/cgC325ssfw">Discord Support</a></nav></div></aside><main class="doc-main" id="main"><div class="breadcrumb"><a href="/docs/">Docs</a> / Providers & models</div>- <section class="doc-hero"><div class="eyebrow">The model behind the panel</div><h1>Choose the setup that matches your patience, privacy, and budget.</h1><p class="lede">WebBrain includes 103 provider cards spanning its built-in cloud option, direct cloud APIs, model routers, and local OpenAI-compatible servers. You only need one active provider.</p></section>+ <section class="doc-hero"><div class="eyebrow">The model behind the panel</div><h1>Choose the setup that matches your patience, privacy, and budget.</h1><p class="lede">WebBrain includes 112 provider cards spanning its built-in cloud option, direct cloud APIs, model routers, and local OpenAI-compatible servers. You only need one active provider.</p></section>- <section class="doc-section" id="quick-choice"><h2>The quick choice</h2><div class="card-grid"><div class="card"><span class="tab-key">Fewest steps</span><h3>WebBrain Compass</h3><p>Built in, active by default, and includes a free daily allowance. No model server or API key setup.</p></div><div class="card"><span class="tab-key">Private & offline-capable</span><h3>Local model</h3><p>Use llama.cpp, Ollama, LM Studio, Jan, vLLM, SGLang, or LocalAI. Your model requests stay with the server you run.</p></div><div class="card"><span class="tab-key">Direct relationship</span><h3>Cloud API</h3><p>Bring a key for OpenAI, Anthropic, Gemini, Mistral, DeepSeek, xAI, Groq, and other supported providers.</p></div><div class="card"><span class="tab-key">Broad catalog</span><h3>Router</h3><p>Use one account to choose among many models. OpenRouter and Hugging Face are useful when you experiment often.</p></div></div></section>+ <section class="doc-section" id="quick-choice"><h2>The quick choice</h2><div class="card-grid"><div class="card"><span class="tab-key">Fewest steps</span><h3>WebBrain Compass</h3><p>Built in, active by default, and includes a free daily allowance. No model server or API key setup.</p></div><div class="card"><span class="tab-key">Private & offline-capable</span><h3>Local model</h3><p>Use llama.cpp, Ollama, ODS, LM Studio, Jan, vLLM, SGLang, or LocalAI. Your model requests stay with the server you run.</p></div><div class="card"><span class="tab-key">Direct relationship</span><h3>Cloud API</h3><p>Bring a key for OpenAI, Anthropic, Gemini, Mistral, DeepSeek, xAI, Groq, and other supported providers.</p></div><div class="card"><span class="tab-key">Broad catalog</span><h3>Router</h3><p>Use one account to choose among many models. OpenRouter and Hugging Face are useful when you experiment often.</p></div></div></section>- <section class="doc-section" id="catalog"><h2>103 built-in provider cards</h2><p>Settings includes 76 additional direct APIs and routers, including Azure AI Foundry, Vertex AI, Vertex Anthropic, Cerebras, Cohere, DeepInfra, Perplexity, Vercel AI Gateway, Venice, and many regional coding plans. Search by provider or model name instead of scrolling the whole list.</p><p>Most cards use an API key and OpenAI-compatible endpoint. Vertex cards use a Google Cloud project, location, and authorization key; the global location uses Google’s global endpoint, while Vertex Anthropic also supports the <code>us</code> and <code>eu</code> multi-region hosts. Cloudflare accepts an optional AI Gateway ID and automatically uses the <code>default</code> gateway for <code>@cf/</code> models when the field is blank. Interactive Ask turns stream when the selected provider supports it and automatically retry once without streaming if the connection ends early. Provider-reported token usage is recorded directly; otherwise WebBrain records a conservative estimate so streaming cannot bypass cost limits.</p><div class="callout warning"><strong class="callout-title">GitHub provider entries are intentionally absent</strong><p>GitHub itself is not going away, but GitHub Models retires July 30, 2026. GitHub Copilot requires a separate subscription/OAuth integration. GitLab Duo and SAP AI Core also require custom authentication and discovery not supported by the browser extension.</p></div></section>+ <section class="doc-section" id="catalog"><h2>112 built-in provider cards</h2><p>Settings includes 79 additional direct APIs and routers, including Azure AI Foundry, Vertex AI, Vertex Anthropic, Cerebras, Cohere, DeepInfra, Perplexity, Vercel AI Gateway, Venice, and many regional coding plans. Search by provider or model name instead of scrolling the whole list.</p><p>Most cards use an API key and OpenAI-compatible endpoint. Vertex cards use a Google Cloud project, location, and authorization key; the global location uses Google’s global endpoint, while Vertex Anthropic also supports the <code>us</code> and <code>eu</code> multi-region hosts. Cloudflare accepts an optional AI Gateway ID and automatically uses the <code>default</code> gateway for <code>@cf/</code> models when the field is blank. Interactive Ask turns stream when the selected provider supports it and automatically retry once without streaming if the connection ends early. Provider-reported token usage is recorded directly; otherwise WebBrain records a conservative estimate so streaming cannot bypass cost limits.</p><div class="callout warning"><strong class="callout-title">GitHub provider entries are intentionally absent</strong><p>GitHub itself is not going away, but GitHub Models retires July 30, 2026. GitHub Copilot requires a separate subscription/OAuth integration. GitLab Duo and SAP AI Core also require custom authentication and discovery not supported by the browser extension.</p></div></section><section class="doc-section" id="setup"><h2>Configure a provider</h2><figure class="shot"><a href="/docs/assets/screenshots/settings-providers.jpg"><img src="/docs/assets/screenshots/settings-providers.jpg" alt="Provider list with Local, Cloud and Router filters plus the active WebBrain Compass card"></a><figcaption>Use filters to shorten the list. The active provider remains visible so you always know what the panel is using.</figcaption></figure><ol class="step-list"><li><strong>Find the provider.</strong> Use Local, Cloud, Router, or the search field.</li><li><strong>Open its card.</strong> Non-active cards are collapsed to keep the list readable.</li><li><strong>Enter the values.</strong> Local servers usually need a URL and model name. Cloud providers also need an API key.</li><li><strong>Save.</strong> This stores the card’s current fields in the browser.</li><li><strong>Test Connection.</strong> Fix any reported URL, key, model, or server problem before continuing.</li><li><strong>Set Active.</strong> Only after the test succeeds. A saved provider is not necessarily the provider the side panel is using.</li></ol></section><section class="doc-section" id="fields"><h2>What the fields mean</h2><div class="table-wrap"><table><thead><tr><th>Field</th><th>Meaning</th><th>New-user advice</th></tr></thead><tbody><tr><td>Server / Base URL</td><td>The OpenAI-compatible root endpoint or provider API root.</td><td>Use the exact value shown by your local app or provider. Do not paste a chat webpage URL.</td></tr><tr><td>API key</td><td>A credential sent to that provider.</td><td>Local servers normally do not need one unless you enabled authentication.</td></tr><tr><td>Model</td><td>The model identifier the server expects.</td><td>Spelling and prefixes matter. “Model not found” usually means this field does not match the provider catalog.</td></tr><tr><td>Context window</td><td>How much prompt, history, page content, and tool schema fits in one request.</td><td>16k tokens is the usable target for reliable local runs. 8k can work with Compact; 4k is too small.</td></tr><tr><td>Supports vision</td><td>Whether the selected local or open catalog model accepts images.</td><td>Enable only when the exact served model can process image input.</td></tr><tr><td>Prompt tier</td><td>How large a prompt and normal browser-tool set WebBrain exposes.</td><td>Start with Mid for local models. Use Compact for small contexts and Full for capable models.</td></tr><tr><td>Input / output cost</td><td>Optional price estimates per million tokens.</td><td>Fill these when you want WebBrain’s cost allowances to estimate providers that do not report usage cost.</td></tr></tbody></table></div></section>- <section class="doc-section" id="local"><h2>Local models: the extra moving parts</h2><div class="table-wrap"><table><thead><tr><th>Server</th><th>Typical base URL</th><th>API key</th></tr></thead><tbody><tr><td>llama.cpp</td><td><code>http://localhost:8080</code></td><td>Usually none</td></tr><tr><td>Ollama</td><td><code>http://localhost:11434/v1</code></td><td>None</td></tr><tr><td>LM Studio</td><td><code>http://localhost:1234/v1</code></td><td>None</td></tr><tr><td>Jan</td><td><code>http://localhost:1337/v1</code></td><td>Optional</td></tr><tr><td>vLLM</td><td><code>http://localhost:8000/v1</code></td><td>Optional</td></tr><tr><td>SGLang</td><td><code>http://localhost:30000/v1</code></td><td>Optional</td></tr><tr><td>LocalAI</td><td><code>http://localhost:8080/v1</code></td><td>Optional</td></tr></tbody></table></div><p><strong>Load models</strong> asks supported local servers which models are currently available. For llama.cpp, Ollama, and LM Studio, Test Connection or Load models can also detect the live context window when the backend reports it.</p><div class="callout warning"><strong class="callout-title">Browser extensions still need permission to reach local servers</strong><p>If the server works in a terminal but not in WebBrain, check the server’s CORS/origin setting. Ollama commonly needs <code>OLLAMA_ORIGINS="chrome-extension://*,moz-extension://*"</code> before <code>ollama serve</code>.</p></div></section>+ <section class="doc-section" id="local"><h2>Local models: the extra moving parts</h2><div class="table-wrap"><table><thead><tr><th>Server</th><th>Typical base URL</th><th>API key</th></tr></thead><tbody><tr><td>llama.cpp</td><td><code>http://localhost:8080</code></td><td>Usually none</td></tr><tr><td>Ollama</td><td><code>http://localhost:11434/v1</code></td><td>None</td></tr><tr><td>ODS</td><td><code>http://localhost:11434/v1</code></td><td>Optional; use the port in ODS .env</td></tr><tr><td>LM Studio</td><td><code>http://localhost:1234/v1</code></td><td>None</td></tr><tr><td>Jan</td><td><code>http://localhost:1337/v1</code></td><td>Optional</td></tr><tr><td>vLLM</td><td><code>http://localhost:8000/v1</code></td><td>Optional</td></tr><tr><td>SGLang</td><td><code>http://localhost:30000/v1</code></td><td>Optional</td></tr><tr><td>LocalAI</td><td><code>http://localhost:8080/v1</code></td><td>Optional</td></tr></tbody></table></div><p><strong>Load models</strong> asks supported local servers which models are currently available. For llama.cpp, ODS, Ollama, and LM Studio, Test Connection or Load models can also detect the live context window when the backend reports it.</p><div class="callout warning"><strong class="callout-title">Browser extensions still need permission to reach local servers</strong><p>If the server works in a terminal but not in WebBrain, check the server’s CORS/origin setting. Ollama commonly needs <code>OLLAMA_ORIGINS="chrome-extension://*,moz-extension://*"</code> before <code>ollama serve</code>.</p></div></section><section class="doc-section" id="tiers"><h2>Prompt tiers in plain language</h2><div class="mode-strip"><div class="mode ask"><strong>Compact</strong><span>Smallest prompt and action-tool surface. Designed for constrained local models and roughly 8k contexts.</span></div><div class="mode act"><strong>Mid</strong><span>Common browser tasks, iframes, downloads, scheduling, and form verification. The best local-model starting point.</span></div><div class="mode dev"><strong>Full</strong><span>Adds advanced UI and DOM fallbacks such as hover, drag/drop, frames, and shadow DOM tools.</span></div></div><p>Cloud providers are forced to Full. Local providers default to Mid unless you choose another tier. OpenRouter exposes the tier because its catalog includes models with very different capabilities. Dev mode is blocked for Compact-tier providers.</p></section>diff --git a/web/docs/zh/providers/index.html b/web/docs/zh/providers/index.htmlindex c4e66bca3..5fad88f81 100644--- a/web/docs/zh/providers/index.html+++ b/web/docs/zh/providers/index.html@@ -12,12 +12,12 @@<body class="doc-page"><a class="skip-link" href="#main">跳到正文</a><header class="site-header"><div class="header-inner"><a class="brand" href="/"><img src="/logo-github.png" alt=""><span>WebBrain</span><span class="brand-docs">用户指南</span></a><nav class="top-nav" aria-label="主导航"><a href="/">首页</a><a href="/docs/zh/" aria-current="page">文档</a><a href="/blog/">博客</a><a href="https://github.com/webbrain-one/webbrain">GitHub</a></nav><div class="header-tools"><a class="lang-switch" href="/docs/providers/" aria-label="Read in English"><span>EN</span><span class="active">中文</span></a><button class="icon-button" type="button" data-theme-toggle aria-label="切换主题">☀</button><button class="sidebar-toggle" type="button" data-sidebar-toggle aria-expanded="false" aria-label="打开文档菜单">☰</button></div></div></header><div class="docs-shell"><aside class="docs-sidebar" aria-label="文档目录"><div class="sidebar-group"><div class="sidebar-label">从这里开始</div><nav><a href="/docs/zh/">概览</a><a href="/docs/zh/faq/">常见问题</a></nav></div><div class="sidebar-group"><div class="sidebar-label">使用 WebBrain</div><nav><a href="/docs/zh/settings/">设置说明</a><a href="/docs/zh/providers/" aria-current="page">提供商与模型</a><a href="/docs/zh/easy-cli-proxy/">订阅代理</a><a href="/docs/zh/safety/">模式、安全与隐私</a><a href="/docs/zh/apocalypse-mode/">末日模式</a><a href="/docs/zh/formats/">导出与工作流</a><a href="/docs/zh/mcp/">MCP 服务器</a><a href="/docs/zh/lm-studio/">LM Studio 插件</a><a href="/docs/zh/ollama/">Ollama</a></nav></div><div class="sidebar-group"><div class="sidebar-label">社区</div><nav><a href="https://discord.gg/cgC325ssfw">Discord 支持</a></nav></div></aside>- <main class="doc-main" id="main"><div class="breadcrumb"><a href="/docs/zh/">文档</a> / 提供商与模型</div><section class="doc-hero"><div class="eyebrow">侧边栏背后的模型</div><h1>根据耐心、隐私需求与预算选择方案。</h1><p class="lede">WebBrain 内置 103 张提供商卡片,涵盖托管云服务、直接云 API、模型路由和本地 OpenAI 兼容服务器。你只需要一个活动提供商。</p></section>- <section class="doc-section" id="choice"><h2>快速选择</h2><div class="card-grid"><div class="card"><span class="tab-key">步骤最少</span><h3>WebBrain Compass</h3><p>内置且默认启用,包含每日免费额度,无需模型服务器或 API 密钥。</p></div><div class="card"><span class="tab-key">隐私与离线能力</span><h3>本地模型</h3><p>使用 llama.cpp、Ollama、LM Studio、Jan、vLLM、SGLang 或 LocalAI。</p></div><div class="card"><span class="tab-key">直接使用厂商</span><h3>云 API</h3><p>为 OpenAI、Anthropic、Gemini、Mistral、DeepSeek、xAI、Groq 等提供商填写自己的密钥。</p></div><div class="card"><span class="tab-key">模型目录丰富</span><h3>模型路由</h3><p>使用一个账户切换许多模型;适合经常试验的用户。</p></div></div></section>- <section class="doc-section" id="catalog"><h2>103 张内置提供商卡片</h2><p>设置新增了 76 个直连 API 与路由器,包括 Azure AI Foundry、Vertex AI、Vertex Anthropic、Cerebras、Cohere、DeepInfra、Perplexity、Vercel AI Gateway、Venice 和多个区域性编程套餐。可以按提供商或模型名称搜索。</p><p>大多数卡片使用 API 密钥与 OpenAI 兼容端点。Vertex 卡片使用 Google Cloud 项目、区域和授权密钥;全局区域使用 Google 的全局端点,Vertex Anthropic 还支持 <code>us</code> 与 <code>eu</code> 多区域主机。Cloudflare 接受可选的 AI Gateway ID;对于 <code>@cf/</code> 模型,留空时自动使用 <code>default</code> 网关。支持流式传输的提供商会在交互式 Ask 中实时显示回复,连接提前结束时自动以非流式方式重试一次。服务返回令牌用量时会直接记录;否则 WebBrain 记录保守估算,避免流式请求绕过成本限额。</p><div class="callout warning"><strong class="callout-title">有意不提供 GitHub 条目</strong><p>GitHub 本身不会关闭,但 GitHub Models 将于 2026 年 7 月 30 日退役。GitHub Copilot 需要单独的订阅/OAuth 集成。GitLab Duo 和 SAP AI Core 也需要浏览器扩展不支持的专用认证与部署发现。</p></div></section>+ <main class="doc-main" id="main"><div class="breadcrumb"><a href="/docs/zh/">文档</a> / 提供商与模型</div><section class="doc-hero"><div class="eyebrow">侧边栏背后的模型</div><h1>根据耐心、隐私需求与预算选择方案。</h1><p class="lede">WebBrain 内置 112 张提供商卡片,涵盖托管云服务、直接云 API、模型路由和本地 OpenAI 兼容服务器。你只需要一个活动提供商。</p></section>+ <section class="doc-section" id="choice"><h2>快速选择</h2><div class="card-grid"><div class="card"><span class="tab-key">步骤最少</span><h3>WebBrain Compass</h3><p>内置且默认启用,包含每日免费额度,无需模型服务器或 API 密钥。</p></div><div class="card"><span class="tab-key">隐私与离线能力</span><h3>本地模型</h3><p>使用 llama.cpp、Ollama、ODS、LM Studio、Jan、vLLM、SGLang 或 LocalAI。</p></div><div class="card"><span class="tab-key">直接使用厂商</span><h3>云 API</h3><p>为 OpenAI、Anthropic、Gemini、Mistral、DeepSeek、xAI、Groq 等提供商填写自己的密钥。</p></div><div class="card"><span class="tab-key">模型目录丰富</span><h3>模型路由</h3><p>使用一个账户切换许多模型;适合经常试验的用户。</p></div></div></section>+ <section class="doc-section" id="catalog"><h2>112 张内置提供商卡片</h2><p>设置新增了 79 个直连 API 与路由器,包括 Azure AI Foundry、Vertex AI、Vertex Anthropic、Cerebras、Cohere、DeepInfra、Perplexity、Vercel AI Gateway、Venice 和多个区域性编程套餐。可以按提供商或模型名称搜索。</p><p>大多数卡片使用 API 密钥与 OpenAI 兼容端点。Vertex 卡片使用 Google Cloud 项目、区域和授权密钥;全局区域使用 Google 的全局端点,Vertex Anthropic 还支持 <code>us</code> 与 <code>eu</code> 多区域主机。Cloudflare 接受可选的 AI Gateway ID;对于 <code>@cf/</code> 模型,留空时自动使用 <code>default</code> 网关。支持流式传输的提供商会在交互式 Ask 中实时显示回复,连接提前结束时自动以非流式方式重试一次。服务返回令牌用量时会直接记录;否则 WebBrain 记录保守估算,避免流式请求绕过成本限额。</p><div class="callout warning"><strong class="callout-title">有意不提供 GitHub 条目</strong><p>GitHub 本身不会关闭,但 GitHub Models 将于 2026 年 7 月 30 日退役。GitHub Copilot 需要单独的订阅/OAuth 集成。GitLab Duo 和 SAP AI Core 也需要浏览器扩展不支持的专用认证与部署发现。</p></div></section><section class="doc-section" id="setup"><h2>配置步骤</h2><figure class="shot"><a href="/docs/assets/screenshots/settings-providers.jpg"><img src="/docs/assets/screenshots/settings-providers.jpg" alt="WebBrain 提供商设置英文界面"></a><figcaption>截图为英文界面;中文界面结构与控件位置相同。</figcaption></figure><ol class="step-list"><li><strong>找到提供商。</strong>使用“本地”“云端”“路由”或搜索框。</li><li><strong>展开卡片并填写值。</strong>本地服务器通常需要地址和模型名;云提供商还需要 API 密钥。</li><li><strong>保存。</strong>把当前字段写入浏览器。</li><li><strong>测试连接。</strong>先修复地址、密钥、模型或服务器错误。</li><li><strong>设为活动。</strong>只有测试成功后再切换。保存并不等于已经启用。</li></ol></section><section class="doc-section" id="fields"><h2>字段含义</h2><div class="table-wrap"><table><thead><tr><th>字段</th><th>含义</th><th>建议</th></tr></thead><tbody><tr><td>服务器 / Base URL</td><td>OpenAI 兼容根端点或提供商 API 根地址。</td><td>使用本地应用或提供商给出的精确值,不要粘贴聊天网页地址。</td></tr><tr><td>API 密钥</td><td>发送给提供商用于认证的凭据。</td><td>本地服务器通常不需要,除非你主动启用了认证。</td></tr><tr><td>模型</td><td>服务器要求的模型标识符。</td><td>大小写、前缀和拼写必须准确。</td></tr><tr><td>上下文窗口</td><td>一次请求容纳提示、历史、网页内容和工具模式的容量。</td><td>可靠本地运行建议至少 16k;8k 可配合 Compact;4k 太小。</td></tr><tr><td>支持视觉</td><td>当前模型是否接受图像。</td><td>只有确认所服务的精确模型支持图像时才开启。</td></tr><tr><td>提示层级</td><td>WebBrain 暴露的提示长度和常规浏览器工具范围。</td><td>本地模型从 Mid 开始;小上下文用 Compact,能力强的模型用 Full。</td></tr></tbody></table></div></section>- <section class="doc-section" id="local"><h2>本地模型的额外环节</h2><div class="table-wrap"><table><thead><tr><th>服务器</th><th>常见 Base URL</th><th>API 密钥</th></tr></thead><tbody><tr><td>llama.cpp</td><td><code>http://localhost:8080</code></td><td>通常不需要</td></tr><tr><td>Ollama</td><td><code>http://localhost:11434/v1</code></td><td>不需要</td></tr><tr><td>LM Studio</td><td><code>http://localhost:1234/v1</code></td><td>不需要</td></tr><tr><td>Jan</td><td><code>http://localhost:1337/v1</code></td><td>可选</td></tr><tr><td>vLLM</td><td><code>http://localhost:8000/v1</code></td><td>可选</td></tr><tr><td>SGLang</td><td><code>http://localhost:30000/v1</code></td><td>可选</td></tr></tbody></table></div><div class="callout warning"><strong class="callout-title">终端可用,不代表扩展一定可访问</strong><p>连接被拒绝通常是服务器未启动或端口错误;CORS/Origin 错误需要允许浏览器扩展来源。Ollama 常用:<code>OLLAMA_ORIGINS="chrome-extension://*,moz-extension://*" ollama serve</code>。</p></div></section>+ <section class="doc-section" id="local"><h2>本地模型的额外环节</h2><div class="table-wrap"><table><thead><tr><th>服务器</th><th>常见 Base URL</th><th>API 密钥</th></tr></thead><tbody><tr><td>llama.cpp</td><td><code>http://localhost:8080</code></td><td>通常不需要</td></tr><tr><td>Ollama</td><td><code>http://localhost:11434/v1</code></td><td>不需要</td></tr><tr><td>ODS</td><td><code>http://localhost:11434/v1</code></td><td>可选;使用 ODS .env 中的端口</td></tr><tr><td>LM Studio</td><td><code>http://localhost:1234/v1</code></td><td>不需要</td></tr><tr><td>Jan</td><td><code>http://localhost:1337/v1</code></td><td>可选</td></tr><tr><td>vLLM</td><td><code>http://localhost:8000/v1</code></td><td>可选</td></tr><tr><td>SGLang</td><td><code>http://localhost:30000/v1</code></td><td>可选</td></tr></tbody></table></div><div class="callout warning"><strong class="callout-title">终端可用,不代表扩展一定可访问</strong><p>连接被拒绝通常是服务器未启动或端口错误;CORS/Origin 错误需要允许浏览器扩展来源。Ollama 常用:<code>OLLAMA_ORIGINS="chrome-extension://*,moz-extension://*" ollama serve</code>。</p></div></section><section class="doc-section" id="tiers"><h2>提示层级</h2><div class="mode-strip"><div class="mode ask"><strong>Compact</strong><span>最短提示与最小工具面,适合约 8k 上下文的小型本地模型。</span></div><div class="mode act"><strong>Mid</strong><span>包含常见浏览器任务、iframe、下载、计划任务和表单验证。推荐的本地起点。</span></div><div class="mode dev"><strong>Full</strong><span>增加 hover、拖放、框架与 Shadow DOM 等高级回退工具。</span></div></div><p>云提供商固定使用 Full;本地提供商默认 Mid;Compact 提供商不能使用 Dev 模式。</p></section><section class="doc-section" id="troubleshoot"><h2>测试连接失败时</h2><ol><li><strong>Connection refused:</strong>启动本地服务器并确认端口。</li><li><strong>CORS/Origin:</strong>在服务器中允许 WebBrain 扩展来源。</li><li><strong>Unauthorized:</strong>确认密钥与 Base URL 属于同一提供商。</li><li><strong>Model not found:</strong>复制精确模型 ID,或使用 Load models。</li><li><strong>超时:</strong>为大型 CPU 本地模型提高常规请求超时。</li><li><strong>几轮后失败:</strong>确认真实上下文窗口,降低提示层级或扩大模型上下文。</li></ol></section><section class="doc-section" id="assistive-models"><h2>可选的辅助模型</h2><p>当前提供商负责主要对话、规划和最终回复。在<strong>设置 → 辅助模型</strong>中,可独立配置<strong>视觉</strong>模型、<strong>语音转文字</strong>端点或 <strong>Jev (TypeSafe)</strong>。这些设置不受提供商筛选或切换影响。</p><p>Jev 提供可选的计划验证,以及独立且默认关闭的快速分类与实验性浏览器操作。现有权限与完成检查仍然适用,尚未验证真实速度收益。配置方法和数据共享说明见<a href="/docs/zh/settings/#multimodal">辅助模型设置</a>。</p></section>