feat: auto-select Anthropic provider for Anthropic models#117
Merged
Conversation
Release v0.5.3
…fix-0.5.3 chore: strip dev suffix for stable release 0.5.3
Override provider parameter to use 'Anthropic' when model starts with 'anthropic/' for optimal performance. Adds debug logging and updates docstring to document this behavior. Closes #116
Add 16 unit tests covering: - Anthropic models auto-selecting Anthropic provider - Anthropic models overriding any specified provider - Non-Anthropic models using specified provider - General LLM configuration (temperature, max_tokens, etc.) - Caching wrapper integration All tests pass (16/16)
Member
Author
Code Review SummaryRan comprehensive code review with pr-review-toolkit:code-reviewer. Issues IdentifiedImportant (addressed):✅ Missing unit tests for provider auto-selection logic - FIXED
Minor (addressed):✅ Docstring clarity - IMPROVED
SummaryAll identified issues have been addressed. The provider auto-selection logic is now fully tested and documented. |
Make docstring more explicit about provider parameter being completely ignored for Anthropic models, addressing code review feedback.
Resolved conflicts in tests/test_core/test_litellm_llm.py by combining: - Provider auto-selection tests (this branch) - Comprehensive caching wrapper tests (develop) Result: 33 tests total (30 passed, 1 skipped, 2 async failures pre-existing from develop)
The merge incorrectly kept version 0.5.3 instead of 0.5.3.dev0. Develop and feature branches should always have .dev suffix. Version suffix stripping should only happen on main branch releases.
This was referenced Jan 27, 2026
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
Automatically routes Anthropic models (anthropic/*) to Anthropic's infrastructure for optimal performance by overriding the provider parameter.
Changes
Why
When using Anthropic models through OpenRouter, routing through Anthropic's infrastructure provides better performance than using other providers' proxies.
Testing
Closes #116