Commit e654c9f4 authored by Your Name's avatar Your Name

Fix litellm debug mode check to use runtime global_debug

parent c52d2e2b
...@@ -751,15 +751,12 @@ default_litellm_backend: Optional[LiteLLMBackend] = None ...@@ -751,15 +751,12 @@ default_litellm_backend: Optional[LiteLLMBackend] = None
# Turn on litellm debug mode if global debug is enabled # Turn on litellm debug mode if global debug is enabled
def _setup_litellm_debug(): def _setup_litellm_debug():
"""Turn on litellm debug mode if global debug is enabled.""" """Turn on litellm debug mode if global debug is enabled."""
global global_debug
try: try:
# Import global_args from coderai
import sys import sys
import os # Check if global_debug is True in coderai module at runtime
# Try to get global_args from the coderai module
if 'coderai' in sys.modules: if 'coderai' in sys.modules:
from coderai import global_debug as coderai_debug from coderai import global_debug
if coderai_debug: if global_debug:
import litellm import litellm
litellm._turn_on_debug() litellm._turn_on_debug()
print("DEBUG litellm: Debug mode enabled") print("DEBUG litellm: Debug mode enabled")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment