Add composite provider support for Bedrock (Converse + Anthropic Mess…#77
Closed
Add composite provider support for Bedrock (Converse + Anthropic Mess…#77
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
BedrockModeenum to select between Converse and Anthropic Messages APIdetermine_mode()to detect Claude models for Messages API routinginvoke_url_for_mode()for correct endpoint selection (/invokevs/converse)prepare_anthropic_payload()to injectanthropic_versionfieldspec.formatinstead ofprovider.format()for transformationadd_provider_for_format()to RouterBuilder for multi-format provider registrationTest plan