Anthropic Bedrock
The anthropic_bedrock
provider accesses Anthropic models on Amazon Bedrock. You can find the model names in the Anthropic model documentation.
script({ model: "anthropic_bedrock:anthropic.claude-3-sonnet-20240229-v1:0",});
Configuration
Section titled “Configuration”GenAIScript supports multiple ways to configure AWS credentials for Bedrock access:
Required Environment Variables
Section titled “Required Environment Variables”AWS_REGION
- The AWS region where Bedrock is enabled (e.g.,us-east-1
,us-west-2
)
Authentication Options
Section titled “Authentication Options”Choose one of the following authentication methods:
export AWS_ACCESS_KEY_ID="AKIA..."export AWS_SECRET_ACCESS_KEY="..."export AWS_SESSION_TOKEN="..." # Optional, for temporary credentials
export AWS_PROFILE="my-profile"
export AWS_BEARER_TOKEN_BEDROCK="your-bedrock-api-key"
Optional Environment Variables
Section titled “Optional Environment Variables”ANTHROPIC_SMALL_FAST_MODEL_AWS_REGION
- Override AWS region for small/fast modelsDISABLE_PROMPT_CACHING
- Set to1
to disable Anthropic prompt cachingANTHROPIC_MODEL
- Override the default Anthropic model ID for Bedrock
Setup Steps
Section titled “Setup Steps”-
Enable Bedrock Access
Request access to Claude models in the Amazon Bedrock console under “Model Access”.
-
Configure Credentials
Set up your AWS credentials using one of the methods above. GenAIScript follows the standard AWS credential provider chain.
-
Set Region
Configure the AWS region where you have Bedrock access:
Terminal window export AWS_REGION="us-east-1" -
Test Configuration
Terminal window genaiscript configure anthropic_bedrock
Aliases
The following model aliases are attempted by default in GenAIScript.
Alias | Model identifier |
---|---|
reasoning | anthropic.claude-3-7-sonnet-20250219-v1:0:high |
reasoning_small | anthropic.claude-3-7-sonnet-20250219-v1:0:low |
large | anthropic.claude-3-7-sonnet-20250219-v1:0:0 |
small | anthropic.claude-3-5-haiku-20241022-v1:0 |
vision | anthropic.claude-3-7-sonnet-20250219-v1:0:0 |
vision_small | anthropic.claude-3-5-haiku-20241022-v1:0 |
Limitations
- logprobs (and top logprobs) ignored
- Ignore prediction of output tokens
- topLogprobs