mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-05 02:41:56 +00:00
Adds `!` prefix negation to tag-based routing so callers can exclude deployments by exact tag value without enumerating every allowed alternative. `!provider:anthropic` removes all deployments tagged exactly `provider:anthropic` before routing, and positive and negation tags compose. Matching is exact literal membership (frozenset intersection), so there is no regex or ReDoS surface for client-supplied tags. Ban-only requests that carry only negation tags stay within the default pool, mirroring untagged-request semantics so callers can't use negation to escape it. Fallback chains keep working because get_deployments_for_tag runs on each routing hop Copy of #31680; implementation credit to @deepanshululla Co-authored-by: deepanshululla <15312873+deepanshululla@users.noreply.github.com> |
||
|---|---|---|
| .. | ||
| adaptive_router | ||
| auto_router | ||
| complexity_router | ||
| quality_router | ||
| base_routing_strategy.py | ||
| budget_limiter.py | ||
| lar1_routing.py | ||
| least_busy.py | ||
| lowest_cost.py | ||
| lowest_latency.py | ||
| lowest_tpm_rpm.py | ||
| lowest_tpm_rpm_v2.py | ||
| simple_shuffle.py | ||
| tag_based_routing.py | ||