Skip to content

Conversation

@anwschne
Copy link

@anwschne anwschne commented Oct 14, 2025

Summary

Implements AWS Bedrock integration for Qwen3-Coder models using the Converse API.

This PR adds native Amazon Bedrock authentication support, allowing users to leverage Qwen models through AWS infrastructure with standard AWS credential chains.

Changes

  • Provider Implementation: Add BedrockOpenAICompatibleProvider with full OpenAI-to-Bedrock format conversion
  • AWS Integration: Support complete AWS credential chain (profiles, env vars, IAM roles)
  • Model Support:
    • qwen.qwen3-coder-30b-a3b-v1:0 (Qwen3-Coder-30B-A3B-Instruct)
    • qwen.qwen3-32b-v1:0 (Qwen3 32B dense model)
  • Documentation: Add comprehensive setup guide in docs/cli/bedrock.md
  • Testing: 72 new unit tests covering all conversion paths and edge cases

Test Plan

  • All existing tests pass (1958 tests)
  • New Bedrock provider tests pass (72 tests)
  • Lint and format checks pass
  • Manual testing with real AWS Bedrock API
  • Verified default model and environment variable overrides
  • Verified model name mapping (short names → full Bedrock IDs)

Configuration Example

{
  "authType": "bedrock",
  "model": "qwen.qwen3-coder-30b-a3b-v1:0"
}

export AWS_PROFILE=my-profile
export AWS_REGION=us-east-1

Fixes #759

@github-actions github-actions bot added enhancement priority/P1 High priority issue type/feature-request New feature or enhancement request and removed enhancement labels Oct 14, 2025
@github-actions github-actions bot added the category/integration External integrations label Oct 21, 2025
@lucidfrontier45
Copy link

@anwschne
Hi. I appreciate so much this implementation.
I tested it and I confirmed it works.
However I have to directly write qwen.qwen3-coder-30b-a3b-v1:0 or qwen.qwen3-coder-480b-a35b-v1:0 inside .qwen/settings.json.

{
  "authType": "bedrock",
  "model": "qwen.qwen3-coder-30b-a3b-v1:0"
}

This is not the same as your configuration example.

@anwschne
Copy link
Author

Thanks @lucidfrontier45 ! I decided the refactor and remove the short names as it just adds confusion. PR updated

},
},
},
} as OpenAI;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Wow, glad we do not use any other api of the OpenAI client.
But this hints to me that maybe we should use a duck type that requires only the APIs we actually use.

Copy link
Collaborator

@Mingholy Mingholy left a comment

Choose a reason for hiding this comment

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

I suggest that we put all the bedrock-specific provider/converts to /provider/bedrock with a barrel file.
Everything else is fine.

@anwschne
Copy link
Author

I suggest that we put all the bedrock-specific provider/converts to /provider/bedrock with a barrel file. Everything else is fine.

Changes applied, thanks @Mingholy !

@anwschne anwschne requested a review from Mingholy October 22, 2025 03:54
Copy link
Collaborator

@Mingholy Mingholy left a comment

Choose a reason for hiding this comment

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

LGTM!

@anwschne anwschne force-pushed the feat/bedrock-provider-support branch from abb0b86 to 30fb0e9 Compare October 23, 2025 10:53
Implements AWS Bedrock integration for Qwen3-Coder models using the Converse API.

- Add BedrockOpenAICompatibleProvider with full OpenAI format conversion
- Support AWS credential chain (profiles, env vars, instance roles)
- Add comprehensive test coverage (72 tests)
- Add docs/cli/bedrock.md documentation
- Update model mappings to use actual Bedrock model IDs

Fixes QwenLM#759
…k model IDs

- Remove BEDROCK_MODEL_MAP and simplify getBedrockModelId()
- Update default model to use full Bedrock ID: qwen.qwen3-coder-30b-a3b-v1:0
- Update documentation to list models by region (us-east-1, us-west-2)
- Add 480B and 235B models available in us-west-2
- Update all tests to use full Bedrock model IDs
- Add note that model shortcuts are not supported
Move all Bedrock-specific provider files into provider/bedrock subdirectory
with a barrel export file for better code organization and modularity.

- Create provider/bedrock directory structure
- Move bedrock.ts → bedrock/provider.ts
- Move bedrockTypes.ts → bedrock/types.ts
- Move bedrockConverter.ts → bedrock/converter.ts
- Move test files to bedrock/ subdirectory
- Add barrel file (index.ts) for clean exports
- Update all import paths throughout codebase
- Apply Prettier formatting to documentation and tests

All 2728 tests passing (2703 core + 25 VSCode)
ESLint passing with 0 warnings
@anwschne anwschne force-pushed the feat/bedrock-provider-support branch from 30fb0e9 to 0fc07b9 Compare October 27, 2025 02:56
@anwschne
Copy link
Author

Fixed conflicts from recent merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category/integration External integrations priority/P1 High priority issue type/feature-request New feature or enhancement request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Native Amazon Bedrock Support

3 participants