Skip to content

Add Native AWS Bedrock Integration (BedrockChat + BedrockEmbedder) #161

@iamgautamraj

Description

@iamgautamraj

Is your feature request related to a problem? Please describe.

Currently, to use AWS Bedrock models (Claude, Llama, Titan, Mistral) with Pathway, users must go through LiteLLM as an intermediary. This adds an extra dependency layer and doesn't leverage AWS-native authentication patterns (IAM roles, environment credentials) that enterprise deployments rely on. For organizations running Pathway on AWS infrastructure (ECS, EKS, Lambda), a native Bedrock integration would provide a more seamless and secure experience.

Describe the solution you'd like

Add two new classes to the LLM xpack:

  1. BedrockChat in llms.py - A wrapper for AWS Bedrock's Converse API that:
  • Supports all Bedrock chat models (Claude, Llama, Titan, Mistral)
  • Uses aioboto3 for async operations
  • Handles AWS credential chain (env vars, IAM roles, explicit config)
  • Converts OpenAI-style messages to Bedrock format
  1. BedrockEmbedder in embedders.py - A wrapper for Bedrock embedding models that:
  • Supports Amazon Titan and Cohere embeddings
  • Handles model-specific request/response formats
  • Supports Titan V2 features (custom dimensions, normalization)n.

Describe alternatives you've considered

  1. Using LiteLLM: Works but adds an extra dependency and doesn't integrate as cleanly with AWS IAM patterns
  2. Using boto3 directly in user code: Requires users to write boilerplate for async handling and message format conversion

Additional context

I have a working implementation with ~600 lines of production code and 54 passing unit tests.

I'm happy to submit a PR with the complete implementation if this feature aligns with Pathway's roadmap.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions