hermes - 💡(How to fix) Fix bug: Anthropic provider converts dots to hyphens for ALL models, breaks third-party Anthropic-compatible APIs (e.g. Xiaomi MiMo)

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

When provider: anthropic is set in config.yaml, Hermes normalizes all model names by replacing . with -. This breaks third-party models served over Anthropic-compatible endpoints (e.g. Xiaomi MiMo's https://token-plan-cn.xiaomimimo.com/anthropic), where the model ID contains dots that are part of the canonical name.

Root Cause

In hermes_cli/model_normalize.py, the _DOT_TO_HYPHEN_PROVIDERS set unconditionally includes "anthropic":

_DOT_TO_HYPHEN_PROVIDERS: frozenset[str] = frozenset({
    "anthropic",
})

The normalization function applies dot→hyphen to every model on the Anthropic provider:

if provider in _DOT_TO_HYPHEN_PROVIDERS:
    bare = _strip_matching_provider_prefix(name, provider)
    if "/" in bare:
        return bare
    return _dots_to_hyphens(bare)  # ← mimo-v2.5-pro → mimo-v2-5-pro

This is correct for Claude models (claude-sonnet-4.6claude-sonnet-4-6), but incorrect for non-Claude models whose IDs contain meaningful dots.

Fix Action

Workaround

Use provider: custom with the OpenAI-compatible endpoint (/v1) instead of the Anthropic endpoint. Tool calling works on the OpenAI endpoint, though the Anthropic format would be more robust for structured tool use.

Code Example

_DOT_TO_HYPHEN_PROVIDERS: frozenset[str] = frozenset({
    "anthropic",
})

---

if provider in _DOT_TO_HYPHEN_PROVIDERS:
    bare = _strip_matching_provider_prefix(name, provider)
    if "/" in bare:
        return bare
    return _dots_to_hyphens(bare)  # ← mimo-v2.5-pro → mimo-v2-5-pro

---

model:
     provider: anthropic
     base_url: https://token-plan-cn.xiaomimimo.com/anthropic
     default: mimo-v2.5-pro
     api_key: <mimo-api-key>

---

HTTP 400: Not supported model mimo-v2-5-pro

---

if provider in _DOT_TO_HYPHEN_PROVIDERS:
    bare = _strip_matching_provider_prefix(name, provider)
    if "/" in bare:
        return bare
    # Only convert dots for Claude/Anthropic models — third-party models
    # served via Anthropic-compatible endpoints may have dots in their
    # canonical names (e.g. mimo-v2.5-pro, qwen3.5-plus).
    if bare.lower().startswith("claude-") or bare.lower().startswith("anthropic/"):
        return _dots_to_hyphens(bare)
    return bare
RAW_BUFFERClick to expand / collapse

Summary

When provider: anthropic is set in config.yaml, Hermes normalizes all model names by replacing . with -. This breaks third-party models served over Anthropic-compatible endpoints (e.g. Xiaomi MiMo's https://token-plan-cn.xiaomimimo.com/anthropic), where the model ID contains dots that are part of the canonical name.

Root Cause

In hermes_cli/model_normalize.py, the _DOT_TO_HYPHEN_PROVIDERS set unconditionally includes "anthropic":

_DOT_TO_HYPHEN_PROVIDERS: frozenset[str] = frozenset({
    "anthropic",
})

The normalization function applies dot→hyphen to every model on the Anthropic provider:

if provider in _DOT_TO_HYPHEN_PROVIDERS:
    bare = _strip_matching_provider_prefix(name, provider)
    if "/" in bare:
        return bare
    return _dots_to_hyphens(bare)  # ← mimo-v2.5-pro → mimo-v2-5-pro

This is correct for Claude models (claude-sonnet-4.6claude-sonnet-4-6), but incorrect for non-Claude models whose IDs contain meaningful dots.

Environment

  • Hermes Agent v0.13.0 (ghcr.io/zpvel/hermes-agent-ghcr:latest)
  • Provider: anthropic (using Xiaomi MiMo's Anthropic-compatible endpoint)
  • Model: mimo-v2.5-pro

Steps to Reproduce

  1. Set in config.yaml:
    model:
      provider: anthropic
      base_url: https://token-plan-cn.xiaomimimo.com/anthropic
      default: mimo-v2.5-pro
      api_key: <mimo-api-key>
  2. Start Hermes gateway
  3. Send a message via any platform (e.g. QQ Bot)

Expected Behavior

Model name mimo-v2.5-pro is sent unchanged to the API (dots preserved).

Actual Behavior

Model name is transformed to mimo-v2-5-pro (dots→hyphens), causing:

HTTP 400: Not supported model mimo-v2-5-pro

Proposed Fix

Limit dot→hyphen conversion to Claude models only:

if provider in _DOT_TO_HYPHEN_PROVIDERS:
    bare = _strip_matching_provider_prefix(name, provider)
    if "/" in bare:
        return bare
    # Only convert dots for Claude/Anthropic models — third-party models
    # served via Anthropic-compatible endpoints may have dots in their
    # canonical names (e.g. mimo-v2.5-pro, qwen3.5-plus).
    if bare.lower().startswith("claude-") or bare.lower().startswith("anthropic/"):
        return _dots_to_hyphens(bare)
    return bare

Or alternatively, add an anthropic_compatible provider type that passes model names through unchanged while using the Anthropic Messages API format.

Workaround

Use provider: custom with the OpenAI-compatible endpoint (/v1) instead of the Anthropic endpoint. Tool calling works on the OpenAI endpoint, though the Anthropic format would be more robust for structured tool use.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING