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
- New optional dependency:
anthropic[bedrock] for Bedrock client support
- Config changes: Add
auth_method and bedrock_region to ProviderConfig
- Model translation: Map standard Anthropic model names to Bedrock inference profile IDs (e.g.,
claude-sonnet-4-20250514 → us.anthropic.claude-sonnet-4-20250514-v1:0)
- 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).