feat(tui): add OpenAI-compatible provider setup from /provider#1430
Draft
WENGENG-boop wants to merge 1 commit into
Draft
feat(tui): add OpenAI-compatible provider setup from /provider#1430WENGENG-boop wants to merge 1 commit into
WENGENG-boop wants to merge 1 commit into
Conversation
🦋 Changeset detectedLatest commit: 5f133d6 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
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.
Related Issue
No linked issue yet. This PR addresses a provider setup limitation in the native Kimi Code TUI: users can configure custom OpenAI-compatible providers in
config.toml, but the current/providerflow does not provide a native way to enter a provider base URL/API key, discover available models, and make those models available through/model.Problem
OpenAI-compatible third-party providers often expose many models and may change their model list over time. Today, users who want to use those providers need to manually edit configuration, predefine model aliases, and keep those aliases in sync themselves.
That makes the experience especially awkward for users who expect provider setup to stay inside Kimi Code's native terminal UI:
/providercan manage known providers, but not arbitrary OpenAI-compatible endpoints./modelonly shows aliases that were manually configured in advance./effortchoices unless the alias is written with the right thinking metadata.What Changed
This PR adds a native OpenAI-compatible provider setup flow to
/provider.Users can now choose
OpenAI-compatible providerfrom the provider add menu, then enter:After submission, Kimi Code fetches
${baseUrl}/models, creates model aliases automatically, refreshes config, and opens the native model selector with the newly discovered models.The generated provider config uses the existing OpenAI provider type, and generated model aliases use the existing Kimi Code model alias schema. For model ids that look like OpenAI/GPT reasoning models, the aliases include native thinking support so
/effortcan offer:lowmediumhighxhighThe provider manager also now allows single provider rows to be edited with Enter, so users can update an OpenAI-compatible provider's base URL or API key from the native
/providerUI later.Why This Fits Kimi Code
The implementation reuses existing Kimi Code behavior instead of introducing a separate plugin command or a parallel model switching surface:
/modelselector./effortcommand.Checklist
gen-changesetsskill, or this PR needs no changeset.gen-docsskill, or this PR needs no doc update.Test Plan
pnpm --filter @moonshot-ai/kimi-code run typecheck.\node_modules\.bin\vitest.CMD run apps\kimi-code\test\tui\components\dialogs\provider-manager.test.ts/providerwith a real OpenAI-compatible endpoint:${baseUrl}/modelsis fetched successfully./model./effortexposeslow,medium,high, andxhigh.