Skip to content

Add AWS Bedrock authentication support for Anthropic #3

@bheemreddy-samsara

Description

@bheemreddy-samsara

Summary

Add support for AWS Bedrock as an alternative authentication method for Anthropic Claude models. This enables users who have Claude access through AWS Bedrock to use Ash without needing a separate Anthropic API key.

Motivation

  • Users with AWS Bedrock access can leverage their existing AWS credentials
  • Organizations that provision Claude through AWS can use Ash without separate API key management
  • Aligns with how other tools (like Claude Code) support Bedrock authentication

Proposed Configuration

[anthropic]
auth_method = "bedrock"  # "api_key" (default) or "bedrock"
bedrock_region = "us-west-2"  # Required when using Bedrock

[models.default]
provider = "anthropic"
model = "claude-sonnet-4-20250514"  # Standard model names work

Implementation Details

  1. New optional dependency: anthropic[bedrock] for Bedrock client support
  2. Config changes: Add auth_method and bedrock_region to ProviderConfig
  3. Model translation: Map standard Anthropic model names to Bedrock inference profile IDs (e.g., claude-sonnet-4-20250514us.anthropic.claude-sonnet-4-20250514-v1:0)
  4. Authentication flow: When auth_method = "bedrock", use AsyncAnthropicBedrock client with AWS credentials from environment

Installation

pip install 'ash[bedrock]'

Users would configure AWS credentials via standard methods (env vars, ~/.aws/credentials, IAM roles).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions