Amazon Bedrock provider added, with eight model-ID fix commits to land it

pixelysg wires Claude through Amazon Bedrock as a fourth LLM backend. The adapter code is clean and small. Getting Bedrock's inference profile ID format right took eight commits and the final values still show inconsistencies - re-verify before importing.

infrastructureintegration

The provider adapter in backend/src/lib/llm/bedrock.ts (174 lines) uses @anthropic-ai/bedrock-sdk@0.29.1 and reuses the existing Anthropic message and streaming shape, so the diff is mostly plumbing. Credentials can come from per-user API keys (JSON-encoded with accessKeyId, secretAccessKey, region, sessionToken) or fall through to AWS_* env vars. The title-generation router in userSettings.ts was extended to pick BEDROCK_LOW_MODELS[0] when only AWS credentials are available.

The model ID story is rougher. Bedrock requires cross-region inference profile format rather than bare model names, and getting the exact strings right took eight separate fix commits over about two hours. The commits contradict each other on what worked: bare anthropic. prefix, then the cross-region inference profile prefix (an AWS region code ahead of the model name, here the United States region), then full dated identifiers, then back to undated versions. The final state in models.ts has the region-prefixed anthropic.claude-sonnet-4-6 (no version marker) for Sonnet and the region-prefixed anthropic.claude-haiku-4-5-20251001-v1:0 (with date and :0) for Haiku - inconsistent formats suggesting different accounts or configurations were used across test runs.

pixelysg (use-agently.com) appears to be running on AWS, which explains the priority. The BEDROCK_MAIN_MODELS list changed throughout - Opus 4.7 was added, then removed, then Opus 4.6 was added. The frontend picker has matching churn.

So what Worth a look if your fork needs Bedrock routing: the adapter plumbing, the `providerForModel`/`bedrockModelId` helpers, and the title-generation fallback are clean templates. Do not copy the model ID strings from `models.ts` directly - the commit history shows they were revised repeatedly without clear verification, and Bedrock's inference profile catalog changes over time. Verify each ID against the current Bedrock console in your target region. Also note that credentials are stored as JSON-stringified per-user keys; check that your key-storage layer tolerates that shape before importing.

View this fork on GitHub →

Spotted something wrong? Or know the PR text has fresher detail than the writeup above?

Commits in this thread

11 commits from pixelysg/mike, oldest first. Source extracted verbatim from the harvested git log.

SHA Subject Author Date
63730c9c feat: add Amazon Bedrock provider integration Jia Jian Goi 2026-05-15 ↗ GitHub
commit body
Adds Amazon Bedrock as a new LLM provider, allowing users to route
Claude model requests through their AWS account. Uses the official
@anthropic-ai/bedrock-sdk which shares the same message/tool/streaming
interface as the direct Anthropic API.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
34ecca0e fix: route title generation to Bedrock when no other provider configured Jia Jian Goi 2026-05-15 ↗ GitHub
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
fb1156b6 fix: map Bedrock model IDs to correct API identifiers Jia Jian Goi 2026-05-15 ↗ GitHub
commit body
The Bedrock SDK expects IDs like "anthropic.claude-opus-4-7", not the
bare "claude-opus-4-7" that was being sent. Also fall back to Bedrock
for title generation when AWS_ACCESS_KEY_ID is set.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
07da238f feat: add Claude Opus 4.6 and fix Bedrock model options Jia Jian Goi 2026-05-15 ↗ GitHub
Add Opus 4.6 to Anthropic model list. Replace non-existent Bedrock
Sonnet 4.6 with Haiku 4.5 (only Opus 4.7 and Haiku 4.5 are available
on Bedrock).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
5d3945a1 fix: use region-prefixed inference profile IDs for Bedrock models Jia Jian Goi 2026-05-15 ↗ GitHub
commit body
Bedrock requires cross-region inference profile format
({region}.anthropic.{model}-v1) for on-demand invocation.
Also adds missing .not() operator to the Postgres query adapter.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
8a9c836e fix: add Bedrock Sonnet 4.6 to frontend model picker Jia Jian Goi 2026-05-15 ↗ GitHub
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
197464b7 fix: use cross-region inference profile IDs for Bedrock Jia Jian Goi 2026-05-15 ↗ GitHub
Bedrock requires cross-region inference profile format (us.anthropic.*)
for on-demand invocation of newer Claude models.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
559afe69 fix: use correct Bedrock model IDs with inference profile format Jia Jian Goi 2026-05-15 ↗ GitHub
commit body
Bedrock requires full inference profile IDs with date stamps
(us.anthropic.claude-sonnet-4-20250514-v1:0). Opus is not yet
available on Bedrock, removed from model picker.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
342f4ba8 fix: correct Bedrock model IDs and add Opus 4.6 Jia Jian Goi 2026-05-15 ↗ GitHub
commit body
Uses verified inference profile IDs:
- Opus 4.6: us.anthropic.claude-opus-4-6-v1
- Sonnet 4.6: us.anthropic.claude-sonnet-4-6
- Haiku 4.5: us.anthropic.claude-haiku-4-5-20251001-v1:0

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
d7e60825 fix: remove :0 suffix from Bedrock model IDs Jia Jian Goi 2026-05-15 ↗ GitHub
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
ce3e452b fix: use verified Bedrock model IDs tested against live API Jia Jian Goi 2026-05-15 ↗ GitHub
commit body
Tested each ID against Bedrock us-east-1:
- Opus 4.6: us.anthropic.claude-opus-4-6-v1
- Sonnet 4.6: us.anthropic.claude-sonnet-4-6
- Haiku 4.5: us.anthropic.claude-haiku-4-5-20251001-v1:0

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

Capture this thread into my fork

Download a single Markdown prompt that tells Claude how to port every commit above into your working tree — adapting paths and structure to match your repo. Run it via claude -p < capture-thread-392.md from inside the repo you want the changes in.

⬇ Download capture-thread-392.md