Commit 55f896b
authored
🤖 feat: add support for Amazon Bedrock (#765)
Add Amazon Bedrock as a supported AI provider using
`@ai-sdk/amazon-bedrock` with flexible AWS authentication via
`@aws-sdk/credential-providers`.
## Authentication Methods (in priority order)
1. **Explicit credentials in providers.jsonc** (`accessKeyId` +
`secretAccessKey`)
2. **`AWS_BEARER_TOKEN_BEDROCK`** - Bedrock API key (simplest auth)
3. **AWS credential provider chain**:
- Environment variables (`AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`)
- Shared credentials file (`~/.aws/credentials`)
- EC2 instance profiles
- ECS task roles
- EKS service accounts (IRSA)
- SSO credentials
- And more...
## Configuration
> **Note:** Region is always required - either in config or via
`AWS_REGION` environment variable.
**Simplest setup with Bedrock API key:**
```bash
export AWS_REGION=us-east-1
export AWS_BEARER_TOKEN_BEDROCK=your-api-key
```
**Or explicit credentials in `providers.jsonc`:**
```json
{
"bedrock": {
"region": "us-east-1",
"accessKeyId": "...",
"secretAccessKey": "..."
}
}
```
**Or just region (uses credential chain automatically):**
```json
{
"bedrock": {
"region": "us-east-1"
}
}
```
## Supported Models
**Model string format:** `bedrock:<model-id>`
Examples:
- `bedrock:anthropic.claude-3-5-sonnet-20241022-v2:0`
- `bedrock:us.amazon.nova-pro-v1:0`
- `bedrock:meta.llama3-70b-instruct-v1:0`
Closes #764
---
_Generated with `mux`_1 parent 80cecf2 commit 55f896b
File tree
13 files changed
+803
-142
lines changed- docs
- src
- browser
- assets/icons
- components
- Messages
- Settings
- sections
- utils/slashCommands
- common
- constants
- utils/ai
- node/services
13 files changed
+803
-142
lines changedLarge diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
173 | 173 | | |
174 | 174 | | |
175 | 175 | | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
176 | 255 | | |
177 | 256 | | |
178 | 257 | | |
| |||
199 | 278 | | |
200 | 279 | | |
201 | 280 | | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
202 | 285 | | |
203 | 286 | | |
204 | 287 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| 48 | + | |
48 | 49 | | |
49 | 50 | | |
50 | 51 | | |
51 | 52 | | |
| 53 | + | |
52 | 54 | | |
53 | 55 | | |
54 | 56 | | |
| |||
Loading
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
| 33 | + | |
| 34 | + | |
32 | 35 | | |
33 | 36 | | |
34 | 37 | | |
| |||
0 commit comments