Skip to content

Conversation

@pragyan-amp
Copy link
Contributor

@pragyan-amp pragyan-amp commented Oct 26, 2025

Summary

Adds AWS Bedrock as an LLM provider option alongside Databricks, enabling AWS partnership
opportunities and customer flexibility.

Key Features

  • AWS Bedrock Provider: Full implementation using Converse API for unified access to foundation
    models (Claude, Llama, Titan, Nova)
  • AWS SSO Support: Works with aws sso login and standard boto3 credential chain (env vars, IAM
    roles)
  • Tool Calling: Full support for function calling required by agent workflows
  • Message Translation: Automatic OpenAI ↔ Bedrock Converse API format conversion
  • Factory Integration: Uses existing LLMProviderFactory pattern for provider selection

Configuration

# Option 1: AWS SSO (recommended)
aws sso login --profile your-profile
export AWS_PROFILE=your-profile

# Option 2: Environment variables
export AWS_ACCESS_KEY_ID=xxx
export AWS_SECRET_ACCESS_KEY=xxx
export AWS_REGION=us-east-1

# Set provider in config
chuck_data config set llm_provider aws_bedrock

Testing

  • ✅ 20 new provider tests (initialization, chat, streaming, tool calling, error handling)
  • ✅ All 491 existing tests still passing
  • ✅ Integration validated with all command handlers (scan_pii, bulk_tag_pii, setup_stitch)

What Works

  • Model listing via Bedrock catalog
  • Chat completion with all supported models
  • Tool calling (function definitions and execution)
  • Error handling and validation
  • AWS credential chain (SSO, env vars, IAM roles)

What Doesn't Work Yet

  • Streaming responses (raises NotImplementedError)
  • temperature, max_tokens, top_p parameters (not passed through)
  • Rate limit retry logic
  • Session token authentication

Documentation

  • Complete setup guide in README
  • Provider selection priority documented
  • Model recommendations for tool calling
  • AWS SSO configuration examples

@pragyan-amp pragyan-amp force-pushed the feat/aws-bedrock-provider branch 3 times, most recently from a9ded3f to 4b00114 Compare October 26, 2025 15:09
@pragyan-amp pragyan-amp requested a review from Copilot October 26, 2025 15:15
Copy link

Copilot AI left a comment

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 adds AWS Bedrock as a new LLM provider to the chuck_data project, implementing support for AWS's Converse API to enable interaction with foundation models like Claude, Llama, and Nova. The implementation follows the existing provider pattern and includes comprehensive test coverage.

Key Changes:

  • Added AWSBedrockProvider class implementing the Converse API with tool calling support
  • Added boto3 as an optional dependency under the aws extras group
  • Integrated the new provider into the factory pattern with proper error handling

Reviewed Changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
chuck_data/llm/providers/aws_bedrock.py New AWS Bedrock provider implementation with Converse API support, message/tool conversion, and model listing
chuck_data/llm/providers/init.py Exports the new AWSBedrockProvider class
chuck_data/llm/factory.py Removes f-string prefix from error messages (consistency fix)
pyproject.toml Adds boto3>=1.28.0 as an optional dependency under the aws extras group
tests/unit/llm/test_factory.py Factory tests for AWS Bedrock provider creation and configuration
tests/unit/llm/providers/test_aws_bedrock.py Comprehensive behavioral tests for the AWS Bedrock provider
tests/unit/llm/providers/init.py New test module initialization file

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@pragyan-amp pragyan-amp marked this pull request as ready for review October 26, 2025 16:24
Copy link
Contributor

@punit-naik-amp punit-naik-amp left a comment

Choose a reason for hiding this comment

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

Code changes LGTM. But please document the progress as a video and post in the description if possible.

@pragyan-amp pragyan-amp marked this pull request as draft October 27, 2025 04:26
@pragyan-amp pragyan-amp force-pushed the feat/aws-bedrock-provider branch 2 times, most recently from eab1e7f to a8d34d4 Compare October 29, 2025 06:32
@pragyan-amp pragyan-amp marked this pull request as ready for review October 29, 2025 06:33
@pragyan-amp pragyan-amp force-pushed the feat/aws-bedrock-provider branch 2 times, most recently from ee3a140 to bb30a45 Compare October 31, 2025 12:40
Adds AWS Bedrock LLM provider using the Converse API. This enables using
Bedrock-hosted models (Claude, Llama, Titan) with the existing LLMProvider
interface.

Changes:
- New AWSBedrockProvider implementing LLMProvider protocol
- Translates between OpenAI and Bedrock Converse API formats
- Supports tool calling (required for agent workflows)
- Added boto3 as optional dependency under [aws] group
- Factory integration tests for provider instantiation

The Converse API is AWS's unified interface for tool use across all Bedrock
models. Message and tool format conversion is handled internally to maintain
OpenAI-compatible interface.

Tests: 20 provider tests + 3 factory tests, all passing
@pragyan-amp pragyan-amp force-pushed the feat/aws-bedrock-provider branch from bb30a45 to 54bc590 Compare October 31, 2025 13:42
@pragyan-amp pragyan-amp merged commit 1657dc4 into main Oct 31, 2025
2 checks passed
@pragyan-amp pragyan-amp deleted the feat/aws-bedrock-provider branch October 31, 2025 18:22
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.

3 participants