Skip to content

feat(xiaomi): add Xiaomi MiMo as first-class provider#7702

Closed
kshitijk4poor wants to merge 1 commit into
NousResearch:mainfrom
kshitijk4poor:feat/xiaomi-provider
Closed

feat(xiaomi): add Xiaomi MiMo as first-class provider#7702
kshitijk4poor wants to merge 1 commit into
NousResearch:mainfrom
kshitijk4poor:feat/xiaomi-provider

Conversation

@kshitijk4poor

@kshitijk4poor kshitijk4poor commented Apr 11, 2026

Copy link
Copy Markdown
Collaborator

What does this PR do?

Adds first-class Hermes support for Xiaomi MiMo via its OpenAI-compatible API endpoint (https://api.xiaomimimo.com/v1).

MiMo models (from official docs):

  • mimo-v2-pro — 1M context, 128K output, text + reasoning + tool calling + web search
  • mimo-v2-omni — 256K context, 128K output, multimodal + reasoning + tool calling + web search
  • mimo-v2-flash — 256K context, 64K output, text + reasoning + tool calling + web search (cheapest)

Related Issue

None.

Type of Change

  • ✨ New feature (non-breaking change that adds functionality)
  • ✅ Tests (adding or improving test coverage)
  • 🐛 Bug fix (non-breaking change that fixes an issue)

Changes Made

Standard 12-file provider checklist (13 files modified + 1 new test file):

  • hermes_cli/auth.py — PROVIDER_REGISTRY entry + mimo/xiaomi-mimo aliases
  • hermes_cli/config.pyXIAOMI_API_KEY + XIAOMI_BASE_URL in OPTIONAL_ENV_VARS
  • hermes_cli/models.py_PROVIDER_LABELS, _PROVIDER_ALIASES, _PROVIDER_ORDER, _PROVIDER_MODELS static fallback
  • agent/model_metadata.py_PROVIDER_PREFIXES + _URL_TO_PROVIDER + context length fixes
  • hermes_cli/model_normalize.py_MATCHING_PREFIX_STRIP_PROVIDERS (strips xiaomi/ prefix for direct API)
  • agent/auxiliary_client.pymimo-v2-flash as default aux model
  • hermes_cli/main.pyprovider_labels, extended_providers, dispatch tuple, --provider choices
  • hermes_cli/providers.pyHermesOverlay + ALIASES + _LABEL_OVERRIDES
  • agent/models_dev.pyPROVIDER_TO_MODELS_DEV mapping
  • hermes_cli/doctor.pyXIAOMI_API_KEY in _PROVIDER_ENV_HINTS
  • .env.example / cli-config.yaml.example — documentation

Context length fixes

Cross-referenced against the official Xiaomi MiMo pricing/specs page and corrected pre-existing values in DEFAULT_CONTEXT_LENGTHS:

Model Before After (official)
mimo-v2-pro 1,048,576 1,000,000
mimo-v2-omni 1,048,576 256,000
mimo-v2-flash (missing) 256,000

Edge cases handled

  • Model normalization: xiaomi/mimo-v2-promimo-v2-pro when provider=xiaomi (added to _MATCHING_PREFIX_STRIP_PROVIDERS)
  • Static model fallback: _PROVIDER_MODELS["xiaomi"] for model picker when models.dev/live API unavailable
  • Regional URL inference: xiaomimimo.com catch-all covers token-plan-ams/cn/sgp.xiaomimimo.com
  • Doctor support: XIAOMI_API_KEY in _PROVIDER_ENV_HINTS so hermes doctor detects it

35 tests in tests/hermes_cli/test_xiaomi_provider.py covering registry, aliases, auto-detection, credentials, static model list, models.dev, normalization (prefix strip + bare name), URL mapping (including regional endpoints), providers module, doctor, auxiliary client, and agent init.

How to Test

# With API key
export XIAOMI_API_KEY=your_key
hermes chat --provider xiaomi -m mimo-v2-pro

# Or via alias
hermes chat --provider mimo

# Run tests
python -m pytest tests/hermes_cli/test_xiaomi_provider.py -v

Checklist

Code Quality

  • Code follows the project's style guidelines
  • Self-reviewed the code
  • No new warnings introduced
  • Compared against deepseek/xai provider implementations for consistency

Testing

  • 35 tests covering all integration points
  • All existing tests pass (218+ passed across related test files, 0 regressions)
  • User flows traced: CLI args, model picker, auto-detect, /model, doctor, auth pool, runtime, gateway, aux client, config.yaml

Documentation

  • Updated .env.example with Xiaomi section
  • Updated cli-config.yaml.example with provider comment
  • API key URL verified against live platform (platform.xiaomimimo.com)

Add Xiaomi MiMo (mimo-v2-pro, mimo-v2-omni, mimo-v2-flash) as a native
OpenAI-compatible provider with full lifecycle support.

Changes across the standard 12-file provider checklist:
- PROVIDER_REGISTRY entry with XIAOMI_API_KEY + XIAOMI_BASE_URL
- Provider aliases: mimo, xiaomi-mimo -> xiaomi
- CLI model selection flow (provider_labels, extended_providers, dispatch)
- models.dev mapping (xiaomi -> xiaomi)
- URL-to-provider inference (api.xiaomimimo.com)
- Auxiliary client default model (mimo-v2-flash)
- providers.py overlay (openai_chat transport)
- .env.example and cli-config.yaml.example documentation

29 new tests covering registry, aliases, auto-detection, credentials,
models.dev integration, normalization, URL mapping, providers module,
auxiliary model, and agent init.
teknium1 pushed a commit that referenced this pull request Apr 11, 2026
Cherry-picked from PR #7702 by kshitijk4poor.

Adds Xiaomi MiMo as a direct provider (XIAOMI_API_KEY) with models:
- mimo-v2-pro (1M context), mimo-v2-omni (256K, multimodal), mimo-v2-flash (256K, cheapest)

Standard OpenAI-compatible provider checklist: auth.py, config.py, models.py,
main.py, providers.py, doctor.py, model_normalize.py, model_metadata.py,
models_dev.py, auxiliary_client.py, .env.example, cli-config.yaml.example.

Follow-up: vision tasks use mimo-v2-omni (multimodal) instead of the user's
main model. Non-vision aux uses the user's selected model. Added
_PROVIDER_VISION_MODELS dict for provider-specific vision model overrides.
On failure, falls back to aggregators (gemini flash) via existing fallback chain.

Corrects pre-existing context lengths: mimo-v2-pro 1048576→1000000,
mimo-v2-omni 1048576→256000, adds mimo-v2-flash 256000.

36 tests covering registry, aliases, auto-detect, credentials, models.dev,
normalization, URL mapping, providers module, doctor, aux client, vision
model override, and agent init.
teknium1 pushed a commit that referenced this pull request Apr 11, 2026
Cherry-picked from PR #7702 by kshitijk4poor.

Adds Xiaomi MiMo as a direct provider (XIAOMI_API_KEY) with models:
- mimo-v2-pro (1M context), mimo-v2-omni (256K, multimodal), mimo-v2-flash (256K, cheapest)

Standard OpenAI-compatible provider checklist: auth.py, config.py, models.py,
main.py, providers.py, doctor.py, model_normalize.py, model_metadata.py,
models_dev.py, auxiliary_client.py, .env.example, cli-config.yaml.example.

Follow-up: vision tasks use mimo-v2-omni (multimodal) instead of the user's
main model. Non-vision aux uses the user's selected model. Added
_PROVIDER_VISION_MODELS dict for provider-specific vision model overrides.
On failure, falls back to aggregators (gemini flash) via existing fallback chain.

Corrects pre-existing context lengths: mimo-v2-pro 1048576→1000000,
mimo-v2-omni 1048576→256000, adds mimo-v2-flash 256000.

36 tests covering registry, aliases, auto-detect, credentials, models.dev,
normalization, URL mapping, providers module, doctor, aux client, vision
model override, and agent init.
Tommyeds pushed a commit to Tommyeds/hermes-agent that referenced this pull request Apr 12, 2026
Cherry-picked from PR NousResearch#7702 by kshitijk4poor.

Adds Xiaomi MiMo as a direct provider (XIAOMI_API_KEY) with models:
- mimo-v2-pro (1M context), mimo-v2-omni (256K, multimodal), mimo-v2-flash (256K, cheapest)

Standard OpenAI-compatible provider checklist: auth.py, config.py, models.py,
main.py, providers.py, doctor.py, model_normalize.py, model_metadata.py,
models_dev.py, auxiliary_client.py, .env.example, cli-config.yaml.example.

Follow-up: vision tasks use mimo-v2-omni (multimodal) instead of the user's
main model. Non-vision aux uses the user's selected model. Added
_PROVIDER_VISION_MODELS dict for provider-specific vision model overrides.
On failure, falls back to aggregators (gemini flash) via existing fallback chain.

Corrects pre-existing context lengths: mimo-v2-pro 1048576→1000000,
mimo-v2-omni 1048576→256000, adds mimo-v2-flash 256000.

36 tests covering registry, aliases, auto-detect, credentials, models.dev,
normalization, URL mapping, providers module, doctor, aux client, vision
model override, and agent init.
ulasbilgen pushed a commit to ulasbilgen/hermes-adhd-agent that referenced this pull request May 1, 2026
Cherry-picked from PR NousResearch#7702 by kshitijk4poor.

Adds Xiaomi MiMo as a direct provider (XIAOMI_API_KEY) with models:
- mimo-v2-pro (1M context), mimo-v2-omni (256K, multimodal), mimo-v2-flash (256K, cheapest)

Standard OpenAI-compatible provider checklist: auth.py, config.py, models.py,
main.py, providers.py, doctor.py, model_normalize.py, model_metadata.py,
models_dev.py, auxiliary_client.py, .env.example, cli-config.yaml.example.

Follow-up: vision tasks use mimo-v2-omni (multimodal) instead of the user's
main model. Non-vision aux uses the user's selected model. Added
_PROVIDER_VISION_MODELS dict for provider-specific vision model overrides.
On failure, falls back to aggregators (gemini flash) via existing fallback chain.

Corrects pre-existing context lengths: mimo-v2-pro 1048576→1000000,
mimo-v2-omni 1048576→256000, adds mimo-v2-flash 256000.

36 tests covering registry, aliases, auto-detect, credentials, models.dev,
normalization, URL mapping, providers module, doctor, aux client, vision
model override, and agent init.
aj-nt pushed a commit to aj-nt/hermes-agent that referenced this pull request May 1, 2026
Cherry-picked from PR NousResearch#7702 by kshitijk4poor.

Adds Xiaomi MiMo as a direct provider (XIAOMI_API_KEY) with models:
- mimo-v2-pro (1M context), mimo-v2-omni (256K, multimodal), mimo-v2-flash (256K, cheapest)

Standard OpenAI-compatible provider checklist: auth.py, config.py, models.py,
main.py, providers.py, doctor.py, model_normalize.py, model_metadata.py,
models_dev.py, auxiliary_client.py, .env.example, cli-config.yaml.example.

Follow-up: vision tasks use mimo-v2-omni (multimodal) instead of the user's
main model. Non-vision aux uses the user's selected model. Added
_PROVIDER_VISION_MODELS dict for provider-specific vision model overrides.
On failure, falls back to aggregators (gemini flash) via existing fallback chain.

Corrects pre-existing context lengths: mimo-v2-pro 1048576→1000000,
mimo-v2-omni 1048576→256000, adds mimo-v2-flash 256000.

36 tests covering registry, aliases, auto-detect, credentials, models.dev,
normalization, URL mapping, providers module, doctor, aux client, vision
model override, and agent init.
02356abc pushed a commit to 02356abc/hermes-agent that referenced this pull request May 14, 2026
Cherry-picked from PR NousResearch#7702 by kshitijk4poor.

Adds Xiaomi MiMo as a direct provider (XIAOMI_API_KEY) with models:
- mimo-v2-pro (1M context), mimo-v2-omni (256K, multimodal), mimo-v2-flash (256K, cheapest)

Standard OpenAI-compatible provider checklist: auth.py, config.py, models.py,
main.py, providers.py, doctor.py, model_normalize.py, model_metadata.py,
models_dev.py, auxiliary_client.py, .env.example, cli-config.yaml.example.

Follow-up: vision tasks use mimo-v2-omni (multimodal) instead of the user's
main model. Non-vision aux uses the user's selected model. Added
_PROVIDER_VISION_MODELS dict for provider-specific vision model overrides.
On failure, falls back to aggregators (gemini flash) via existing fallback chain.

Corrects pre-existing context lengths: mimo-v2-pro 1048576→1000000,
mimo-v2-omni 1048576→256000, adds mimo-v2-flash 256000.

36 tests covering registry, aliases, auto-detect, credentials, models.dev,
normalization, URL mapping, providers module, doctor, aux client, vision
model override, and agent init.
olympus-terminal pushed a commit to olympus-terminal/hermes-agent that referenced this pull request May 16, 2026
Cherry-picked from PR NousResearch#7702 by kshitijk4poor.

Adds Xiaomi MiMo as a direct provider (XIAOMI_API_KEY) with models:
- mimo-v2-pro (1M context), mimo-v2-omni (256K, multimodal), mimo-v2-flash (256K, cheapest)

Standard OpenAI-compatible provider checklist: auth.py, config.py, models.py,
main.py, providers.py, doctor.py, model_normalize.py, model_metadata.py,
models_dev.py, auxiliary_client.py, .env.example, cli-config.yaml.example.

Follow-up: vision tasks use mimo-v2-omni (multimodal) instead of the user's
main model. Non-vision aux uses the user's selected model. Added
_PROVIDER_VISION_MODELS dict for provider-specific vision model overrides.
On failure, falls back to aggregators (gemini flash) via existing fallback chain.

Corrects pre-existing context lengths: mimo-v2-pro 1048576→1000000,
mimo-v2-omni 1048576→256000, adds mimo-v2-flash 256000.

36 tests covering registry, aliases, auto-detect, credentials, models.dev,
normalization, URL mapping, providers module, doctor, aux client, vision
model override, and agent init.
gweeteve pushed a commit to gweeteve/hermes-agent that referenced this pull request Jun 2, 2026
Cherry-picked from PR NousResearch#7702 by kshitijk4poor.

Adds Xiaomi MiMo as a direct provider (XIAOMI_API_KEY) with models:
- mimo-v2-pro (1M context), mimo-v2-omni (256K, multimodal), mimo-v2-flash (256K, cheapest)

Standard OpenAI-compatible provider checklist: auth.py, config.py, models.py,
main.py, providers.py, doctor.py, model_normalize.py, model_metadata.py,
models_dev.py, auxiliary_client.py, .env.example, cli-config.yaml.example.

Follow-up: vision tasks use mimo-v2-omni (multimodal) instead of the user's
main model. Non-vision aux uses the user's selected model. Added
_PROVIDER_VISION_MODELS dict for provider-specific vision model overrides.
On failure, falls back to aggregators (gemini flash) via existing fallback chain.

Corrects pre-existing context lengths: mimo-v2-pro 1048576→1000000,
mimo-v2-omni 1048576→256000, adds mimo-v2-flash 256000.

36 tests covering registry, aliases, auto-detect, credentials, models.dev,
normalization, URL mapping, providers module, doctor, aux client, vision
model override, and agent init.
Egavasyug pushed a commit to Egavasyug/hermes-agent that referenced this pull request Jun 10, 2026
Cherry-picked from PR NousResearch#7702 by kshitijk4poor.

Adds Xiaomi MiMo as a direct provider (XIAOMI_API_KEY) with models:
- mimo-v2-pro (1M context), mimo-v2-omni (256K, multimodal), mimo-v2-flash (256K, cheapest)

Standard OpenAI-compatible provider checklist: auth.py, config.py, models.py,
main.py, providers.py, doctor.py, model_normalize.py, model_metadata.py,
models_dev.py, auxiliary_client.py, .env.example, cli-config.yaml.example.

Follow-up: vision tasks use mimo-v2-omni (multimodal) instead of the user's
main model. Non-vision aux uses the user's selected model. Added
_PROVIDER_VISION_MODELS dict for provider-specific vision model overrides.
On failure, falls back to aggregators (gemini flash) via existing fallback chain.

Corrects pre-existing context lengths: mimo-v2-pro 1048576→1000000,
mimo-v2-omni 1048576→256000, adds mimo-v2-flash 256000.

36 tests covering registry, aliases, auto-detect, credentials, models.dev,
normalization, URL mapping, providers module, doctor, aux client, vision
model override, and agent init.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant