diff --git a/litellm/proxy/common_utils/performance_utils.py b/litellm/proxy/common_utils/performance_utils.py index 987efb82922..f9537f85e2b 100644 --- a/litellm/proxy/common_utils/performance_utils.py +++ b/litellm/proxy/common_utils/performance_utils.py @@ -160,7 +160,9 @@ def wrap_function_with_line_profiler(module: Any, function_name: str) -> bool: Returns: True if wrapping was successful, False otherwise """ - if not enable_line_profiler(): + try: + enable_line_profiler() # May raise ImportError if not available + except ImportError: return False if _line_profiler is None: