Skip to main content
Use AWS Bedrock to access various foundation models on AWS. Manage your access to models on the portal. See all the AWS Bedrock foundational models. Not all Bedrock models support all features. See the supported features for each model. We recommend experimenting to find the best-suited model for your use-case. Here are some general recommendations:
  • For a Mistral model with generally good performance, look at mistral.mistral-large-2402-v1:0.
  • You can play with Amazon Nova models. Use amazon.nova-pro-v1:0 for general purpose tasks.
  • For Claude models, see our Claude integration.
Async usage of AWS Bedrock is not yet supported. When using AwsBedrock with an Agent, you can only use agent.run and agent.print_response.

Authentication

Set your AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY and AWS_REGION environment variables. Get your keys from here.
export AWS_ACCESS_KEY_ID=***
export AWS_SECRET_ACCESS_KEY=***
export AWS_REGION=***

Example

Use AwsBedrock with your Agent:
from agno.agent import Agent
from agno.models.aws import AwsBedrock

agent = Agent(
    model=AwsBedrock(id="mistral.mistral-large-2402-v1:0"),
    markdown=True
)

# Print the response on the terminal
agent.print_response("Share a 2 sentence horror story.")
View more examples here.

Parameters

ParameterTypeDefaultDescription
idstr"mistral.mistral-small-2402-v1:0"The specific model ID used for generating responses.
namestr"AwsBedrock"The name identifier for the AWS Bedrock agent.
providerstr"AwsBedrock"The provider of the model.
aws_sso_authOptional[bool]FalseRemove the need for access and secret keys by leveraging the current profile’s authentication.
aws_regionOptional[str]NoneThe AWS region to use for API requests.
aws_access_key_idOptional[str]NoneThe AWS access key ID to use for authentication.
aws_secret_access_keyOptional[str]NoneThe AWS secret access key to use for authentication.
sessionOptional[Session]NoneA boto3 Session object to use for authentication.
max_tokensOptional[int]NoneThe maximum number of tokens to generate in the response.
temperatureOptional[float]NoneThe sampling temperature to use, between 0 and 2. Higher values like 0.8 make the output more random, while lower values like 0.2 make it more focused and deterministic.
top_pOptional[float]NoneThe nucleus sampling parameter. The model considers the results of the tokens with top_p probability mass.
stop_sequencesOptional[List[str]]NoneA list of sequences where the API will stop generating further tokens.
request_paramsOptional[Dict[str, Any]]NoneAdditional parameters for the request, provided as a dictionary.
client_paramsOptional[Dict[str, Any]]NoneAdditional client parameters for initializing the AwsBedrock client, provided as a dictionary.
clientOptional[AwsClient]NoneA pre-configured AWS client instance.
AwsBedrock is a subclass of the Model class and has access to the same params.
I