Litellm dev 01 21 2025 p1 (#7898)

* fix(utils.py): don't pass 'anthropic-beta' header to vertex - will cause request to fail

* fix(utils.py): add flag to allow user to disable filtering invalid headers

ensure user can control behaviour

* style(utils.py): cleanup message

* test(test_utils.py): add unit test to cover invalid header filtering

* fix(proxy_server.py): fix custom openapi schema generation

* fix(utils.py): pass extra headers if set

* fix(main.py): fix image variation to use 'client' param
This commit is contained in:
Krish Dholakia 2025-01-21 20:36:11 -08:00 committed by GitHub
parent dd385410df
commit 866fffb50d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 161 additions and 21 deletions

View file

@ -17,6 +17,7 @@ from litellm.proxy._types import (
TeamCallbackMetadata,
UserAPIKeyAuth,
)
from litellm.types.llms.anthropic import ANTHROPIC_API_HEADERS
from litellm.types.services import ServiceTypes
from litellm.types.utils import (
StandardLoggingUserAPIKeyMetadata,
@ -396,6 +397,7 @@ async def add_litellm_data_to_request( # noqa: PLR0915
dict: The modified data dictionary.
"""
from litellm.proxy.proxy_server import llm_router, premium_user
safe_add_api_version_from_query_params(data, request)
@ -626,6 +628,7 @@ async def add_litellm_data_to_request( # noqa: PLR0915
parent_otel_span=user_api_key_dict.parent_otel_span,
)
)
return data
@ -726,10 +729,6 @@ def add_provider_specific_headers_to_request(
data: dict,
headers: dict,
):
ANTHROPIC_API_HEADERS = [
"anthropic-version",
"anthropic-beta",
]
extra_headers = data.get("extra_headers", {}) or {}