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

# AWS Bedrock

> Using AWS Bedrock with Upsonic

## Overview

AWS Bedrock provides access to multiple foundation models from Amazon, Anthropic, Meta, Mistral, and others through a single API. Enterprise-grade with AWS security and compliance.

**Model Class:** `BedrockConverseModel`

## Authentication

```bash theme={null}
export AWS_ACCESS_KEY_ID="..."
export AWS_SECRET_ACCESS_KEY="..."
export AWS_REGION="us-east-1"
```

## Examples

```python theme={null}
from upsonic import Agent, Task
from upsonic.models.bedrock import BedrockConverseModel

model = BedrockConverseModel(model_name="us.anthropic.claude-sonnet-4-6")
agent = Agent(model=model)

task = Task("Hello, how are you?")
result = agent.do(task)
print(result)
```

## Model Settings

You can set model parameters in two ways: on the model or on the Agent.

**On the model:**

```python theme={null}
from upsonic import Agent, Task
from upsonic.models.bedrock import BedrockConverseModel, BedrockModelSettings

model = BedrockConverseModel(
    model_name="us.anthropic.claude-3-5-sonnet-20241022-v2:0",
    settings=BedrockModelSettings(max_tokens=1024, temperature=0.7)
)
agent = Agent(model=model)
```

**On the Agent:**

```python theme={null}
from upsonic import Agent, Task
from upsonic.models.bedrock import BedrockModelSettings

agent = Agent(
    model="bedrock/us.anthropic.claude-3-5-sonnet-20241022-v2:0",
    settings=BedrockModelSettings(max_tokens=1024)
)
```

## Parameters

| Parameter | Type | Description | Default | Source |
| - | - | - | - | - |
| `max_tokens` | `int` | Maximum tokens to generate | 2048 | Base |
| `temperature` | `float` | Sampling temperature (0.0-1.0) | 1.0 | Base |
| `top_p` | `float` | Nucleus sampling | 1.0 | Base |
| `stop_sequences` | `list[str]` | Stop sequences | None | Base |
| `timeout` | `float` | Request timeout (seconds) | 600 | Base |
| `bedrock_guardrail_config` | `dict` | Content moderation configuration | None | Specific |
| `bedrock_performance_configuration` | `dict` | Latency optimization settings | None | Specific |


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