Skip to content

feat: Add AWS Bedrock LLM provider support with token auth#923

Open
smitb wants to merge 1 commit intoRightNow-AI:mainfrom
smitb:feat/add-aws-bedrock-llm-provider-support-with-token-auth
Open

feat: Add AWS Bedrock LLM provider support with token auth#923
smitb wants to merge 1 commit intoRightNow-AI:mainfrom
smitb:feat/add-aws-bedrock-llm-provider-support-with-token-auth

Conversation

@smitb
Copy link
Copy Markdown

@smitb smitb commented Mar 30, 2026

Summary

Adds AWS Bedrock as a supported LLM provider via the Converse API using
Bedrock API Key bearer token authentication. Credentials resolve from
bedrock_api_key in config or AWS_BEARER_TOKEN_BEDROCK env var, with
region defaulting to us-east-1.

Changes

  • New bedrock.rs driver implementing the full LlmDriver trait (completions, streaming, tool use, token usage)
  • bedrock registered as a named provider in create_driver()
  • Bedrock added to the init wizard provider list, defaulting to anthropic.claude-sonnet-4-6

Testing

  • cargo clippy --workspace --all-targets -- -D warnings passes
  • cargo test --workspace passes
  • Live integration tested (if applicable)

Security

  • No new unsafe code
  • No secrets or API keys in diff
  • User input validated at boundaries

@Jengro777
Copy link
Copy Markdown

Quick feedback from the community:
https://github.com/librefang/librefang

drzow added a commit to drzow/openfang that referenced this pull request Apr 3, 2026
Bedrock's Converse API requires exact 1:1 matching between assistant
toolUse blocks and the subsequent user toolResult blocks. When message
history gets messy (e.g. after session repair), mismatches cause 400
errors. This adds validate_tool_pairing() which:

- Removes orphaned toolResult blocks not matching preceding assistant
- Deduplicates toolResult blocks with repeated tool_use_id
- Inserts synthetic error results for missing toolUse matches
- Replaces empty user messages with placeholder text

Inspired by RightNow-AI#923.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants