feat: replace Anthropic monkey-patch with native Bedrock Converse API provider#1
Open
JiaDe-Wu wants to merge 1 commit into
Open
feat: replace Anthropic monkey-patch with native Bedrock Converse API provider#1JiaDe-Wu wants to merge 1 commit into
JiaDe-Wu wants to merge 1 commit into
Conversation
… provider Replace the anthropic.Anthropic -> AnthropicBedrock monkey-patch with Hermes Agent native Bedrock provider (provider="bedrock"), which uses the Converse API directly via boto3. Benefits: - Supports ALL Bedrock models (Claude, Nova, DeepSeek, Llama, Mistral) not just Claude (Anthropic SDK limitation) - No monkey-patching — clean provider="bedrock" configuration - Native streaming, tool calling, error classification, Guardrails - Dynamic model discovery via ListFoundationModels Changes: - app/hermes/main.py: Delete monkey-patch, use provider="bedrock" - bridge/contract.py: Default provider anthropic -> bedrock - bridge/bedrock_provider.py: Simplified (Converse API handles routing) - bridge/Dockerfile: Add [bedrock] extra for boto3 - cdk.json: Use inference profile ID as default model Depends on: NousResearch/hermes-agent#7920 (native Bedrock provider PR) Ref: https://github.com/JiaDe-Wu/sample-hermes-agent-on-aws-with-bedrock
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
Replace the
anthropic.Anthropic->AnthropicBedrockmonkey-patch with Hermes Agent's native Bedrock provider (provider="bedrock"), which uses the Converse API directly via boto3.Why
The current monkey-patch routes all API calls through the Anthropic SDK's Bedrock adapter, which limits model support to Claude only. The native Bedrock provider uses the Converse API, which supports all Bedrock models — Claude, Nova, DeepSeek, Llama, Mistral, etc.
What Changed
app/hermes/main.pyprovider="bedrock"bridge/contract.pyanthropic->bedrockbridge/bedrock_provider.pybridge/Dockerfile[bedrock]extra for boto3cdk.jsonNet: -76 lines (mostly monkey-patch deletion).
Dependency
Requires NousResearch/hermes-agent#7920 (native Bedrock Converse API provider) to be merged upstream, or the hermes-agent submodule pointed to the fork branch:
JiaDe-Wu/hermes-agent@feat/native-aws-bedrock-provider.Benefits