Store Chat Messages & State Without Managing Infrastructure.Check Out DialogueDB
Skip to content

Anthropic

When using Anthropic models via AWS Bedrock, llm-exe will make POST requests to https://bedrock-runtime.us-west-2.amazonaws.com/model/{MODEL_ID}/invoke.

Setup

Anthropic Chat

ts
const llm = useLlm("amazon:anthropic.chat.v1", {
  model: "anthropic.claude-sonnet-4-v2:0",  // This is the model id from Bedrock
});

Bedrock Anthropic Options

In addition to the generic options, the following options are available for Anthropic models on Bedrock.

OptionTypeDefaultDescription
modelstringThe Bedrock model id. Must be specified. See AWS Bedrock Docs
maxTokensnumber10000Maps to max_tokens. See Anthropic Docs
topPnumberundefinedMaps to top_p. See Anthropic Docs
awsRegionstringundefinedAWS Region. Can be set via AWS_REGION environment variable
awsSecretKeystringundefinedAWS Secret Key. Can be set via AWS_SECRET_ACCESS_KEY environment variable
awsAccessKeystringundefinedAWS Access Key. Can be set via AWS_ACCESS_KEY_ID environment variable

NOTE

The Bedrock Anthropic provider maps a subset of the direct Anthropic provider options. Options like temperature, topK, stopSequences, metadata, and serviceTier are not mapped for the Bedrock variant at this time.