The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
docs: teach providers: dict as the canonical custom-provider format
Tekniumc6f98b0cba9c
diff --git a/website/docs/developer-guide/provider-runtime.md b/website/docs/developer-guide/provider-runtime.mdindex 85925b342ad..af00404ae1b 100644--- a/website/docs/developer-guide/provider-runtime.md+++ b/website/docs/developer-guide/provider-runtime.md@@ -69,7 +69,7 @@ Current provider families include (see `plugins/model-providers/` for the comple- LM Studio- Tencent TokenHub- Custom (`provider: custom`) — first-class provider for any OpenAI-compatible endpoint-- Named custom providers (`custom_providers` list in config.yaml)+- Named custom providers (`providers:` dict in config.yaml; the legacy `custom_providers` list is still read for backward compatibility)## Output of runtime resolutiondiff --git a/website/docs/guides/migrate-from-openclaw.md b/website/docs/guides/migrate-from-openclaw.mdindex 669497bd1cb..9680717dc3b 100644--- a/website/docs/guides/migrate-from-openclaw.md+++ b/website/docs/guides/migrate-from-openclaw.md@@ -77,7 +77,7 @@ Skill conflicts are handled by `--skill-conflict`: `skip` leaves the existing He| What | OpenClaw config path | Hermes destination | Notes ||------|---------------------|-------------------|-------|| Default model | `agents.defaults.model` | `config.yaml` → `model` | Can be a string or `{primary, fallbacks}` object |-| Custom providers | `models.providers.*` | `config.yaml` → `custom_providers` | Maps `baseUrl`, `apiType`/`api` — handles both short ("openai", "anthropic") and hyphenated ("openai-completions", "anthropic-messages", "google-generative-ai") values |+| Custom providers | `models.providers.*` | `config.yaml` → `custom_providers` (auto-migrated to the canonical `providers:` dict on the next `hermes update` config migration) | Maps `baseUrl`, `apiType`/`api` — handles both short ("openai", "anthropic") and hyphenated ("openai-completions", "anthropic-messages", "google-generative-ai") values || Provider API keys | `models.providers.*.apiKey` | `~/.hermes/.env` | Requires `--migrate-secrets`. See [API key resolution](#api-key-resolution) below. |### Agent behaviordiff --git a/website/docs/integrations/providers.md b/website/docs/integrations/providers.mdindex 1b1791bf84a..02f4ad8d593 100644--- a/website/docs/integrations/providers.md+++ b/website/docs/integrations/providers.md@@ -1151,7 +1151,7 @@ Set `model.max_tokens` only when you need to limit how long individual responsesHermes uses a multi-source resolution chain to detect the correct context window for your model and provider:1. **Config override** — `model.context_length` in config.yaml (highest priority)-2. **Custom provider per-model** — `custom_providers[].models.<id>.context_length`+2. **Custom provider per-model** — `providers.<name>.models.<id>.context_length`3. **Persistent cache** — previously discovered values (survives restarts)4. **Endpoint `/models`** — queries your server's API (local/custom endpoints)5. **Anthropic `/v1/models`** — queries Anthropic's API for `max_input_tokens` (API-key users only)@@ -1174,9 +1174,9 @@ model:For custom endpoints, you can also set context length per model:```yaml-custom_providers:- - name: "My Local LLM"- base_url: "http://localhost:11434/v1"+providers:+ my-local-llm:+ api: "http://localhost:11434/v1"models:qwen3.5:27b:context_length: 64000@@ -1196,30 +1196,36 @@ custom_providers:### Named Custom Providers-If you work with multiple custom endpoints (e.g., a local dev server and a remote GPU server), you can define them as named custom providers in `config.yaml`:+If you work with multiple custom endpoints (e.g., a local dev server and a remote GPU server), you can define them as named custom providers under the `providers:` dict in `config.yaml`, keyed by provider name:```yaml-custom_providers:- - name: local- base_url: http://localhost:8080/v1+providers:+ local:+ api: http://localhost:8080/v1# api_key omitted — Hermes uses "no-key-required" for keyless local servers- - name: work- base_url: https://gpu-server.internal.corp/v1+ work:+ api: https://gpu-server.internal.corp/v1key_env: CORP_API_KEY- api_mode: chat_completions # set explicitly by `hermes model` → Custom Endpoint wizard; auto-detection still happens as a fallback- - name: anthropic-proxy- base_url: https://proxy.example.com/anthropic+ transport: chat_completions # set explicitly by `hermes model` → Custom Endpoint wizard; auto-detection still happens as a fallback+ anthropic-proxy:+ api: https://proxy.example.com/anthropickey_env: ANTHROPIC_PROXY_KEY- api_mode: anthropic_messages # for Anthropic-compatible proxies+ transport: anthropic_messages # for Anthropic-compatible proxies```+Each entry accepts: `api` (the endpoint base URL — `base_url`/`url` are accepted aliases), `name` (optional display name; defaults to the dict key), `key_env` or inline `api_key`, `transport` (`chat_completions` / `anthropic_messages` / `codex_responses`), `default_model`, `models`, `context_length`, `discover_models`, `extra_body`, `extra_headers`, `ssl_ca_cert` / `ssl_verify`, and `enabled: false` to hide an entry without deleting it.++:::note Legacy format+Older configs used a top-level `custom_providers:` list instead. It still works — Hermes reads both — and `hermes update` auto-migrates it to the `providers:` dict (config v12). Field names differ slightly in the dict format: legacy `model` is `default_model`, and legacy `api_mode` is `transport`.+:::+Some OpenAI-compatible endpoints need provider-specific request body fields. Add an `extra_body` map to the matching custom provider and Hermes will merge it into each chat-completions request for that endpoint:```yaml-custom_providers:- - name: gemma-local- base_url: http://localhost:8080/v1- model: google/gemma-4-31b-it+providers:+ gemma-local:+ api: http://localhost:8080/v1+ default_model: google/gemma-4-31b-itextra_body:enable_thinking: truereasoning_effort: high@@ -1241,7 +1247,7 @@ extra_body:enable_thinking: false```-The `hermes model` → Custom Endpoint wizard now prompts for `api_mode` explicitly and persists your answer to `config.yaml`. URL-based auto-detection (e.g. `/anthropic` paths → `anthropic_messages`) still happens as a fallback when the field is left blank.+The `hermes model` → Custom Endpoint wizard now prompts for the API mode explicitly and persists your answer to `config.yaml` (as `transport` on the provider entry). URL-based auto-detection (e.g. `/anthropic` paths → `anthropic_messages`) still happens as a fallback when the field is left blank.**Native vision for custom-provider models.** If your custom endpoint serves a vision-capable model that isn't in models.dev, set `model.supports_vision: true` so Hermes routes attached images natively (as `image_url` parts) instead of pre-processing them through `vision_analyze`. Single knob — no need to also set `agent.image_input_mode: native`.@@ -1253,7 +1259,7 @@ model:supports_vision: true # send images natively; otherwise vision_analyze pre-describes them```-The same key is honored on per-named-provider models (`custom_providers[*].models[*].supports_vision`) and accepts standard YAML booleans (`true/false/yes/no/on/off/1/0`).+The same key is honored on per-named-provider models (`providers.<name>.models.<id>.supports_vision`) and accepts standard YAML booleans (`true/false/yes/no/on/off/1/0`).Switch between them mid-session with the triple syntax:@@ -1269,7 +1275,7 @@ You can also select named custom providers from the interactive `hermes model` m### Cookbook: Together AI, Groq, Perplexity-The cloud providers listed in [Other Compatible Providers](#other-compatible-providers) all speak OpenAI's REST dialect, so they wire up the same way under `custom_providers:`. Three worked recipes follow. Each drops into `~/.hermes/config.yaml` and the matching API key goes in `~/.hermes/.env`.+The cloud providers listed in [Other Compatible Providers](#other-compatible-providers) all speak OpenAI's REST dialect, so they wire up the same way under the `providers:` dict. Three worked recipes follow. Each drops into `~/.hermes/config.yaml` and the matching API key goes in `~/.hermes/.env`.#### Together AI@@ -1277,11 +1283,11 @@ Hosts open-weight models (Llama, MiniMax, Gemma, DeepSeek, Qwen) at prices signi```yaml# ~/.hermes/config.yaml-custom_providers:- - name: together- base_url: https://api.together.xyz/v1+providers:+ together:+ api: https://api.together.xyz/v1key_env: TOGETHER_API_KEY- # api_mode: chat_completions # default — no need to set+ # transport: chat_completions # default — no need to setmodel:default: MiniMaxAI/MiniMax-M2.7 # or any model from together.ai/models@@ -1309,9 +1315,9 @@ Ultra-fast inference (~500 tok/s on Llama-3.3-70B). Small catalog but strong for```yaml# ~/.hermes/config.yaml-custom_providers:- - name: groq- base_url: https://api.groq.com/openai/v1+providers:+ groq:+ api: https://api.groq.com/openai/v1key_env: GROQ_API_KEYmodel:@@ -1330,9 +1336,9 @@ Useful when you want a model that does live web search and citation automaticall```yaml# ~/.hermes/config.yaml-custom_providers:- - name: perplexity- base_url: https://api.perplexity.ai+providers:+ perplexity:+ api: https://api.perplexity.aikey_env: PERPLEXITY_API_KEYmodel:@@ -1350,15 +1356,15 @@ PERPLEXITY_API_KEY=your-perplexity-keyThe three recipes compose — use all of them together and switch per turn with `/model custom:<name>:<model>`:```yaml-custom_providers:- - name: together- base_url: https://api.together.xyz/v1+providers:+ together:+ api: https://api.together.xyz/v1key_env: TOGETHER_API_KEY- - name: groq- base_url: https://api.groq.com/openai/v1+ groq:+ api: https://api.groq.com/openai/v1key_env: GROQ_API_KEY- - name: perplexity- base_url: https://api.perplexity.ai+ perplexity:+ api: https://api.perplexity.aikey_env: PERPLEXITY_API_KEYmodel:@@ -1369,7 +1375,7 @@ model::::tip Troubleshooting- `hermes doctor` should print no `Unknown provider` warnings for any of these names after the CLI validator fixes in #15083.- If a provider's `/v1/models` endpoint is unreachable (Perplexity is the common one), `hermes model` will persist the model with a warning rather than hard-reject — see #15136.-- To skip `custom_providers:` entirely and use bare `provider: custom` with `CUSTOM_BASE_URL` env var, see #15103.+- To skip named providers entirely and use bare `provider: custom` with `CUSTOM_BASE_URL` env var, see #15103.:::---diff --git a/website/docs/reference/faq.md b/website/docs/reference/faq.mdindex ad9a7140fd6..525172f6871 100644--- a/website/docs/reference/faq.md+++ b/website/docs/reference/faq.md@@ -313,17 +313,19 @@ model:context_length: 131072 # your model's actual context window```-Or for custom endpoints, add it per-model:+Or for custom endpoints, add it per-model on the provider entry:```yaml-custom_providers:- - name: "My Server"- base_url: "http://localhost:11434/v1"+providers:+ my-server:+ api: "http://localhost:11434/v1"models:qwen3.5:27b:context_length: 64000```+(Older configs use the legacy `custom_providers:` list — still supported and auto-migrated to `providers:`.)+See [Context Length Detection](../integrations/providers.md#context-length-detection) for how auto-detection works and all override options.---diff --git a/website/docs/user-guide/configuration.md b/website/docs/user-guide/configuration.mdindex 1f2e37db306..db5b9817f7e 100644--- a/website/docs/user-guide/configuration.md+++ b/website/docs/user-guide/configuration.md@@ -1051,7 +1051,7 @@ auxiliary:When `base_url` is set, Hermes ignores the provider and calls that endpoint directly (using `api_key` or `OPENAI_API_KEY` for auth). When only `provider` is set, Hermes uses that provider's built-in auth and base URL.-Available providers for auxiliary tasks: `auto`, `main`, plus any provider in the [provider registry](/reference/environment-variables) — `openrouter`, `nous`, `openai-codex`, `copilot`, `copilot-acp`, `anthropic`, `gemini`, `qwen-oauth`, `zai`, `kimi-coding`, `kimi-coding-cn`, `minimax`, `minimax-cn`, `minimax-oauth`, `deepseek`, `nvidia`, `xai`, `xai-oauth`, `ollama-cloud`, `alibaba`, `bedrock`, `huggingface`, `arcee`, `xiaomi`, `kilocode`, `opencode-zen`, `opencode-go`, `azure-foundry` — or any named custom provider from your `custom_providers` list (e.g. `provider: "beans"`).+Available providers for auxiliary tasks: `auto`, `main`, plus any provider in the [provider registry](/reference/environment-variables) — `openrouter`, `nous`, `openai-codex`, `copilot`, `copilot-acp`, `anthropic`, `gemini`, `qwen-oauth`, `zai`, `kimi-coding`, `kimi-coding-cn`, `minimax`, `minimax-cn`, `minimax-oauth`, `deepseek`, `nvidia`, `xai`, `xai-oauth`, `ollama-cloud`, `alibaba`, `bedrock`, `huggingface`, `arcee`, `xiaomi`, `kilocode`, `opencode-zen`, `opencode-go`, `azure-foundry` — or any named custom provider from your `providers:` dict (e.g. `provider: "beans"`).:::tip MiniMax OAuth`minimax-oauth` logs in via browser OAuth (no API key needed). Run `hermes model` and select **MiniMax (OAuth)** to authenticate. Auxiliary tasks use `MiniMax-M2.7-highspeed` automatically. See the [MiniMax OAuth guide](../guides/minimax-oauth.md).diff --git a/website/docs/user-guide/configuring-models.md b/website/docs/user-guide/configuring-models.mdindex ebc433c9b9f..13c33f0f2f3 100644--- a/website/docs/user-guide/configuring-models.md+++ b/website/docs/user-guide/configuring-models.md@@ -155,14 +155,14 @@ When `fallback_chain` is absent, `auto` uses the top-level `fallback_providers`## Per-provider request options-Provider entries (`providers.<name>` or items in the `custom_providers` list) accept two knobs that shape how Hermes talks to the endpoint:+Provider entries (`providers.<name>` in the `providers:` dict, or items in the legacy `custom_providers` list) accept two knobs that shape how Hermes talks to the endpoint:**`extra_headers`** — a mapping of extra HTTP headers attached to every LLM request routed to that provider's base URL. They are applied last, after URL/profile defaults and user header overrides, so they survive credential swaps and client rebuilds. Useful for Cloudflare Access service tokens, proxy auth, or custom bearer schemes:```yaml-custom_providers:- - name: my-gateway- base_url: https://llm.internal.example.com/v1+providers:+ my-gateway:+ api: https://llm.internal.example.com/v1api_key: sk-...extra_headers:CF-Access-Client-Id: "xxxx.access"@@ -174,9 +174,9 @@ Header values routinely carry credentials — Hermes never logs them. `extra_hea**`discover_models`** — set to `false` (default `true`) to skip querying the endpoint's `/models` listing and use only the `models` you configured on the entry. Handy for gateways whose model listing is slow, unreliable, or noisy:```yaml-custom_providers:- - name: my-gateway- base_url: https://llm.internal.example.com/v1+providers:+ my-gateway:+ api: https://llm.internal.example.com/v1discover_models: falsemodels:- my-finetune-v2@@ -185,6 +185,10 @@ custom_providers:With discovery off, the model picker (`hermes model`, `/model`) shows the configured list instead of a live probe.+:::note Legacy format+Older configs used a top-level `custom_providers:` list (with `base_url` instead of `api`). It still works and is auto-migrated to the `providers:` dict on `hermes update` (config v12).+:::+## When does it take effect?- **CLI** (`hermes chat`): next `hermes chat` invocation.diff --git a/website/docs/user-guide/features/credential-pools.md b/website/docs/user-guide/features/credential-pools.mdindex c4fd897544c..f66f2a624a9 100644--- a/website/docs/user-guide/features/credential-pools.md+++ b/website/docs/user-guide/features/credential-pools.md@@ -151,7 +151,7 @@ The `has_retried_429` flag resets on every successful API call, so a single tran## Custom Endpoint Pools-Custom OpenAI-compatible endpoints (Together.ai, RunPod, local servers) get their own pools, keyed by the endpoint name from `custom_providers` in config.yaml.+Custom OpenAI-compatible endpoints (Together.ai, RunPod, local servers) get their own pools, keyed by the endpoint name from the `providers:` dict in config.yaml (or the legacy `custom_providers` list, which is auto-migrated).When you set up a custom endpoint via `hermes model`, it auto-generates a name like "Together.ai" or "Local (localhost:8080)". This name becomes the pool key.