Skip to content

Add composite provider support for Bedrock (Converse + Anthropic Mess…#77

Closed
clutchski wants to merge 10 commits intomainfrom
matt/bedrock-composite-provider
Closed

Add composite provider support for Bedrock (Converse + Anthropic Mess…#77
clutchski wants to merge 10 commits intomainfrom
matt/bedrock-composite-provider

Conversation

@clutchski
Copy link

@clutchski clutchski commented Feb 4, 2026

Summary

Adds support for both Converse API and Anthropic Messages API from a single Bedrock provider. Claude models (anthropic.*) now route through the native Messages API at /model/{model}/invoke, while other models continue using the Converse API.

Changes

  • Add BedrockMode enum to select between Converse and Anthropic Messages API
  • Add determine_mode() to detect Claude models for Messages API routing
  • Add invoke_url_for_mode() for correct endpoint selection (/invoke vs /converse)
  • Add prepare_anthropic_payload() to inject anthropic_version field
  • Change router to use spec.format instead of provider.format() for transformation
  • Add add_provider_for_format() to RouterBuilder for multi-format provider registration

Test plan

  • Unit tests for mode selection and URL construction (6 tests)
  • Integration test for multi-format provider routing

clutchski and others added 10 commits February 4, 2026 15:02
…ages API)

- Add BedrockMode enum to select between Converse and Anthropic Messages API
- Add determine_mode() to detect Claude models (anthropic.*) for Messages API
- Add invoke_url_for_mode() for correct endpoint selection (/invoke vs /converse)
- Add prepare_anthropic_payload() to inject anthropic_version
- Change router to use spec.format instead of provider.format() for transformation
- Add add_provider_for_format() to RouterBuilder for multi-format providers

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Use determine_mode() and invoke_url_for_mode() in complete() and complete_stream()
- Prepare payload with anthropic_version for AnthropicMessages mode
- Remove unused invoke_url() method
- Add verify target with fmt --check, clippy -D warnings, build, and tests
- All commands use RUSTFLAGS="-D warnings" to match CI
- Add TODO comment to ci.yml about using make targets
- Update CLAUDE.md with development workflow instructions
- verify: fmt + clippy + test with -D warnings (~5s)
- check-quick: fmt + clippy only (~1s)
- Update CLAUDE.md: run 'make verify' before committing
- Add DEFAULT_ANTHROPIC_VERSION constant with doc link
- Read anthropic_version from metadata with default fallback
- Users can override in Bedrock config if AWS updates the API
Handle us.anthropic.*, global.anthropic.*, eu.anthropic.* model IDs
in addition to direct anthropic.* model IDs.
@clutchski clutchski closed this Feb 5, 2026
@clutchski clutchski deleted the matt/bedrock-composite-provider branch February 5, 2026 20:47
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.

1 participant