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]

fix(o_series_handler.py): handle async calls

Krrish Dholakia16224f8db6f6
diff --git a/litellm/llms/azure/chat/o_series_handler.py b/litellm/llms/azure/chat/o_series_handler.py
index 4464432faf8..2f3e9e63996 100644
--- a/litellm/llms/azure/chat/o_series_handler.py
+++ b/litellm/llms/azure/chat/o_series_handler.py
@@ -45,6 +45,7 @@ class AzureOpenAIO1ChatCompletion(BaseAzureLLM, OpenAIChatCompletion):
api_base=api_base,
api_version=api_version,
client=client,
+ _is_async=acompletion,
)
return super().completion(
model_response=model_response,
diff --git a/tests/llm_translation/base_llm_unit_tests.py b/tests/llm_translation/base_llm_unit_tests.py
index f91ef0eae91..32f631daad6 100644
--- a/tests/llm_translation/base_llm_unit_tests.py
+++ b/tests/llm_translation/base_llm_unit_tests.py
@@ -868,10 +868,13 @@ class BaseLLMChatTest(ABC):
except Exception as e:
pytest.fail(f"Error occurred: {e}")
+ @pytest.mark.flaky(retries=3, delay=1)
@pytest.mark.asyncio
async def test_completion_cost(self):
from litellm import completion_cost
+ litellm._turn_on_debug()
+
os.environ["LITELLM_LOCAL_MODEL_COST_MAP"] = "True"
litellm.model_cost = litellm.get_model_cost_map(url="")