feat(providers): add AWS Bedrock provider#1903
Conversation
There was a problem hiding this comment.
Pull request overview
Adds AWS Bedrock as a new LLM provider (Converse API) behind a bedrock build tag, wiring it into the provider factory and documenting configuration.
Changes:
- Add
bedrockprotocol handling inCreateProviderFromConfig(region viaapi_base, AWS SDK credentials chain). - Implement Bedrock provider (Converse API) plus a non-tag stub provider that errors with build-tag guidance.
- Update docs and Go module dependencies for AWS SDK v2 Bedrock Runtime.
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/providers/factory_provider.go | Adds bedrock protocol branch to provider factory (region/options + provider initialization). |
| pkg/providers/bedrock/provider_stub.go | Stub implementation for non-bedrock builds (returns build-tag error). |
| pkg/providers/bedrock/provider_bedrock.go | Real Bedrock provider implementation using AWS SDK v2 Converse API. |
| go.mod | Adds AWS SDK v2 dependencies needed for Bedrock Runtime client. |
| go.sum | Adds checksums for newly introduced AWS SDK modules. |
| README.md | Documents Bedrock provider, build tag requirement, and region configuration. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Add AWS Bedrock provider using the Converse API with: - Full tool/function calling support - Image handling with proper base64 decoding - Build tag gating (-tags bedrock) - Comprehensive test coverage - Timeout protection for AWS credential resolution Addresses PR sipeed#1903 Copilot review feedback.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 7 out of 8 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Add AWS Bedrock provider using the Converse API with: - Full tool/function calling support - Image handling with proper base64 decoding - Build tag gating (-tags bedrock) - Comprehensive test coverage - Timeout protection for AWS credential resolution - Uses shared common.AsInt/AsFloat helpers Addresses PR sipeed#1903 Copilot review feedback.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 7 out of 8 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Add AWS Bedrock provider using the Converse API with: - Full tool/function calling support - Image handling with proper base64 decoding and size limits - Build tag gating (-tags bedrock) - Comprehensive test coverage - Timeout protection for AWS credential resolution - Uses shared common.AsInt/AsFloat helpers - Region validation (rejects URLs in api_base) Addresses PR sipeed#1903 Copilot review feedback.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 7 out of 8 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Add AWS Bedrock provider using the Converse API with: - Full tool/function calling support with Function fallback - Image handling with proper base64 decoding and size limits - Build tag gating (-tags bedrock) - Comprehensive test coverage - Timeout protection for AWS credential resolution - Uses shared common.AsInt/AsFloat helpers - Region validation (rejects URLs in api_base) Addresses PR sipeed#1903 Copilot review feedback.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 7 out of 8 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Add AWS Bedrock provider using the Converse API with: - Full tool/function calling support with Function fallback - Image handling with proper base64 decoding and size limits - Build tag gating (-tags bedrock) - Comprehensive test coverage including factory tests - Timeout protection for AWS credential resolution - Uses shared common.AsInt/AsFloat helpers - Region validation (rejects URLs in api_base) Addresses PR sipeed#1903 Copilot review feedback.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 9 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Add AWS Bedrock provider using the Converse API with: - Full tool/function calling support with Function fallback - Image handling with proper base64 decoding and size limits - Build tag gating (-tags bedrock) - Comprehensive test coverage including factory tests - Timeout protection for AWS credential resolution - Uses shared common.AsInt/AsFloat helpers - Proper endpoint configuration via api_base (URL or region name) - Only sets ToolConfig when valid tools are present - Consistent build-tag error messages in stub - Region validation on provider creation - Deterministic factory tests with dummy AWS env vars api_base supports both: - Region name: us-east-1 (sets both region and endpoint) - Full endpoint URL (requires AWS_REGION separately) Addresses PR sipeed#1903 Copilot review feedback.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 9 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Add AWS Bedrock provider using the Converse API with: - Full tool/function calling support with Function fallback - Image handling with proper base64 decoding and size limits - Build tag gating (-tags bedrock) - Comprehensive test coverage including factory tests - Timeout protection for AWS credential resolution - Uses shared common.AsInt/AsFloat helpers - Proper endpoint configuration via api_base (URL or region name) - Only sets ToolConfig when valid tools are present - Consistent build-tag error messages in stub - Region validation on provider creation - Deterministic factory tests with dummy AWS env vars - AWS SDK endpoint resolution for all partitions (aws, aws-cn, aws-us-gov) api_base supports both: - Region name: us-east-1 (AWS SDK resolves endpoint for all partitions) - Full endpoint URL (for custom endpoints or testing) Addresses PR sipeed#1903 Copilot review feedback.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 9 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 9 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 9 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 9 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 9 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 9 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 9 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@jmahotiedu @Leeaandrob @shresthapranesh with #213 landed added AWS Bedrock support. Tested with different models in different AWS regions, also went through several Copilot review iterations to align with existing code. Please consider reviewing / merging, thanks for this awesome project! |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 9 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 9 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 9 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 9 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 9 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Add support for AWS Bedrock as an LLM provider using the Converse API. The implementation is behind a build tag (-tags bedrock) to keep the default binary size small. Features: - AWS SDK v2 with automatic credential chain (env vars, profiles, IAM roles) - Converse API for unified access to Claude, Llama, Mistral models - Tool/function calling support with proper document handling - Image support with base64 decoding and size limits - Request timeout configuration - Region validation and endpoint resolution for all AWS partitions Usage: go build -tags bedrock model: bedrock/us.anthropic.claude-sonnet-4-20250514-v1:0 api_base: us-east-1 (or full endpoint URL)
yinwm
left a comment
There was a problem hiding this comment.
LGTM!
Review Summary:
- Clean implementation with proper build tag separation ( / )
- AWS SDK v2 integration with automatic credential chain
- Excellent test coverage (~95%) including edge cases
- Correct handling of Bedrock-specific requirements (tool results merging)
- All CI checks passed
Minor notes (non-blocking):
- Binary size increases ~10MB when built with (expected for AWS SDK)
- Consider returning error instead of silent skip for oversized images (future improvement)
Thanks for the contribution!
yinwm
left a comment
There was a problem hiding this comment.
LGTM!
Review Summary:
- Clean implementation with proper build tag separation
- AWS SDK v2 integration with automatic credential chain
- Excellent test coverage (~95%) including edge cases
- Correct handling of Bedrock-specific requirements (tool results merging)
- All CI checks passed
Minor notes (non-blocking):
- Binary size increases ~10MB when built with bedrock tag (expected for AWS SDK)
- Consider returning error instead of silent skip for oversized images (future improvement)
Thanks for the contribution!
|
@loafoe Awesome work bringing AWS Bedrock support to PicoClaw! Using the Converse API and keeping it behind a build tag to avoid bloating the binary is a thoughtful design choice. Testing on both Mac and Raspberry Pi is a nice touch too. This has been requested since #283, so a lot of users will appreciate it. We have a PicoClaw Dev Group on Discord where contributors connect and collaborate. If you'd like to join, send an email to |
📝 Description
Add support for AWS Bedrock as an LLM provider using the Converse API. The provider is behind a build tag to keep binary size small.
🗣️ Type of Change
🤖 AI Code Generation
🔗 Related Issue
Refs #283
Implements #252
📚 Technical Context (Skip for Docs)
Example config:
{"model": "bedrock/us.anthropic.claude-opus-4-5-20251101-v1:0", "api_base": "us-east-1"}🧪 Test Environment
☑️ Checklist