mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-09 03:18:44 +00:00
feat(azure/passthrough): working azure passthrough with router models for openai calls
Fixes issue where azure passthrough could not work with workload identity + litellm model name
This commit is contained in:
parent
7a61526b7b
commit
6177b23ebf
3 changed files with 4 additions and 6 deletions
|
|
@ -665,10 +665,6 @@ class BaseAzureLLM(BaseOpenAILLM):
|
|||
) -> dict:
|
||||
litellm_params = litellm_params or GenericLiteLLMParams()
|
||||
|
||||
# If api-key is already in headers, preserve it
|
||||
if "api-key" in headers:
|
||||
return headers
|
||||
|
||||
api_key = (
|
||||
litellm_params.api_key
|
||||
or litellm.api_key
|
||||
|
|
|
|||
|
|
@ -58,7 +58,9 @@ class AzurePassthroughConfig(BasePassthroughConfig):
|
|||
) -> dict:
|
||||
return BaseAzureLLM._base_validate_azure_environment(
|
||||
headers=headers,
|
||||
litellm_params=GenericLiteLLMParams(**litellm_params),
|
||||
litellm_params=GenericLiteLLMParams(
|
||||
**{**litellm_params, "api_key": api_key}
|
||||
),
|
||||
)
|
||||
|
||||
@staticmethod
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ model_list:
|
|||
model: azure/gpt-4.1
|
||||
api_base: os.environ/AZURE_API_BASE_ALT
|
||||
api_version: "2023-05-15"
|
||||
api_key: os.environ/AZURE_API_KEY_HIDDEN
|
||||
api_key: os.environ/AZURE_API_KEY_ALT
|
||||
|
||||
# mcp_servers:
|
||||
# github_mcp:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue