Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

feat(azure/gpt_transformation.py): add azure audio model support

Krrish Dholakiafe24b9d90b95
diff --git a/litellm/llms/azure/chat/gpt_transformation.py b/litellm/llms/azure/chat/gpt_transformation.py
index 7aa4fffab51..ee85517e669 100644
--- a/litellm/llms/azure/chat/gpt_transformation.py
+++ b/litellm/llms/azure/chat/gpt_transformation.py
@@ -99,6 +99,8 @@ class AzureOpenAIConfig(BaseConfig):
"extra_headers",
"parallel_tool_calls",
"prediction",
+ "modalities",
+ "audio",
]
def _is_response_format_supported_model(self, model: str) -> bool:
diff --git a/litellm/llms/openai/chat/gpt_transformation.py b/litellm/llms/openai/chat/gpt_transformation.py
index 8974a2a0746..c765f979794 100644
--- a/litellm/llms/openai/chat/gpt_transformation.py
+++ b/litellm/llms/openai/chat/gpt_transformation.py
@@ -125,6 +125,7 @@ class OpenAIGPTConfig(BaseLLMModelInfo, BaseConfig):
"max_retries",
"extra_headers",
"parallel_tool_calls",
+ "audio",
] # works across all models
model_specific_params = []
diff --git a/tests/llm_translation/test_optional_params.py b/tests/llm_translation/test_optional_params.py
index ad698e54c70..f59d4349022 100644
--- a/tests/llm_translation/test_optional_params.py
+++ b/tests/llm_translation/test_optional_params.py
@@ -1368,3 +1368,14 @@ def test_bedrock_invoke_anthropic_max_tokens():
assert "max_tokens_to_sample" not in optional_params
assert optional_params["max_tokens"] == 1024
+
+
+def test_azure_modalities_param():
+ optional_params = get_optional_params(
+ model="chatgpt-v2",
+ custom_llm_provider="azure",
+ modalities=["text", "audio"],
+ audio={"type": "audio_input", "input": "test.wav"},
+ )
+ assert optional_params["modalities"] == ["text", "audio"]
+ assert optional_params["audio"] == {"type": "audio_input", "input": "test.wav"}