Files
moeka-project/packages
chaosreloadandautofix-ci[bot] a189536489 feat(providers): add Amazon Bedrock provider (#1256)
## Summary

Add support for Amazon Bedrock as an LLM provider using the native
**Converse API** with API Key authentication.

## Motivation

AWS Bedrock provides access to frontier models (Claude, Amazon Nova,
Llama, DeepSeek etc.) with enterprise-grade security and compliance.
Many teams running AI workloads on AWS infrastructure want to use
Bedrock directly, keeping all traffic within the AWS network.

## Implementation

- Uses Amazon Bedrock's native **Converse API**
(`bedrock-runtime.{region}.amazonaws.com/model/{modelId}/converse`)
- Authentication via **Amazon Bedrock API Key** (`Authorization: Bearer
<key>`) — no SigV4 signing, no extra dependencies
- Config: `apiKey` (Bedrock API key) + `region` (AWS region, default:
`us-east-1`)
- All Bedrock-specific config is declared via the generic
`onboardingFields` mechanism on the provider definition — no
`isAmazonBedrock` branching, no `ProviderConfigData` type changes
- Dynamic model listing via `ListFoundationModels` +
`ListInferenceProfiles` APIs, with fallback to a static list
- Streaming: calls `/converse` (standard JSON response), then re-emits
the full text as `text/event-stream` character-by-character —
bearer-token auth does not support the binary AWS Event Stream protocol
required by `/converse-stream`

## Supported Models

**Anthropic Claude (via Bedrock)**
- Claude Opus/Sonnet/Haiku 4.x
- Claude Sonnet 3.7 (hybrid reasoning)
- Claude Sonnet 3.5 v2

**Amazon Nova**
- Nova Pro (multimodal)
- Nova Lite (multimodal, low cost)
- Nova Micro (text-only, lowest cost)

**Meta / Others**
- Llama 3.3 70B Instruct
- DeepSeek, Moonshot, Minimax models available via inference profiles

## Authentication

Generate a Bedrock API key in: **AWS Console → Amazon Bedrock → API
Keys**

> Note: Long-term API keys have a 30-day expiry. AWS recommends them for
development/exploration use.

## Notes

⚠️ **CORS in browser**: Like other providers (Anthropic, etc.), direct
browser calls to Bedrock are subject to CORS restrictions. Works out of
the box in Tauri desktop app and Node.js server environments. For
browser use, a CORS proxy is needed.

## Testing

```
pnpm vitest run packages/stage-ui/src/libs/providers/providers/amazon-bedrock/index.test.ts
```

---------
Co-authored-by-agent: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-04-22 17:37:29 +00:00
..
2026-03-23 02:15:40 +08:00
2026-04-11 04:00:49 +08:00
2026-04-10 14:48:30 +08:00
2026-04-10 14:48:30 +08:00
2026-04-10 14:48:30 +08:00
2026-04-10 14:48:30 +08:00
2026-04-10 14:48:30 +08:00
2026-04-10 14:48:30 +08:00
2026-04-10 14:48:30 +08:00
2026-04-10 14:48:30 +08:00
2026-04-10 14:48:30 +08:00
2026-04-15 14:44:59 +08:00
2026-04-10 14:48:30 +08:00
2026-04-10 14:48:30 +08:00
2026-04-10 14:48:30 +08:00
2026-04-10 14:48:30 +08:00
2026-04-15 14:44:59 +08:00