Default model changed to Nova 2 Sonic: RealtimeModel() now defaults to amazon.nova-2-sonic-v1:0 with modalities="mixed" (was amazon.nova-sonic-v1:0 with modalities="audio").
If you need the previous behavior, explicitly specify Nova Sonic 1.0:
model = aws.realtime.RealtimeModel.with_nova_sonic_1()
# or
model = aws.realtime.RealtimeModel(
model="amazon.nova-sonic-v1:0",
modalities="audio"
)
Installation
pip install livekit-plugins-aws
# For Nova Sonic realtime models
pip install livekit-plugins-aws[realtime]
Prerequisites
AWS Credentials
You'll need AWS credentials with access to Amazon Bedrock. Set them as environment variables:
export AWS_ACCESS_KEY_ID=<your-access-key>
export AWS_SECRET_ACCESS_KEY=<your-secret-key>
export AWS_DEFAULT_REGION=us-east-1 # or your preferred region
Getting Temporary Credentials from SSO (Local Testing)
If you use AWS SSO for authentication, get temporary credentials for local testing:
# Login to your SSO profile
aws sso login --profile your-profile-name
# Export credentials from your SSO session
eval $(aws configure export-credentials --profile your-profile-name --format env)
# Verify credentials are set
aws sts get-caller-identity
Alternatively, add this to your shell profile for automatic credential export:
# Add to ~/.bashrc or ~/.zshrc
function aws-creds() {
eval $(aws configure export-credentials --profile $1 --format env)
}
# Usage: aws-creds your-profile-name
Features
Nova 2 Sonic Capabilities
Amazon Nova 2 Sonic is a unified speech-to-speech foundation model that delivers:
Multilingual support - English, French, Italian, German, Spanish, Portuguese, and Hindi
Automatic language mirroring - Responds in the user's spoken language
Polyglot voices - Matthew and Tiffany can seamlessly switch between languages within a single conversation, ideal for multilingual applications
18 expressive voices - Multiple voices per language with natural prosody
Function calling - Built-in tool use and agentic workflows
Interruption handling - Graceful handling without losing context
Noise robustness - Works in real-world environments
Text input support - Programmatic text prompting
Model Selection
from livekit.plugins import aws
# Nova 2.5 Sonic (audio + text input, latest)
model = aws.realtime.RealtimeModel.with_nova_sonic_2_5()
# Nova 2 Sonic (audio + text input, default)
model = aws.realtime.RealtimeModel.with_nova_sonic_2()
# Nova Sonic 1.0 (audio-only, original model)
model = aws.realtime.RealtimeModel.with_nova_sonic_1()
Voice Selection
Voices are specified as lowercase strings. Import SONIC1_VOICES or SONIC2_VOICES type hints for IDE autocomplete.
from livekit.plugins.aws.experimental.realtime import SONIC2_VOICES
model = aws.realtime.RealtimeModel.with_nova_sonic_2(
voice="carolina" # Portuguese, feminine
)
Nova 2 Sonic supports programmatic text input. This can be used to trigger agent responses or to mix speech and text input within a UI in the same conversation:
class Assistant(Agent):
async def on_enter(self):
# Make the agent speak first with a greeting
await self.session.generate_reply(
instructions="Greet the user and introduce your capabilities"
)
instructions vs user_input
The generate_reply() method accepts two parameters with different behaviors: