feat(model): Add FallbackModel with circuit breaker#1016
Open
mbutler-aws wants to merge 5 commits intostrands-agents:mainfrom
Open
feat(model): Add FallbackModel with circuit breaker#1016mbutler-aws wants to merge 5 commits intostrands-agents:mainfrom
mbutler-aws wants to merge 5 commits intostrands-agents:mainfrom
Conversation
|
Hey @mbutler-aws I was looking forward for this feature. Is it abandoned or will there be future work? |
Author
|
Added supporting documentation PR (strands-agents/docs#369). Unit tests and integration tests passed locally. Ready for review. |
Author
Thanks for the nudge @dnzprmksz. Created the documentation PR today for the functionality. Hopefully can get this PR integrated. |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
- Resolved merge conflict in src/strands/models/__init__.py - Integrated FallbackModel into new lazy loading structure - Added comprehensive test coverage (100%) for FallbackModel - Fixed linting issues in test files
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.
Description
This PR implements
FallbackModel, a new model wrapper that provides automatic failover between any two model instances with circuit breaker protection.Related Issues
N/A
Documentation PR
strands-agents/docs#369
Type of Change
New feature
Testing
Yes. PR includes both unit tests (29) with 91% code coverage, and integration tests (7):
Unit Tests
Integration Tests
Same-provider fallback (Bedrock→Bedrock)
Cross-provider fallback (OpenAI→Bedrock, Anthropic→Bedrock)
Agent integration with FallbackModel
Tool calling with real models
Statistics tracking with real API calls
I ran
hatch run prepareChecklist
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.