PARAS MADAN
All writing

Latest in AI

Kimi Code on Bedrock: Migrate to AWS Profiles Without Losing Your Configuration

Kimi Code CLI 2.7 adds native Bedrock authentication. Check credential precedence, explicit Regions and real requests before switching your default model.

Kimi Code CLI 2.7.0 adds a native Bedrock provider that can use AWS profiles and SSO instead of a separately managed Bedrock API key. The practical migration is not simply changing a provider name. You need to know which identity wins, where the request enters AWS and whether a real model call works.

The November 19 AWS walkthrough introduces the credential-chain path. Treat it as a separate configuration change from upgrading your model. Keeping those changes apart makes a failed migration much easier to diagnose.

Preserve the working setup first

Before editing anything, record the existing provider, model alias and installation version. Keep a local backup of the configuration, taking the same care with that backup as with the original if it contains credentials. Do not paste either file into a support thread.

The official installation guide documents kimi --version, kimi upgrade and the npm package @moonshot-ai/kimi-code. Its npm installation requires Node.js 22.19.0 or later. Configuration normally lives under ~/.kimi-code/; KIMI_CODE_HOME changes that location.

Confirm that the executable you actually launch is version 2.7.0 or later. A successful package upgrade is not the same as confirming that your terminal is using the upgraded executable.

For a team rollout, start with one developer and one small repository. Leave the previous configuration available until the new path has passed your checks, rather than making everyone troubleshoot an authentication change together.

Make the credential choice deliberate

Moonshot's provider reference in the repository documents the native bedrock provider. A configured api_key, api_key_env or provider-level AWS_BEARER_TOKEN_BEDROCK takes precedence over ambient AWS credentials. Remove that override from the new provider when the intention is to use the credential chain.

That does not mean deleting an organization-wide credential or changing unrelated providers. Inspect the specific entry being migrated. Otherwise, a working request might still be using the old key, leaving you with a false impression that SSO has been validated.

The same reference requires AWS_REGION or AWS_DEFAULT_REGION, either in the provider environment or the shell. It does not currently infer the Region from ~/.aws/config. Selecting a named profile is therefore not enough on its own.

Add a separate model alias

Merge this example into the active configuration rather than replacing the whole file. Replace both placeholders with your approved profile and supported source Region:

[providers.bedrock]
type = "bedrock"

[providers.bedrock.env]
AWS_REGION = "YOUR_SOURCE_REGION"
AWS_PROFILE = "YOUR_PROFILE_NAME"

[models.bedrock-kimi-k3-1]
provider = "bedrock"
model = "global.moonshotai.kimi-k3.1"
max_context_size = 1000000
capabilities = ["always_thinking", "thinking", "image_in", "tool_use"]

AWS uses this model and capability combination in its walkthrough. The source Region selects the receiving endpoint; the global inference profile is a separate routing choice. Do not copy a global profile into a workload that requires a narrower processing boundary without reviewing that requirement.

Keep your current default initially. An explicit alias makes the trial visible and reduces the chance that an unrelated session silently becomes part of the migration.

Verify a request, not a status badge

AWS warns that a connected indicator is not proof of successful authentication, authorization, model access or network connectivity. Start with a small request in a disposable directory:

kimi --model bedrock-kimi-k3-1 --prompt "Explain integer division in Python in two sentences. Do not use tools."

Review the resulting response and any error before trying repository work. This isolates basic inference from file permissions, shell commands and project-specific instructions.

Then introduce one modest task, such as explaining a short source file. Compare the answer against the file yourself. Only after that should you try a proposed edit and review its diff. Authentication success and useful coding behavior deserve separate acceptance checks.

Diagnose one layer at a time

Use a small migration record rather than repeatedly changing settings until something works:

CheckRecord
ExecutableVersion used by this terminal
IdentityIntended AWS profile and account
RoutingSource Region and inference profile
RequestSelected alias and exact error, if any
Coding taskReviewed explanation or diff

If the basic request fails, preserve its error and inspect the corresponding layer. Do not respond to every failure by granting broader permissions or switching to a long-lived key. If basic inference works but the repository task fails, investigate that task separately before undoing authentication.

Once the checks pass, make the new alias your default and document the rollback. A good migration ends with a configuration the next developer can understand, not just a terminal that happened to return an answer.

I'm Paras. I work at the intersection of AI, engineering and distribution.

I help AI teams explain technical products through clear documentation, practical guides and developer-focused content.

Book a 30-minute call.