-
Notifications
You must be signed in to change notification settings - Fork 840
feat(auth): add AWS Bedrock Mantle platform support to /login flow #1784
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
nimit2801
wants to merge
3
commits into
MoonshotAI:main
Choose a base branch
from
nimit2801:feat/bedrock-mantle-login
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 2 commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| # AWS Bedrock Mantle with Kimi Code CLI | ||
|
|
||
| Use Kimi models through [Amazon Bedrock Mantle](https://docs.aws.amazon.com/bedrock/latest/userguide/bedrock-mantle.html)’s OpenAI-compatible API. | ||
|
|
||
| ## Quick setup (recommended) | ||
|
|
||
| 1. Create a Bedrock API key in the AWS console. | ||
| 2. Start Kimi Code CLI shell mode and run `/login` (or `/setup`). | ||
| 3. Choose **AWS Bedrock Mantle (OpenAI-compatible)**. | ||
| 4. Pick an AWS Region that supports Mantle and lists the models you need (for Kimi, regions such as `eu-west-2` or `us-east-1` often expose `moonshotai.*` IDs; availability varies by region). | ||
| 5. Paste your API key and select a model (for example `moonshotai.kimi-k2.5`). | ||
|
|
||
| Configuration is written to `~/.kimi/config.toml` under the managed provider `managed:bedrock-mantle`. | ||
|
|
||
| ## Verify (non-interactive) | ||
|
|
||
| ```sh | ||
| kimi --print --prompt "Say hello in one short sentence." | ||
| ``` | ||
|
|
||
| ## Manual configuration | ||
|
|
||
| If you prefer not to use `/login`, use `openai_legacy` with the Mantle `base_url`: | ||
|
|
||
| ```toml | ||
| default_model = "bedrock-mantle/moonshotai.kimi-k2.5" | ||
|
|
||
| [providers."managed:bedrock-mantle"] | ||
| type = "openai_legacy" | ||
| base_url = "https://bedrock-mantle.eu-west-2.api.aws/v1" | ||
| api_key = "ABSK..." | ||
|
|
||
| [models."bedrock-mantle/moonshotai.kimi-k2.5"] | ||
| provider = "managed:bedrock-mantle" | ||
| model = "moonshotai.kimi-k2.5" | ||
| max_context_size = 131072 | ||
| capabilities = ["thinking", "image_in"] | ||
| ``` | ||
|
|
||
| Model alias keys must match what `/login` would generate (`<platform_id>/<model_id>`). | ||
|
|
||
| ## Environment overrides | ||
|
|
||
| For any `openai_legacy` provider, Kimi CLI can override the saved URL and key from the environment: | ||
|
|
||
| - `OPENAI_BASE_URL` — replaces `base_url` when set. | ||
| - `OPENAI_API_KEY` — replaces `api_key` when set. | ||
|
|
||
| These apply per run and are useful for CI or switching regions without editing TOML. | ||
|
|
||
| ## Search and fetch | ||
|
|
||
| Mantle setup does **not** configure Moonshot Search/Fetch. The `SearchWeb` and `FetchURL` tools behave like other non–Kimi Code providers (search unavailable; fetch may fall back locally). Use Kimi Code via `/login` if you need those services. |
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟡 Documentation incorrectly states env overrides apply to
openai_legacyonly, but code also applies them toopenai_responsesThe new documentation in three places claims that
OPENAI_BASE_URLandOPENAI_API_KEYenvironment variable overrides apply exclusively toopenai_legacyproviders. However,src/kimi_cli/llm.py:87showscase "openai_legacy" | "openai_responses":, meaning these env vars also overrideopenai_responsesproviders. The Chinese source-of-truth doc atdocs/zh/configuration/providers.md:71explicitly states 不会影响其他供应商 ("will not affect other providers"), which is factually wrong foropenai_responsesusers. The same incorrect claim appears in the English providers doc andexamples/bedrock-mantle.md:44.Prompt for agents
Was this helpful? React with 👍 or 👎 to provide feedback.