Merge pull request #4916 from BerriAI/litellm_fix_ui_login

Feat UI - allow using custom header for litellm api key
This commit is contained in:
Ishaan Jaff 2024-07-29 17:08:53 -07:00 committed by GitHub
commit 1a34756159
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 109 additions and 78 deletions

View file

@ -1314,8 +1314,9 @@ def get_api_key_from_custom_header(
# use this as the virtual key passed to litellm proxy
custom_litellm_key_header_name = custom_litellm_key_header_name.lower()
verbose_proxy_logger.debug(
"searching for custom_litellm_key_header_name= %s",
"searching for custom_litellm_key_header_name= %s, in headers=%s",
custom_litellm_key_header_name,
request.headers,
)
custom_api_key = request.headers.get(custom_litellm_key_header_name)
if custom_api_key: