refactor: remove debug prints and add lazy litellm loading verbosity flag

This commit is contained in:
Paul Gauthier 2024-12-04 09:38:20 -08:00 committed by Paul Gauthier (aider)
parent d09d281a8d
commit 974e618541
2 changed files with 5 additions and 2 deletions

View file

@ -13,6 +13,8 @@ os.environ["LITELLM_MODE"] = "PRODUCTION"
# `import litellm` takes 1.5 seconds, defer it!
VERBOSE = False
class LazyLiteLLM:
_lazy_module = None
@ -27,6 +29,9 @@ class LazyLiteLLM:
if self._lazy_module is not None:
return
if VERBOSE:
print("Loading litellm...")
self._lazy_module = importlib.import_module("litellm")
self._lazy_module.suppress_debug_info = True