Skip to content

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",
});

GenAIScript supports multiple ways to configure AWS credentials for Bedrock access:

  • AWS_REGION - The AWS region where Bedrock is enabled (e.g., us-east-1, us-west-2)

Choose one of the following authentication methods:

Terminal window
export AWS_ACCESS_KEY_ID="AKIA..."
export AWS_SECRET_ACCESS_KEY="..."
export AWS_SESSION_TOKEN="..." # Optional, for temporary credentials
  • ANTHROPIC_SMALL_FAST_MODEL_AWS_REGION - Override AWS region for small/fast models
  • DISABLE_PROMPT_CACHING - Set to 1 to disable Anthropic prompt caching
  • ANTHROPIC_MODEL - Override the default Anthropic model ID for Bedrock
  1. Enable Bedrock Access

    Request access to Claude models in the Amazon Bedrock console under “Model Access”.

  2. Configure Credentials

    Set up your AWS credentials using one of the methods above. GenAIScript follows the standard AWS credential provider chain.

  3. Set Region

    Configure the AWS region where you have Bedrock access:

    Terminal window
    export AWS_REGION="us-east-1"
  4. Test Configuration

    Terminal window
    genaiscript configure anthropic_bedrock

Aliases

The following model aliases are attempted by default in GenAIScript.

AliasModel identifier
reasoninganthropic.claude-3-7-sonnet-20250219-v1:0:high
reasoning_smallanthropic.claude-3-7-sonnet-20250219-v1:0:low
largeanthropic.claude-3-7-sonnet-20250219-v1:0:0
smallanthropic.claude-3-5-haiku-20241022-v1:0
visionanthropic.claude-3-7-sonnet-20250219-v1:0:0
vision_smallanthropic.claude-3-5-haiku-20241022-v1:0

Limitations

  • logprobs (and top logprobs) ignored
  • Ignore prediction of output tokens
  • topLogprobs