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

# Set up Atoti Intelligence to use Amazon Bedrock in Python

> How to configure Amazon Bedrock as the LLM provider for Atoti Intelligence in an Atoti Python project, using `ConnectionConfig` and `ChatConfig` from `atoti_ai_amazon_bedrock` with `AiConfig`.

> [!NOTE]
>
> ### Atoti Intelligence Essentials
>
> This is part of the Atoti Intelligence Essentials offer.

This guide explains how to configure Amazon Bedrock as the LLM provider for Atoti Intelligence in an Atoti Python project.

## Prerequisites

Before configuring Amazon Bedrock, ensure the following requirements are met:

* An Atoti Python project
* An AWS account with Amazon Bedrock access and appropriate permissions
* The AWS region where Bedrock models are available

## Install the package

```bash theme={"languages":{"custom":["/engine/python-sdk/6.2/languages/pycon.tmLanguage.json"]}}
uv add "atoti[ai-amazon-bedrock]"
```

## Configure the LLM

Use [`ConnectionConfig`](https://docs.activeviam.com/engine/python-sdk/latest/api/atoti_ai_amazon_bedrock.ConnectionConfig) and [`ChatConfig`](https://docs.activeviam.com/engine/python-sdk/latest/api/atoti_ai_amazon_bedrock.ChatConfig) from `atoti_ai_amazon_bedrock` to configure the LLM connection, then pass them to [`AiConfig`](https://docs.activeviam.com/engine/python-sdk/latest/api/atoti_ai.config.AiConfig):

```python theme={"languages":{"custom":["/engine/python-sdk/6.2/languages/pycon.tmLanguage.json"]}}
import atoti as tt
import os
from atoti_ai import AiConfig
from atoti_ai_amazon_bedrock import ConnectionConfig, ChatConfig
connection_config = ConnectionConfig(
    aws_access_key=os.environ["AWS_ACCESS_KEY_ID"],
    aws_secret_key=os.environ["AWS_SECRET_ACCESS_KEY"],
    aws_region="eu-west-3",
)
chat_config = ChatConfig(
    model="eu.anthropic.claude-sonnet-4-6",
)
ai_config = AiConfig(connection=connection_config, chat=chat_config)
session_config = tt.SessionConfig(ai=ai_config)
```

Then pass the config to the session through [`SessionConfig`](https://docs.activeviam.com/engine/python-sdk/latest/api/atoti.config.SessionConfig):

```python theme={"languages":{"custom":["/engine/python-sdk/6.2/languages/pycon.tmLanguage.json"]}}
session = tt.Session.start(tt.SessionConfig(ai=ai_config))
```

### `ConnectionConfig` parameters

| Parameter | Type | Required | Description |
| - | - | - | - |
| `async_read_timeout` | `Duration` | No | Timeout for reading asynchronous responses. |
| `aws_access_key` | `str` | No | AWS access key ID for authentication. |
| `aws_region` | `str` | No | AWS region where Bedrock models are available (for example, `eu-west-3`). |
| `aws_secret_key` | `RedactedStr` | No | AWS secret access key for authentication. |
| `aws_session_token` | `RedactedStr` | No | Optional AWS session token for temporary credentials. |
| `connection_acquisition_timeout` | `Duration` | No | Timeout for acquiring a connection from the pool. |
| `connection_timeout` | `Duration` | No | Timeout for establishing connections to Bedrock. |
| `timeout` | `Duration` | No | Timeout for Bedrock API requests. |

### `ChatConfig` parameters

| Parameter | Type | Required | Description |
| - | - | - | - |
| `model` | `str` | Yes | The ID of the model to use, for example `"anthropic.claude-3-sonnet-20240229-v1:0"`. |
| `max_tokens` | `int` | No | Maximum number of tokens to generate in the response. |
| `temperature` | `float` | No | Controls randomness in responses from 0.0 (deterministic) to 1.0 (creative). |
| `top_k` | `int` | No | Limits vocabulary to top K tokens at each generation step. |
| `top_p` | `float` | No | Nucleus sampling parameter. Controls diversity via cumulative probability. |

## Verify the configuration

After completing the configuration, verify that the LLM connection works:

1. Start the Atoti session.
2. Open the Atoti UI.
3. Test an AI feature such as Visualize This or Auto-Explain.

## Related reading

After configuring Amazon Bedrock, proceed to set up AI features:

* [Set up Auto-Explain in Python](https://docs.activeviam.com/atoti-intelligence/6.2/developer-guide/enable-ai-tools/auto-explain/setup-python.md)
* [Set up Visualize This in Python](https://docs.activeviam.com/atoti-intelligence/6.2/developer-guide/enable-ai-tools/visualize-this/setup-python.md)
* [`atoti_ai_amazon_bedrock`](https://docs.activeviam.com/engine/python-sdk/latest/api/atoti_ai_amazon_bedrock) API reference
