hermes - 💡(How to fix) Fix Model name unexpectedly lowercased causing API errors [1 comments, 2 participants]

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…
GitHub stats
NousResearch/hermes-agent#15572Fetched 2026-04-26 05:26:31
View on GitHub
Comments
1
Participants
2
Timeline
6
Reactions
0
Timeline (top)
labeled ×4closed ×1commented ×1

Root Cause

normalize_model_name 函数(agent/model_normalize.py 第 919 行附近)中:

lower = model.lower()  # ← 整个 model 字符串(包括 provider 前缀)被转小写
if lower.startswith("anthropic/"):
    model = model[len("anthropic/"):]
  • minimax/MiniMax-M2.7lower = "minimax/minimax-m2.7"
  • lower.startswith("anthropic/") → False(因为 minimaxanthropic
  • 函数直接返回原始 modelminimax/MiniMax-M2.7

这个特定函数本身不会导致全小写问题。但日志明确显示全小写,说明 lowercasing 发生在调用链的其他位置(可能在压缩器的 call_llm 路径里的某个 adapter)。

Code Example

lower = model.lower()  # ← 整个 model 字符串(包括 provider 前缀)被转小写
if lower.startswith("anthropic/"):
    model = model[len("anthropic/"):]

---

Session split detected: 20260425_100014_40a10d53 → 20260425_163025_c711c6 (compression)

---

invalid params, unknown model 'minimax/minimax-m2.7'
RAW_BUFFERClick to expand / collapse

Bug Description

normalize_model_name 函数(agent/model_normalize.py)中,model 名称在某些路径下被意外全小写化,导致 API 调用报错 invalid params, unknown model 'minimax/minimax-m2.7'

⚠️ 此 issue 由 Hermes 用户提交,来源:luoshan5261486/hermes 自定义部署实例

Steps to Reproduce

  1. 配置 minimax/MiniMax-M2.7 作为 model
  2. 使用一段时间后触发上下文压缩(session split)
  3. 观察日志:API 报错全小写的 model 名称

Expected Behavior

Model 名称应保持原始大小写(minimax/MiniMax-M2.7),不应被 lowercasing。

Actual Behavior

日志显示 API 收到 minimax/minimax-m2.7(全小写),而配置的原始值为 minimax/MiniMax-M2.7

Root Cause Analysis

normalize_model_name 函数(agent/model_normalize.py 第 919 行附近)中:

lower = model.lower()  # ← 整个 model 字符串(包括 provider 前缀)被转小写
if lower.startswith("anthropic/"):
    model = model[len("anthropic/"):]
  • minimax/MiniMax-M2.7lower = "minimax/minimax-m2.7"
  • lower.startswith("anthropic/") → False(因为 minimaxanthropic
  • 函数直接返回原始 modelminimax/MiniMax-M2.7

这个特定函数本身不会导致全小写问题。但日志明确显示全小写,说明 lowercasing 发生在调用链的其他位置(可能在压缩器的 call_llm 路径里的某个 adapter)。

Environment

  • Hermes Agent(自部署实例)
  • Provider: minimax-cn
  • Model: minimax/MiniMax-M2.7
  • 触发条件:上下文压缩导致的 session split

Additional Context

Session split 日志:

Session split detected: 20260425_100014_40a10d53 → 20260425_163025_c711c6 (compression)

相关错误日志:

invalid params, unknown model 'minimax/minimax-m2.7'

extent analysis

TL;DR

The issue can be fixed by identifying and modifying the code path that is lowercasing the model name, likely in the call_llm pathway of an adapter.

Guidance

  • Review the code in the call_llm pathway of the relevant adapter to find where the model name is being lowercased.
  • Verify that the normalize_model_name function is not being called with the lowercased model name as an argument.
  • Check for any other functions or methods that may be modifying the model name and causing it to be lowercased.
  • Consider adding logging or debugging statements to track the model name as it passes through the code to identify where the lowercasing is occurring.

Example

No specific code example can be provided without more information about the adapter and call_llm pathway, but a possible debugging approach could involve adding a log statement like print(f"Model name before call_llm: {model_name}") to track the model name.

Notes

The provided normalize_model_name function does not appear to be the cause of the issue, so the problem likely lies elsewhere in the codebase. Without more information about the adapter and call_llm pathway, it is difficult to provide a more specific solution.

Recommendation

Apply a workaround by identifying and modifying the code path that is lowercasing the model name, as the root cause of the issue is not in the provided normalize_model_name function.

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

hermes - 💡(How to fix) Fix Model name unexpectedly lowercased causing API errors [1 comments, 2 participants]