Conversation
mlaihk
force-pushed
the
feat/xiaomi-base-url-override-fallback-models
branch
from
June 9, 2026 09:53
c0876b1 to
0c9f7df
Compare
…dels The bundled Xiaomi MiMo provider has two gaps that break token-plan subscribers in region-routed gateways: 1. base_url is hardcoded to https://api.xiaomimimo.com/v1 (the global marketing endpoint). Token-plan subscribers in SGP and other regions must repoint to their region-routed gateway (e.g. https://token-plan-sgp.xiaomimimo.com/v1) or the API returns 401 on every request. 2. fallback_models is empty. /v1/models on the MiMo API returns 401 even with valid keys (per the existing supports_health_check=False note), so the /model picker has nothing to display for token-plan users. Fix: - Add XIAOMI_BASE_URL to env_vars so the auto-bridge in hermes_cli.auth populates PROVIDER_REGISTRY["xiaomi"].base_url_env_var. Users can now set XIAOMI_BASE_URL=https://token-plan-sgp.xiaomimimo.com/v1 (or any other region gateway) and it Just Works. - Populate fallback_models with the working token-plan catalog (June 2026): mimo-v2.5-pro (flagship reasoning), mimo-v2.5 (omni), mimo-v2-pro and mimo-v2-omni (legacy names that auto-route to v2.5; deprecate 2026-06-30). Flash and UltraSpeed are excluded as they require separate tier enrollment. - Update supports_vision comment to mention mimo-v2.5 (not just mimo-v2-omni). Verified: 52/52 xiaomi tests pass; 163/163 provider tests pass overall; live chat through https://token-plan-sgp.xiaomimimo.com/v1 returns 200 for all four models in fallback_models.
mlaihk
force-pushed
the
feat/xiaomi-base-url-override-fallback-models
branch
from
June 9, 2026 09:53
0c9f7df to
d243cf7
Compare
teknium1
reviewed
Jul 14, 2026
teknium1
left a comment
Collaborator
There was a problem hiding this comment.
Thanks for documenting the Xiaomi Token Plan behavior. The current code has moved the relevant mechanisms.
Problems
XIAOMI_BASE_URLis already active throughhermes_cli/auth.py:405-412andhermes_cli/runtime_provider.py:1466-1507; adding it to the provider profile does not change the current runtime path.- The added
fallback_modelswould not affect the picker:hermes_cli/models.py:2503-2505prefers the non-empty static Xiaomi catalog athermes_cli/models.py:386-392, and the failed-fetch path returns that catalog athermes_cli/models.py:2525-2528. That catalog already has the four requested models, but also still containsmimo-v2-flash.
Suggested changes
- If a current Token Plan repro confirms Flash is unavailable, target the static catalog and add a behavioral picker-fallback test proving Flash is excluded.
- Drop the duplicate profile-level base-URL declaration; the existing registry/runtime wiring already supports it.
Automated hermes-sweeper review.
| name="xiaomi", | ||
| aliases=("mimo", "xiaomi-mimo"), | ||
| env_vars=("XIAOMI_API_KEY",), | ||
| env_vars=("XIAOMI_API_KEY", "XIAOMI_BASE_URL"), |
Collaborator
There was a problem hiding this comment.
XIAOMI_BASE_URL is already the active override in hermes_cli/auth.py:405-412, and hermes_cli/runtime_provider.py:1466-1507 consumes it. Adding it to this profile tuple does not alter the current runtime path.
| supports_health_check=False, # /v1/models returns 401 even with valid key | ||
| supports_vision=True, # mimo-v2-omni is vision-capable | ||
| supports_vision=True, # mimo-v2-omni and mimo-v2.5 are vision-capable | ||
| supports_vision_tool_messages=False, # rejects list-type tool content (400 "text is not set") |
Collaborator
There was a problem hiding this comment.
This fallback is not selected for Xiaomi on current main: hermes_cli/models.py:2503-2505 prefers its non-empty static Xiaomi list (:386-392), which also contains mimo-v2-flash. This change therefore cannot enforce the stated Flash exclusion.
jh1nresh
pushed a commit
to jh1nresh/hermes-agent
that referenced
this pull request
Aug 26, 2026
Salvages Xiaomi MiMo base-url routing fixes from NousResearch#44099/NousResearch#33648/NousResearch#42699 while keeping base-url configuration in config.yaml rather than expanding env-var guidance. Co-authored-by: AIalliAI <285906080+AIalliAI@users.noreply.github.com> Co-authored-by: Jim Dawdy <262052366+jimdawdy-hub@users.noreply.github.com> Co-authored-by: mlaihk <25972362+mlaihk@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The bundled Xiaomi MiMo provider has two gaps that break token-plan subscribers in region-routed gateways:
base_urlis hardcoded tohttps://api.xiaomimimo.com/v1(the global marketing endpoint). Token-plan subscribers in SGP and other regions must repoint to their region-routed gateway (e.g.https://token-plan-sgp.xiaomimimo.com/v1) or the API returns 401 on every request.fallback_modelsis empty./v1/modelson the MiMo API returns 401 even with valid keys (per the existingsupports_health_check=Falsenote), so the/modelpicker has nothing to display for token-plan users.Fix
XIAOMI_BASE_URLtoenv_varsso the auto-bridge inhermes_cli.authpopulatesPROVIDER_REGISTRY["xiaomi"].base_url_env_var. Users can now setXIAOMI_BASE_URL=https://token-plan-sgp.xiaomimimo.com/v1(or any other region gateway) and it Just Works — same pattern asXAI_BASE_URL,NVIDIA_BASE_URL, etc.fallback_modelswith the working token-plan catalog (June 2026):mimo-v2.5-pro— flagship reasoning, 1M ctx, deep thinkingmimo-v2.5— omni: text + image + audio + video, 1M ctxmimo-v2-pro— legacy → auto-routes to v2.5 (deprecates 2026-06-30)mimo-v2-omni— legacy → auto-routes to v2.5 (deprecates 2026-06-30)mimo-v2-flashandmimo-v2.5-pro-ultraspeedintentionally excluded — they require separate tier enrollment and return 400 on the standard token plan.supports_visioncomment to mentionmimo-v2.5(not justmimo-v2-omni).Verification
tests/hermes_cli/test_xiaomi_provider.py)https://token-plan-sgp.xiaomimimo.com/v1returns 200 for all four models infallback_models; previously returned 401 with the hardcoded base URL.Notes for Reviewer
test_base_url_env_vartest now actually passes against the bridged config).XAI_BASE_URL/NVIDIA_BASE_URLenv-var override idiom used byhermes_cli.auth's auto-bridge.https://api.xiaomimimo.com/v1is preserved whenXIAOMI_BASE_URLis unset.