diff --git a/litellm/__init__.py b/litellm/__init__.py index b9cf85a55e4..837ca2b0132 100644 --- a/litellm/__init__.py +++ b/litellm/__init__.py @@ -2,6 +2,7 @@ import threading, requests from typing import Callable, List, Optional, Dict, Union, Any from litellm.caching import Cache +from litellm._logging import set_verbose import httpx input_callback: List[Union[str, Callable]] = [] @@ -11,7 +12,6 @@ callbacks: List[Callable] = [] _async_success_callback: List[Callable] = [] # internal variable - async custom callbacks are routed here. pre_call_rules: List[Callable] = [] post_call_rules: List[Callable] = [] -set_verbose = False email: Optional[ str ] = None # Not used anymore, will be removed in next MAJOR release - https://github.com/BerriAI/litellm/discussions/648 diff --git a/litellm/_logging.py b/litellm/_logging.py new file mode 100644 index 00000000000..fd21d22e355 --- /dev/null +++ b/litellm/_logging.py @@ -0,0 +1,5 @@ +set_verbose = False + +def print_verbose(print_statement): + if set_verbose: + print(print_statement) \ No newline at end of file diff --git a/litellm/health_check.py b/litellm/health_check.py index 08cbffed53e..308382347d6 100644 --- a/litellm/health_check.py +++ b/litellm/health_check.py @@ -4,7 +4,7 @@ from typing import Optional import litellm import logging -from concurrent.futures import ThreadPoolExecutor +from litellm._logging import print_verbose logger = logging.getLogger(__name__) @@ -47,7 +47,7 @@ async def _perform_health_check(model_list: list): try: await litellm.acompletion(**model_params) except Exception as e: - logger.exception("Health check failed for model %s", model_params["model"]) + print_verbose(f"Health check failed for model {model_params['model']}. Error: {e}") return False return True