Overview
This plugin allows you to use Amazon Bedrock as an LLM provider for your voice agents.
Installation
Install the plugin from PyPI:
uv add "livekit-agents[aws]~=1.4"
Authentication
The AWS plugin requires AWS credentials. Set the following environment variables in your .env file:
AWS_ACCESS_KEY_ID=<your-aws-access-key-id>AWS_SECRET_ACCESS_KEY=<your-aws-secret-access-key>
Usage
Use Bedrock within an AgentSession or as a standalone LLM service. For example, you can use this LLM in the Voice AI quickstart.
from livekit.plugins import aws# Use default model (Amazon Nova 2 Lite)session = AgentSession(llm=aws.LLM(),# ... tts, stt, vad, turn_handling, etc.)# Or specify a different modelsession = AgentSession(llm=aws.LLM(model="anthropic.claude-3-5-sonnet-20240620-v1:0",temperature=0.8,),# ... tts, stt, vad, turn_handling, etc.)
Parameters
This section describes some of the available parameters. For a complete reference of all available parameters, see the plugin reference.
modelstring | TEXT_MODELDefault: amazon.nova-2-lite-v1:0The model to use for the LLM. For more information, see the documentation for the modelId parameter in the Amazon Bedrock API reference.
regionstringDefault: us-east-1The region to use for AWS API requests.
temperaturefloatSampling temperature that controls the randomness of the model's output. Higher values make the output more random, while lower values make it more focused and deterministic. Range of valid values can vary by model.
Default values vary depending on the model you select. To learn more, see Inference request parameters and response fields for foundation models.
tool_choice[ToolChoice | Literal['auto', 'required', 'none']]Default: autoControls how the model uses tools. String options are as follows:
'auto': Let the model decide.'required': Force tool usage.'none': Disable tool usage.
Amazon Nova Sonic
To use Amazon Nova Sonic on AWS Bedrock, refer to the following integration guide:
Amazon Nova Sonic
Integration guide for the Amazon Nova Sonic speech-to-speech model on AWS Bedrock.
Additional resources
The following links provide more information about the Amazon Bedrock LLM plugin.
Python package
The livekit-plugins-aws package on PyPI.
Plugin reference
Reference for the Amazon Bedrock LLM plugin.
GitHub repo
View the source or contribute to the LiveKit Amazon Bedrock LLM plugin.
Bedrock docs
Amazon Bedrock docs.
Voice AI quickstart
Get started with LiveKit Agents and Amazon Bedrock.
AWS ecosystem guide
Overview of the entire AWS and LiveKit Agents integration.