Skip to content

feat(byok): add Xiaomi Token Plan AMS and SGP direct BYOK providers#3492

Merged
chrarnoldus merged 3 commits into
mainfrom
feat/xiaomi-token-plan-byok
May 26, 2026
Merged

feat(byok): add Xiaomi Token Plan AMS and SGP direct BYOK providers#3492
chrarnoldus merged 3 commits into
mainfrom
feat/xiaomi-token-plan-byok

Conversation

@kilo-code-bot
Copy link
Copy Markdown
Contributor

@kilo-code-bot kilo-code-bot Bot commented May 26, 2026

Summary

  • Add two new direct BYOK providers: xiaomi-token-plan-ams (Europe) and xiaomi-token-plan-sgp (Singapore), both pointing at Xiaomi's token-plan-*.xiaomimimo.com/v1 OpenAI-compatible endpoints.
  • Share the MiMo model catalog between both regions in xiaomi-token-plan-models.ts. Metadata downloaded from https://models.dev/api.json. The TTS model is intentionally omitted because its output modality is audio and it is not usable through chat completions.
  • Register the new IDs in DirectUserByokInferenceProviderIdSchema, UserByokTestModels, and DIRECT_BYOK_PROVIDERS_META so the BYOK key manager UI surfaces them.

Verification

  • N/A — pre-push checks skipped per request; please run the standard pnpm checks before merge.

Visual Changes

N/A — no UI surface changes beyond two extra entries in the existing BYOK provider dropdown sourced from DIRECT_BYOK_PROVIDERS_META.

Reviewer Notes

  • transformRequest is a no-op for these providers; we did not add a vendor-specific thinking flag (unlike byteplus-coding/kimi-coding) because Xiaomi's docs were not consulted to confirm that field. Reasoning is exposed via REASONING_VARIANTS_BINARY so users can toggle on/off through the standard variant mechanism.
  • Models with image input modality (mimo-v2.5, mimo-v2-omni) are flagged vision. mimo-v2.5 and mimo-v2.5-pro are flagged recommended.
  • Test model for both providers is mimo-v2-flash.

Adds two new direct BYOK providers for Xiaomi's MiMo Token Plan endpoints
(Europe/Amsterdam and Singapore). Both regions expose the same MiMo model
lineup, so the model definitions are shared between them.

Metadata sourced from https://models.dev/api.json. The TTS model is omitted
since it is audio-output only and not usable through chat completions.
@kilo-code-bot
Copy link
Copy Markdown
Contributor Author

kilo-code-bot Bot commented May 26, 2026

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Executive Summary

All three commits reviewed: initial provider registration, models.dev sync refactor, and a cosmetic label update ('Xiaomi''Xiaomi (pay as you go)') to distinguish the existing BYOK provider from the new Token Plan entries. No bugs, security issues, or logic errors found across any commit.

Files Reviewed (7 files)
  • apps/web/src/lib/ai-gateway/providers/direct-byok/xiaomi-token-plan-ams.ts — refactored to cachedEnhancedDirectByokModelList
  • apps/web/src/lib/ai-gateway/providers/direct-byok/xiaomi-token-plan-sgp.ts — refactored to cachedEnhancedDirectByokModelList
  • apps/web/src/lib/ai-gateway/providers/direct-byok/xiaomi-token-plan-models.ts — deleted (replaced by dynamic fetch)
  • apps/web/src/lib/ai-gateway/providers/direct-byok/sync-direct-byok.ts — added modelsDevFetcher entries for both providers
  • apps/web/src/lib/ai-gateway/providers/direct-byok/direct-byok-definitions.ts — registration (unchanged from first commit)
  • apps/web/src/lib/ai-gateway/providers/openrouter/inference-provider-id.ts — schema + test models (unchanged from first commit)
  • apps/web/src/components/organizations/byok/BYOKKeysManager.tsx — label updated to 'Xiaomi (pay as you go)'

Fix these issues in Kilo Cloud


Reviewed by claude-4.6-sonnet-20260217 · 187,277 tokens

Review guidance: REVIEW.md from base branch main

kilo-code-bot Bot added 2 commits May 26, 2026 14:52
Replace the hardcoded MiMo model list with the standard
`cachedEnhancedDirectByokModelList` + `modelsDevFetcher` flow used by
zai-coding and ollama-cloud, so the catalog stays in sync with
models.dev instead of drifting against an inline copy.
Mirror the Z.ai labelling so users can distinguish the existing pay-as-you-go
Xiaomi BYOK option from the new Xiaomi Token Plan (AMS/SGP) providers.
@chrarnoldus chrarnoldus merged commit abb13d7 into main May 26, 2026
13 checks passed
@chrarnoldus chrarnoldus deleted the feat/xiaomi-token-plan-byok branch May 26, 2026 15:29
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.

2 participants