Skip to content

fix(providers): live model discovery for xiaomi-mimo / xiaomi-mimo-token-plan (#15307) - #15308

Open
LazyGatto wants to merge 2 commits into
diegosouzapw:release/v3.8.52from
LazyGatto:fix/xiaomi-mimo-model-discovery
Open

LazyGatto wants to merge 2 commits into
diegosouzapw:release/v3.8.52from
LazyGatto:fix/xiaomi-mimo-model-discovery

Conversation

@LazyGatto

Copy link
Copy Markdown

Problem

xiaomi-mimo and xiaomi-mimo-token-plan are keyed OpenAI-style providers with a real registry baseUrl and a live OpenAI-compatible /v1/models endpoint, but they are not classified by any live-fetch branch of the model-import route (src/app/api/providers/[id]/models/route.ts): they are not openai-compatible-*, not self-hosted, and not in NAMED_OPENAI_STYLE_PROVIDERS. Import therefore never probes the upstream /models and falls through to the hardcoded registry seed (CHAT_OPENAI_COMPAT_MODELS["xiaomi-mimo"] = 2 entries: mimo-v2.5-pro, mimo-v2.5) with the warning API unavailable — using local catalog.

The upstream API itself is healthy — verified from inside an OmniRoute container against the same key:

  • GET https://token-plan-sgp.xiaomimimo.com/v1/models → 200 in ~690 ms with 8 models (mimo-v2.5-pro, mimo-v2.5, mimo-v2.6-pro, mimo-v2.6-flash, mimo-v2.5-asr, mimo-v2.5-tts, mimo-v2.5-tts-voiceclone, mimo-v2.5-tts-voicedesign)
  • POST /v1/chat/completions → 200 in ~1.1 s

Inference works (DefaultExecutor reads baseUrl from the connection); only model discovery is affected. Syncing consequently imports 2 of 8 models, and newer models (mimo-v2.6-pro, mimo-v2.6-flash) are undiscoverable — they must be added by hand as custom models.

Closes #15307. Same class as #4249 (vercel-ai-gateway), #4202 (zenmux), #3976 (llm7/byteplus) and the provider-model-sweep — each fixed the same way.

Fix

Add "xiaomi-mimo" and "xiaomi-mimo-token-plan" to NAMED_OPENAI_STYLE_PROVIDERS in src/app/api/providers/[id]/models/discovery/providerSets.ts. Live fetch keeps the catalog fresh; the registry seed remains the offline fallback (import never breaks when the upstream is down — covered by the third test).

Testing

New regression test tests/unit/xiaomi-mimo-models-fetch-15307.test.ts (mirrors vercel-gateway-models-fetch-4249.test.ts):

  1. both providers are classified by isNamedOpenAIStyleProvider
  2. xiaomi-mimo import probes https://api.xiaomimimo.com/v1/models and serves the live catalog (source: "api"), including mimo-v2.6-pro
  3. xiaomi-mimo-token-plan import probes https://token-plan-sgp.xiaomimimo.com/v1/models and serves the live catalog
  4. when the upstream fetch fails, import falls back to the local catalog (source: "local_catalog") instead of erroring

All 6 tests in the new file + vercel-gateway-models-fetch-4249.test.ts pass locally (node --test, tsx).

…ken-plan

xiaomi-mimo and xiaomi-mimo-token-plan carry a real registry baseUrl and a
live OpenAI-compatible /v1/models catalog (8 models on the token-plan host,
including mimo-v2.6-pro / mimo-v2.6-flash and the ASR/TTS variants), but were
not classified by any live-fetch branch of the model-import route. Import
never probed the upstream /models and served the 2-entry hardcoded registry
seed with "API unavailable — using local catalog", while inference kept
working through DefaultExecutor.

Same class as diegosouzapw#4249 (vercel-ai-gateway), diegosouzapw#4202 (zenmux) and diegosouzapw#3976
(llm7/byteplus): add both providers to NAMED_OPENAI_STYLE_PROVIDERS so import
fetches the live <baseUrl>/models list, with the registry seed as the offline
fallback.

Closes diegosouzapw#15307

This branch has not been deployed

No deployments
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.

fix(providers): add xiaomi-mimo to NAMED_OPENAI_STYLE_PROVIDERS for live model discovery

1 participant