CTX7-1880: expose AWS Bedrock models in the SDKs and CLI - #206
Open
fahreddinozcan wants to merge 8 commits into
Open
CTX7-1880: expose AWS Bedrock models in the SDKs and CLI#206fahreddinozcan wants to merge 8 commits into
fahreddinozcan wants to merge 8 commits into
Conversation
- add BedrockModel enum (Claude Code harness only) to the TS and Python SDKs, values are bedrock/<inference-profile-id> - allow BedrockModel in the ClaudeCode harness model union and export it - route bedrock/ models to the claude-code harness in inferDefaultProvider - add a Bedrock group to the CLI model picker
Replace the 3-model placeholder with the 10 Claude models that have active global cross-region inference profiles on Bedrock and invoke cleanly (verified via bedrock-runtime converse): Opus 5/4.8/4.7/4.6/4.5, Sonnet 5/4.6/4.5/4, Haiku 4.5. Dropped claude-fable-5 (requires a non-default data-retention mode).
Add BedrockModel to the OpenCode harness model union and a Bedrock group to the OpenCode CLI model picker.
There was a problem hiding this comment.
Pull request overview
This PR exposes AWS Bedrock model identifiers across the TypeScript SDK, Python SDK, and CLI so users can select bedrock/… models and have them routed to the Claude Code harness by default.
Changes:
- Added a
BedrockModelenum to the TS SDK and Python SDK and exported it publicly. - Extended agent model unions and default-provider inference to recognize
bedrock/model prefixes (TS + Python). - Added an “AWS Bedrock” group to the CLI model picker for Claude Code and OpenCode agents.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/sdk/src/types.ts | Adds BedrockModel and allows it in relevant model unions. |
| packages/sdk/src/index.ts | Re-exports BedrockModel from the SDK entrypoint. |
| packages/sdk/src/client.ts | Routes bedrock/ model prefixes to the Claude Code harness in inferDefaultProvider. |
| packages/python-sdk/upstash_box/types.py | Adds Python BedrockModel enum mirroring the TS values. |
| packages/python-sdk/upstash_box/_common.py | Routes bedrock/ model prefixes to Claude Code in infer_default_provider. |
| packages/python-sdk/upstash_box/init.py | Exposes BedrockModel from the Python package top-level exports. |
| packages/cli/src/models.ts | Adds “AWS Bedrock” model groups to the interactive model picker. |
Suppressed comments (1)
packages/cli/src/models.ts:229
- This "AWS Bedrock" group duplicates the earlier Bedrock group for Agent.ClaudeCode; maintaining two copies makes it easy for one to become stale.
{
label: "AWS Bedrock",
options: [
{ value: BedrockModel.Opus_5, label: "Claude Opus 5 (Bedrock)" },
{ value: BedrockModel.Opus_4_8, label: "Claude Opus 4.8 (Bedrock)" },
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| Grok_4_20_Reasoning = "vercel/xai/grok-4.20-reasoning", | ||
| } | ||
|
|
||
| export enum BedrockModel { |
| | OpenAICodex | ||
| | OpenRouterModel | ||
| | VercelModel | ||
| | BedrockModel; |
Comment on lines
91
to
94
| export function inferDefaultProvider(model: string): Agent { | ||
| if (model.startsWith("custom/")) return Agent.Custom; | ||
| if (model.startsWith("bedrock/")) return Agent.ClaudeCode; | ||
| if (model.startsWith("cursor/")) return Agent.Cursor; |
Comment on lines
88
to
+93
| def infer_default_provider(model: str) -> Agent: | ||
| """Infer the default harness from a model string prefix.""" | ||
| if model.startswith("custom/"): | ||
| return Agent.CUSTOM | ||
| if model.startswith("bedrock/"): | ||
| return Agent.CLAUDE_CODE |
Comment on lines
+66
to
+70
| { | ||
| label: "AWS Bedrock", | ||
| options: [ | ||
| { value: BedrockModel.Opus_5, label: "Claude Opus 5 (Bedrock)" }, | ||
| { value: BedrockModel.Opus_4_8, label: "Claude Opus 4.8 (Bedrock)" }, |
Comment on lines
+66
to
+70
| { | ||
| label: "AWS Bedrock", | ||
| options: [ | ||
| { value: BedrockModel.Opus_5, label: "Claude Opus 5 (Bedrock)" }, | ||
| { value: BedrockModel.Opus_4_8, label: "Claude Opus 4.8 (Bedrock)" }, |
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.
Exposes AWS Bedrock models to SDK/CLI users. Pairs with the box-backend Bedrock provider PR (same branch name).
BedrockModelenum (Claude Code harness only) to the TS and Python SDKs; values arebedrock/<inference-profile-id>and mirror exactly across both.BedrockModelin theAgent.ClaudeCodeharness model union and export it.bedrock/models to the claude-code harness ininferDefaultProvider(TS + Python).Usage:
Box.create({ agent: { harness: Agent.ClaudeCode, model: BedrockModel.Claude_Sonnet_4_5, apiKey: "<bedrock-api-key>" } }).