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: replace asyncio.iscoroutinefunction with inspect.iscoroutinefunction

Julio Quinteros Pro6678b2bd1db7
diff --git a/litellm/litellm_core_utils/logging_utils.py b/litellm/litellm_core_utils/logging_utils.py
index bf43519afc6..8cde8ccef1c 100644
--- a/litellm/litellm_core_utils/logging_utils.py
+++ b/litellm/litellm_core_utils/logging_utils.py
@@ -1,5 +1,6 @@
import asyncio
import functools
+import inspect
import time
from datetime import datetime
from typing import TYPE_CHECKING, Any, List, Optional, Union
@@ -270,7 +271,7 @@ def track_llm_api_timing():
verbose_logger.debug(f"Error in service logging: {str(e)}")
# Check if the function is async or sync
- if asyncio.iscoroutinefunction(func):
+ if inspect.iscoroutinefunction(func):
return async_wrapper
return sync_wrapper