Skip to content

fix(normalize): lowercase Xiaomi model IDs for case-insensitive config#15066

Merged
kshitijk4poor merged 1 commit into
mainfrom
fix/xiaomi-model-case-insensitive
Apr 24, 2026
Merged

fix(normalize): lowercase Xiaomi model IDs for case-insensitive config#15066
kshitijk4poor merged 1 commit into
mainfrom
fix/xiaomi-model-case-insensitive

Conversation

@kshitijk4poor

@kshitijk4poor kshitijk4poor commented Apr 24, 2026

Copy link
Copy Markdown
Collaborator

Summary

Xiaomi's API (api.xiaomimimo.com) requires lowercase model IDs like mimo-v2.5-pro but rejects mixed-case names like MiMo-V2.5-Pro. Users naturally copy the marketing-style case from docs and the ProviderEntry description (MiMo-V2.5 and V2 models — pro, omni, flash), then hit unrecognized model errors.

Problem

normalize_model_for_provider() for the xiaomi provider (in _MATCHING_PREFIX_STRIP_PROVIDERS) only strips the xiaomi/ prefix but does not normalize case. So:

User config Sent to API Result
mimo-v2.5-pro mimo-v2.5-pro ✅ Works
MiMo-V2.5-Pro MiMo-V2.5-Pro ❌ API rejects
xiaomi/MiMo-V2.5-Pro MiMo-V2.5-Pro ❌ API rejects

Fix

  • Add _LOWERCASE_MODEL_PROVIDERS frozenset (currently just xiaomi) in model_normalize.py
  • Apply .lower() after prefix stripping for providers in this set
  • Other providers (minimax, zai, etc.) are not affected — their APIs accept mixed case

After fix

User config Sent to API Result
mimo-v2.5-pro mimo-v2.5-pro ✅ Works
MiMo-V2.5-Pro mimo-v2.5-pro ✅ Works
xiaomi/MiMo-V2.5-Pro mimo-v2.5-pro ✅ Works
MIMO-V2.5-PRO mimo-v2.5-pro ✅ Works

Test plan

  • 15 new tests in test_xiaomi_provider.py:
    • 8 parametrized tests for mixed-case bare names (all model variants)
    • 3 parametrized tests for prefix+case combos
    • 3 parametrized edge-case tests (None, empty, whitespace)
    • 1 invariant test: _LOWERCASE_MODEL_PROVIDERS ⊆ _MATCHING_PREFIX_STRIP_PROVIDERS
  • All 52 Xiaomi provider tests pass
  • All 55 model normalization tests pass
  • 317 total tests across related suites — 0 new failures
  • Cross-provider non-regression verified: minimax, zai, kimi-coding, alibaba, arcee all preserve case
  • Aggregator paths (openrouter, nous) unaffected

Files changed

  • hermes_cli/model_normalize.py — add _LOWERCASE_MODEL_PROVIDERS, apply .lower() in the direct-provider normalization path, add docstring example
  • tests/hermes_cli/test_xiaomi_provider.py — 15 new tests for case-insensitive normalization + invariant + edge cases

Xiaomi's API (api.xiaomimimo.com) requires lowercase model IDs like
"mimo-v2.5-pro" but rejects mixed-case names like "MiMo-V2.5-Pro"
that users copy from marketing docs or the ProviderEntry description.

Add _LOWERCASE_MODEL_PROVIDERS set and apply .lower() to model names
for providers in this set (currently just xiaomi) after stripping the
provider prefix. This ensures any case variant in config.yaml is
normalized before hitting the API.

Other providers (minimax, zai, etc.) are NOT affected — their APIs
accept mixed case (e.g. MiniMax-M2.7).
@kshitijk4poor kshitijk4poor force-pushed the fix/xiaomi-model-case-insensitive branch from 1f7e0a3 to 00a770c Compare April 24, 2026 10:30
@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have comp/cli CLI entry point, hermes_cli/, setup wizard provider/xiaomi Xiaomi MiLM labels Apr 24, 2026
@kshitijk4poor kshitijk4poor merged commit 7897f65 into main Apr 24, 2026
11 of 12 checks passed
@kshitijk4poor kshitijk4poor deleted the fix/xiaomi-model-case-insensitive branch April 24, 2026 10:33
nekorytaylor666 pushed a commit to nekorytaylor666/hermes-agent that referenced this pull request Apr 24, 2026
NousResearch#15066)

Xiaomi's API (api.xiaomimimo.com) requires lowercase model IDs like
"mimo-v2.5-pro" but rejects mixed-case names like "MiMo-V2.5-Pro"
that users copy from marketing docs or the ProviderEntry description.

Add _LOWERCASE_MODEL_PROVIDERS set and apply .lower() to model names
for providers in this set (currently just xiaomi) after stripping the
provider prefix. This ensures any case variant in config.yaml is
normalized before hitting the API.

Other providers (minimax, zai, etc.) are NOT affected — their APIs
accept mixed case (e.g. MiniMax-M2.7).
justrhoto pushed a commit to justrhoto/hermes-agent that referenced this pull request Apr 24, 2026
NousResearch#15066)

Xiaomi's API (api.xiaomimimo.com) requires lowercase model IDs like
"mimo-v2.5-pro" but rejects mixed-case names like "MiMo-V2.5-Pro"
that users copy from marketing docs or the ProviderEntry description.

Add _LOWERCASE_MODEL_PROVIDERS set and apply .lower() to model names
for providers in this set (currently just xiaomi) after stripping the
provider prefix. This ensures any case variant in config.yaml is
normalized before hitting the API.

Other providers (minimax, zai, etc.) are NOT affected — their APIs
accept mixed case (e.g. MiniMax-M2.7).
ulasbilgen pushed a commit to ulasbilgen/hermes-adhd-agent that referenced this pull request May 1, 2026
NousResearch#15066)

Xiaomi's API (api.xiaomimimo.com) requires lowercase model IDs like
"mimo-v2.5-pro" but rejects mixed-case names like "MiMo-V2.5-Pro"
that users copy from marketing docs or the ProviderEntry description.

Add _LOWERCASE_MODEL_PROVIDERS set and apply .lower() to model names
for providers in this set (currently just xiaomi) after stripping the
provider prefix. This ensures any case variant in config.yaml is
normalized before hitting the API.

Other providers (minimax, zai, etc.) are NOT affected — their APIs
accept mixed case (e.g. MiniMax-M2.7).
aj-nt pushed a commit to aj-nt/hermes-agent that referenced this pull request May 1, 2026
NousResearch#15066)

Xiaomi's API (api.xiaomimimo.com) requires lowercase model IDs like
"mimo-v2.5-pro" but rejects mixed-case names like "MiMo-V2.5-Pro"
that users copy from marketing docs or the ProviderEntry description.

Add _LOWERCASE_MODEL_PROVIDERS set and apply .lower() to model names
for providers in this set (currently just xiaomi) after stripping the
provider prefix. This ensures any case variant in config.yaml is
normalized before hitting the API.

Other providers (minimax, zai, etc.) are NOT affected — their APIs
accept mixed case (e.g. MiniMax-M2.7).
donald131 pushed a commit to donald131/hermes-agent that referenced this pull request May 2, 2026
NousResearch#15066)

Xiaomi's API (api.xiaomimimo.com) requires lowercase model IDs like
"mimo-v2.5-pro" but rejects mixed-case names like "MiMo-V2.5-Pro"
that users copy from marketing docs or the ProviderEntry description.

Add _LOWERCASE_MODEL_PROVIDERS set and apply .lower() to model names
for providers in this set (currently just xiaomi) after stripping the
provider prefix. This ensures any case variant in config.yaml is
normalized before hitting the API.

Other providers (minimax, zai, etc.) are NOT affected — their APIs
accept mixed case (e.g. MiniMax-M2.7).
02356abc pushed a commit to 02356abc/hermes-agent that referenced this pull request May 14, 2026
NousResearch#15066)

Xiaomi's API (api.xiaomimimo.com) requires lowercase model IDs like
"mimo-v2.5-pro" but rejects mixed-case names like "MiMo-V2.5-Pro"
that users copy from marketing docs or the ProviderEntry description.

Add _LOWERCASE_MODEL_PROVIDERS set and apply .lower() to model names
for providers in this set (currently just xiaomi) after stripping the
provider prefix. This ensures any case variant in config.yaml is
normalized before hitting the API.

Other providers (minimax, zai, etc.) are NOT affected — their APIs
accept mixed case (e.g. MiniMax-M2.7).
gweeteve pushed a commit to gweeteve/hermes-agent that referenced this pull request Jun 2, 2026
NousResearch#15066)

Xiaomi's API (api.xiaomimimo.com) requires lowercase model IDs like
"mimo-v2.5-pro" but rejects mixed-case names like "MiMo-V2.5-Pro"
that users copy from marketing docs or the ProviderEntry description.

Add _LOWERCASE_MODEL_PROVIDERS set and apply .lower() to model names
for providers in this set (currently just xiaomi) after stripping the
provider prefix. This ensures any case variant in config.yaml is
normalized before hitting the API.

Other providers (minimax, zai, etc.) are NOT affected — their APIs
accept mixed case (e.g. MiniMax-M2.7).
Egavasyug pushed a commit to Egavasyug/hermes-agent that referenced this pull request Jun 10, 2026
NousResearch#15066)

Xiaomi's API (api.xiaomimimo.com) requires lowercase model IDs like
"mimo-v2.5-pro" but rejects mixed-case names like "MiMo-V2.5-Pro"
that users copy from marketing docs or the ProviderEntry description.

Add _LOWERCASE_MODEL_PROVIDERS set and apply .lower() to model names
for providers in this set (currently just xiaomi) after stripping the
provider prefix. This ensures any case variant in config.yaml is
normalized before hitting the API.

Other providers (minimax, zai, etc.) are NOT affected — their APIs
accept mixed case (e.g. MiniMax-M2.7).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/cli CLI entry point, hermes_cli/, setup wizard P3 Low — cosmetic, nice to have provider/xiaomi Xiaomi MiLM type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants