Repository navigation
Description
Affected area
Harness adapter
Problem or opportunity
A Hermes runtime whose selected model uses provider anthropic with a base_url such as https://gateway.example/v1 sends its Messages requests to https://api.anthropic.com, not to that endpoint.
- The Hermes adapter writes the model into Hermes's
config.yamlas{provider: anthropic, default: <model>, base_url: <endpoint>}:_interface_modelturns onlyopenaiandcustomroutes into Hermes'scustomprovider and passes ananthropicroute through unchanged, asbuild_hermes_configdoes. - Hermes uses
model.base_urlfor itsanthropicprovider only when_anthropic_base_url_override_okaccepts it: the host isapi.anthropic.comor ends in.anthropic.com,.claude.comor.azure.com, or the path ends in/anthropicor/anthropic/v1(or Kimi'sapi.kimi.com/coding). For any other URL it falls back tohttps://api.anthropic.com, "so a stale non-Anthropic URL cannot hijack native Anthropic". Hermes keeps this rule on purpose, and it fits a configuration a person edits; a Fabric route'sbase_urlis the endpoint the consumer declared, not a stale value.
A consumer can't make Hermes use such an endpoint: it can only refuse the endpoint by copying Hermes's rule, or tell users to change the endpoint.
Evidence, from NVIDIA/NemoClaw#14538: a managed Docker gateway on OpenShell 0.1.8, one Hermes sandbox (Hermes b200f5bc, Fabric 135147a0) whose route uses an anthropic provider at a stub that serves Anthropic's Messages API.
| Provider endpoint | Result |
|---|---|
http://172.30.153.1:17854/v1 |
No reply within 45 seconds; the stub received only Hermes's metadata requests |
http://172.30.153.1:17854/anthropic/v1 |
Hermes's API server answered in 3.7 seconds, through POST /anthropic/v1/messages with x-api-key |
For the first endpoint, the sandbox's supervisor refused each attempt:
OCSF NET:OPEN [MED] DENIED /usr/local/bin/python3.14(0) -> api.anthropic.com:443 [reason:transparent_tcp_policy_denied]
and Hermes's errors.log shows provider=anthropic base_url=https://api.anthropic.com ... APIConnectionError.
The reproduction went through Hermes's API server, which reads config.yaml. The embedded agent gets the endpoint as an argument (adapter.py:404-407), and Hermes's explicit path prefers that argument (_explicit_anthropic); whether invoke is affected wasn't tested.
Proposed enhancement
When the selected model's provider is anthropic and it has a base_url, configure Hermes so that every Hermes process (the embedded agent, the API server, the gateway and the dashboard) sends Messages requests to that base_url, whatever its path.
One possible shape, untested: write the route as Hermes's custom provider with api_mode: anthropic_messages, as the adapter already writes openai routes as custom. Hermes's plain custom provider honors a configured api_mode (_resolve_plain_custom_api_mode). Points to check with it:
- The key header: Hermes's Anthropic client sends
x-api-key, exceptAuthorization: Bearerfor the hosts in_requires_bearer_auth(MiniMax, Azure, Nous Portal and others). An OpenShellanthropicprovider places its key inx-api-key. - The request path for a
base_urlthat ends in/v1, so thathttps://gateway.example/v1getsPOST /v1/messages, as.../anthropic/v1getsPOST /anthropic/v1/messagestoday. - The key's environment variable, which
providers.custom.key_envbinds foropenairoutes.
Public contract and compatibility impact
- Rust API: none.
- Python API: none.
- Schemas or adapter contract: none; the model's
providerandbase_urlkeep their meaning. - Harness or consumer integrations: a Hermes runtime with an
anthropicmodel sends its requests to the declaredbase_urlfor every endpoint, not only for those Hermes recognizes as Anthropic's. - Backward compatibility: an
anthropicmodel whosebase_urlHermes doesn't recognize stops reachinghttps://api.anthropic.com; endpoints Hermes recognizes keep working.
Alternatives considered
- Consumers copy Hermes's rule and refuse other endpoints, as Hermes calls api.anthropic.com instead of an
anthropicprovider's endpoint unless its path ends in/anthropicor/anthropic/v1NemoClaw#14538 first proposed. Each consumer would track an internal Hermes rule, and those endpoints would stay unusable. NemoClaw documents the limit instead. - Users choose an endpoint whose path ends in
/anthropicor/anthropic/v1, or anopenaiprovider when the endpoint also serves OpenAI's API. This works only where the endpoint offers such a path or API. - Hermes honors any
base_urlfor itsanthropicprovider. Hermes keeps the fallback deliberately, to protect configurations a person edits.
Acceptance criteria
- A Hermes runtime with an
anthropicmodel at abase_urlsuch ashttps://gateway.example/v1sends its Messages requests, with the key inx-api-key, to that endpoint from the embedded agent and from Hermes's API server. - Endpoints that work today, such as
https://gateway.example/anthropic/v1andhttps://api.anthropic.com, keep working. - Adapter tests cover an
anthropicmodel at a path Hermes doesn't recognize.
Additional context
- NemoClaw tracks this in NVIDIA/NemoClaw#14538 and documents it as a current limit; NVIDIA/NemoClaw#14532 made Hermes start with an
anthropicprovider. - Revisions: Fabric
mainata2fffa32(NemoClaw pins135147a0, whoseconfiguration.pyhas the same code), Hermes Agentb200f5bc(v0.22.7).
Duplicate check
- I searched the existing issues and did not find a duplicate.
Activity
docs(inference): document which anthropic endpoints Hermes uses (#14571)
fix: send a Hermes anthropic route to its configured endpoint (#689)
chore(fabric): pin Fabric release/0.7 at c6d1093d with the Hermes ant…