mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-30 01:08:33 +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> |
||
|---|---|---|
| .. | ||
| core | ||
| __init__.py | ||
| test_enforce_model_rate_limits.py | ||
| test_io_token_rate_limits.py | ||
| test_router.py | ||
| test_router_callback_hook_sequence.py | ||
| test_router_endpoints.py | ||
| test_router_entry_points.py | ||
| test_router_facade.py | ||
| test_router_fallbacks.py | ||
| test_router_fuzz_regressions_rust_only.py | ||
| test_router_get_deployments.py | ||
| test_router_helper_utils.py | ||
| test_router_host.py | ||
| test_router_max_parallel_requests.py | ||
| test_router_provider_endpoints.py | ||
| test_router_retries.py | ||
| test_router_surface_check.py | ||
| test_router_timeout.py | ||
| test_router_vector_store_endpoints.py | ||