> ## Documentation Index
> Fetch the complete documentation index at: https://docs.zeroruntime.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Amazon Nova Sonic

> Use Amazon Nova Sonic, a speech-to-speech model, in a Zero Runtime pipeline. Setup and usage in Python and JavaScript.

Amazon Nova Sonic is a **speech-to-speech** model on AWS Bedrock. One model listens, reasons, and talks in real time. It goes in the pipeline's `llm` slot with no separate STT or TTS, and the `Pipeline` auto-detects [Realtime mode](https://docs.zeroruntime.ai/runtime-sdk/build/configure-a-pipeline/modes.md) when you pass it.

## Setup

Set your AWS credentials in the worker environment. Create an access key in the [AWS console](https://console.aws.amazon.com/iam/):

```bash theme={null}
export AWS_ACCESS_KEY_ID=<key>
export AWS_SECRET_ACCESS_KEY=<secret>
export AWS_DEFAULT_REGION=us-east-1
```

## Usage

Pass the realtime model to the pipeline's `llm` slot, no `stt` or `tts` needed.

```python Python theme={null}
from zeroruntime import Pipeline
from zeroruntime.plugins import NovaSonicConfig, NovaSonicRealtime

llm = NovaSonicRealtime(
    region="us-east-1",
    config=NovaSonicConfig(
        voice="tiffany",
    ),
)

pipeline = Pipeline(llm=llm)
```

```typescript Node JS theme={null}
import { Pipeline } from '@zeroruntime/js-sdk';
import { NovaSonicRealtime } from '@zeroruntime/js-sdk/plugins';

const llm = NovaSonicRealtime({
  region: 'us-east-1',
  config: {
    voice: 'tiffany',
  },
});

const pipeline = Pipeline({ llm });
```

## Parameters

*Constructor parameters for `NovaSonicRealtime`.*

| Parameter | Type | Default | Description |
| - | - | - | - |
| `api_key` | `str` | `None` | AWS access key ID. Falls back to the `AWS_ACCESS_KEY_ID` environment variable when unset. The secret key always comes from `AWS_SECRET_ACCESS_KEY`. |
| `region` | `str \| None` | `None` | AWS region hosting Bedrock Nova Sonic, e.g. "us-east-1". |
| `model` | `str` | *required* | Nova Sonic model ID, e.g. "amazon.nova-sonic-v1:0". |
| `config` | `dict \| None` | `None` | Model settings as a dict, such as voice, temperature, top\_p and max\_tokens. |

### `config` keys

`config` takes a `NovaSonicConfig` or a plain dict with the same keys.

| Field | Type | Default | Description |
| - | - | - | - |
| `model_id` | `str` | `"amazon.nova-sonic-v1:0"` | Amazon Bedrock model ID, e.g. 'amazon.nova-sonic-v1:0'. |
| `voice` | `str` | `"tiffany"` | Voice for spoken output, e.g. 'tiffany' or 'matthew'. |
| `temperature` | `float` | `0.7` | Sampling temperature, 0.0 to 1.0; higher values give more varied responses. |
| `top_p` | `float` | `0.9` | Nucleus sampling cutoff, 0.0 to 1.0. |
| `max_tokens` | `int` | `1024` | Maximum number of tokens in each model response. |

To pair the realtime model with an external STT or TTS, see [Hybrid mode](https://docs.zeroruntime.ai/runtime-sdk/build/configure-a-pipeline/modes.md#hybrid). For general plugin concepts, see the [plugins overview](https://docs.zeroruntime.ai/runtime-sdk/plugins/overview.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.