mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-28 00:00:38 +00:00
* fix(router): send the fallback deployment's own key instead of an inherited Anthropic key On a fallback from an Anthropic group, a recognizable Anthropic caller key (sk-ant-) no longer replaces the credential a Bedrock or Bedrock Mantle bearer deployment, or an OpenAI deployment, resolves on its own default endpoint. The Bedrock bearer comes from the deployment api_key, a router default or the provider env bearer. The OpenAI key comes from the deployment, a router default, OPENAI_API_KEY, litellm.api_key or litellm.openai_key. The existing IAM behavior is unchanged for every caller key. Opaque or destination-shaped caller keys, blank keys, fallback targets that set api_key, explicit Authorization headers, custom endpoints (deployment, request, dict target, router defaults, provider env, litellm.api_base), mixed-group members, Claude Platform, and OpenAI deployments with no key of their own all keep today's behavior. * fix(router): check the caller key owner before resolving fallback destination auth leaves_caller_key_behind now classifies the destination by provider and checks the Anthropic owner before it reads any endpoint env var or secret, so direct and non-Anthropic calls resolve nothing new, as before. The OpenAI own-key check reuses openai_static_api_key, and a non-string deployment api_key keeps the caller key. Tests add an OpenAI fallback whose explicit Authorization header keeps the forwarded caller key, and direct and OpenAI-to-OpenAI calls that keep an sk-ant caller key without an Anthropic origin. * test(router): key the alias fallback case on the requested alias * test(router): keep the caller key when a router default api_key is not a string * fix(router): admit fallbacks using their effective caller credentials --------- Co-authored-by: Joshua Valluru <326636767+joshua-berri@users.noreply.github.com> |
||
|---|---|---|
| .. | ||
| pre_call_checks | ||
| __init__.py | ||
| test_access_windows.py | ||
| test_add_retry_fallback_headers.py | ||
| test_client_initalization_utils.py | ||
| test_cooldown_cache.py | ||
| test_cooldown_handlers.py | ||
| test_deployment_pricing.py | ||
| test_dynamic_queue.py | ||
| test_dynamic_queue_redis.py | ||
| test_dynamic_queue_router.py | ||
| test_embedding_batch_size_check.py | ||
| test_endpoint_eligibility.py | ||
| test_fallback_event_handlers.py | ||
| test_fallback_event_v2_dispatch.py | ||
| test_get_retry_from_policy.py | ||
| test_handle_error.py | ||
| test_health_check_allowed_fails_integration.py | ||
| test_health_state_cache.py | ||
| test_kubernetes_pod_discovery.py | ||
| test_pattern_match_deployments.py | ||
| test_prompt_caching_cache.py | ||
| test_ptu_shares.py | ||
| test_reasoning_effort_capability.py | ||
| test_request_priority.py | ||
| test_router_health_check_routing.py | ||
| test_router_interactions_endpoints.py | ||
| test_router_utils_common_utils.py | ||
| test_routing_read_batch.py | ||