Skip to content

CTX7-1880: expose AWS Bedrock models in the SDKs and CLI - #206

Open
fahreddinozcan wants to merge 8 commits into
mainfrom
ctx7-1880-bedrock-support-for-box
Open

CTX7-1880: expose AWS Bedrock models in the SDKs and CLI#206
fahreddinozcan wants to merge 8 commits into
mainfrom
ctx7-1880-bedrock-support-for-box

Conversation

@fahreddinozcan

Copy link
Copy Markdown
Contributor

Exposes AWS Bedrock models to SDK/CLI users. Pairs with the box-backend Bedrock provider PR (same branch name).

  • Add BedrockModel enum (Claude Code harness only) to the TS and Python SDKs; values are bedrock/<inference-profile-id> and mirror exactly across both.
  • Allow BedrockModel in the Agent.ClaudeCode harness model union and export it.
  • Route bedrock/ models to the claude-code harness in inferDefaultProvider (TS + Python).
  • Add an "AWS Bedrock" group to the CLI model picker.

Usage: Box.create({ agent: { harness: Agent.ClaudeCode, model: BedrockModel.Claude_Sonnet_4_5, apiKey: "<bedrock-api-key>" } }).

- 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
@linear-code

linear-code Bot commented Jul 28, 2026

Copy link
Copy Markdown

CTX7-1880

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.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 BedrockModel enum 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.

Comment thread packages/sdk/src/types.ts
Grok_4_20_Reasoning = "vercel/xai/grok-4.20-reasoning",
}

export enum BedrockModel {
Comment thread packages/sdk/src/types.ts
| 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)" },
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