You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using a custom provider with an Anthropic-compatible endpoint, Hermes still applies normalize_model_name(), which blindly converts dots to dashes in the model identifier. This breaks providers whose model IDs legitimately contain dots.
For example, with a custom provider configured for zenmux (https://zenmux.ai/api/anthropic) and model z-ai/glm-5.1:
User-configured model ID: z-ai/glm-5.1
After normalize_model_name(): z-ai/glm-5-1
zenmux API response: HTTP 404 — Requested model is not valid
The root cause is _anthropic_preserve_dots(), which only returns True for a hardcoded allowlist of built-in providers (alibaba, minimax, opencode-go, opencode-zen, zai, bedrock) or specific URL substrings. A custom provider like zenmux is not in that list, so its model name gets mangled even though the user explicitly configured the exact ID the upstream expects.
Verify via direct SDK call that z-ai/glm-5.1 works, but z-ai/glm-5-1 returns the same 404.
Expected Behavior
For custom providers, Hermes should respect the user-configured model ID exactly as written. The user has already told Hermes what string the upstream expects; Hermes should not second-guess it with normalize_model_name().
Actual Behavior
normalize_model_name() converts z-ai/glm-5.1 → z-ai/glm-5-1, causing a 404 from the upstream.
Related Issues
[Bug]: Select Model GLM-4.7 get "提示模型不存在,请检查模型代码" #7475 — Same underlying problem with glm-4.7 via the built-in zai provider (fixed by adding zai to the _anthropic_preserve_dots allowlist). The fix there was provider-specific; the general problem for custom providers remains.
Proposed Fix
Option A (preferred): Skip normalize_model_name() entirely when the provider is a custom provider, or at least default preserve_dots=True for custom providers and let the user opt into normalization if needed.
Option B: Extend _anthropic_preserve_dots() to detect custom providers and inspect the configured model name. If the original model string contains dots, preserve them.
Bug Description
When using a custom provider with an Anthropic-compatible endpoint, Hermes still applies
normalize_model_name(), which blindly converts dots to dashes in the model identifier. This breaks providers whose model IDs legitimately contain dots.For example, with a custom provider configured for zenmux (
https://zenmux.ai/api/anthropic) and modelz-ai/glm-5.1:z-ai/glm-5.1normalize_model_name():z-ai/glm-5-1HTTP 404 — Requested model is not validThe root cause is
_anthropic_preserve_dots(), which only returnsTruefor a hardcoded allowlist of built-in providers (alibaba,minimax,opencode-go,opencode-zen,zai,bedrock) or specific URL substrings. A custom provider likezenmuxis not in that list, so its model name gets mangled even though the user explicitly configured the exact ID the upstream expects.Steps to Reproduce
~/.hermes/config.yaml:hermes).z-ai/glm-5.1works, butz-ai/glm-5-1returns the same 404.Expected Behavior
For custom providers, Hermes should respect the user-configured model ID exactly as written. The user has already told Hermes what string the upstream expects; Hermes should not second-guess it with
normalize_model_name().Actual Behavior
normalize_model_name()convertsz-ai/glm-5.1→z-ai/glm-5-1, causing a 404 from the upstream.Related Issues
glm-4.7via the built-inzaiprovider (fixed by addingzaito the_anthropic_preserve_dotsallowlist). The fix there was provider-specific; the general problem for custom providers remains.Proposed Fix
Option A (preferred): Skip
normalize_model_name()entirely when the provider is a custom provider, or at least defaultpreserve_dots=Truefor custom providers and let the user opt into normalization if needed.Option B: Extend
_anthropic_preserve_dots()to detect custom providers and inspect the configured model name. If the original model string contains dots, preserve them.Affected Component
CLI / Agent (
agent/anthropic_adapter.py,run_agent.py)Hermes Version
v0.8.0+
Are you willing to submit a PR for this?