mirror of
https://github.com/tiennm99/litellm.git
synced 2026-07-19 02:18:37 +00:00
f81d8ae077
* feat: route future Claude models to Anthropic provider via pattern matching
Add pattern-based matching for Claude model names so that future models
(e.g., claude-opus-4-9, claude-sonnet-5-0) are automatically routed to
the Anthropic provider without requiring model_prices_and_context_window.json
updates.
The pattern matches: claude-{opus|sonnet|haiku}-{major}-{minor}[-YYYYMMDD]
https://claude.ai/code/session_017asCVDN5jBFMBcZRjiQR6C
* fix: don't hard-code the tier names
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
* style: move import re to module level (PEP 8)
Move `import re` from inside the module body to the top-level imports
section, following PEP 8 style guidelines that all imports should
appear at the top of the file.
https://claude.ai/code/session_01Dt8fzn81eYMfxu1MoBa5hN
* test: fix claude-mini-4-5 assertion to match generic-tier pattern
The pattern intentionally accepts any [a-z]+ tier (see f835f84) rather
than a hard-coded opus|sonnet|haiku list, so claude-mini-4-5 routes to
anthropic and the old 'is False' assertion was wrong. Replace it with a
positive test that locks in the generic-tier behavior and guards against
a regression to hard-coded tier names.
* style: collapse _CLAUDE_PATTERN to one line (black)
Black 26.3.1 (CI) collapses the re.compile call onto a single line since
it fits within the line limit. Fixes the failing lint check.
---------
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>