forked from phoenix/litellm-mirror
fix vertex_proxy_route
This commit is contained in:
parent
bbb2e029b5
commit
4273837add
1 changed files with 14 additions and 1 deletions
|
@ -119,7 +119,6 @@ async def vertex_proxy_route(
|
||||||
endpoint: str,
|
endpoint: str,
|
||||||
request: Request,
|
request: Request,
|
||||||
fastapi_response: Response,
|
fastapi_response: Response,
|
||||||
user_api_key_dict: UserAPIKeyAuth = Depends(user_api_key_auth),
|
|
||||||
):
|
):
|
||||||
encoded_endpoint = httpx.URL(endpoint).path
|
encoded_endpoint = httpx.URL(endpoint).path
|
||||||
|
|
||||||
|
@ -128,6 +127,20 @@ async def vertex_proxy_route(
|
||||||
verbose_proxy_logger.debug("requested endpoint %s", endpoint)
|
verbose_proxy_logger.debug("requested endpoint %s", endpoint)
|
||||||
headers: dict = {}
|
headers: dict = {}
|
||||||
|
|
||||||
|
# TODO - clean this up before merging
|
||||||
|
litellm_api_key = request.headers.get("X-Litellm-Api-Key")
|
||||||
|
api_key_to_use = ""
|
||||||
|
if litellm_api_key:
|
||||||
|
api_key_to_use = f"Bearer {litellm_api_key}"
|
||||||
|
else:
|
||||||
|
api_key_to_use = request.headers.get("Authorization")
|
||||||
|
|
||||||
|
api_key_to_use = api_key_to_use or ""
|
||||||
|
user_api_key_dict = await user_api_key_auth(
|
||||||
|
request=request,
|
||||||
|
api_key=api_key_to_use,
|
||||||
|
)
|
||||||
|
|
||||||
vertex_project = None
|
vertex_project = None
|
||||||
vertex_location = None
|
vertex_location = None
|
||||||
# Use headers from the incoming request if default_vertex_config is not set
|
# Use headers from the incoming request if default_vertex_config is not set
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue