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:
Krrish Dholakia 2025-10-06 13:44:10 -07:00
parent 7a61526b7b
commit 6177b23ebf
3 changed files with 4 additions and 6 deletions

View file

@ -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

View file

@ -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

View file

@ -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: