diff --git a/dsp/utils/settings.py b/dsp/utils/settings.py index ea302f35aa..1fed723683 100644 --- a/dsp/utils/settings.py +++ b/dsp/utils/settings.py @@ -24,6 +24,7 @@ experimental=False, backoff_time=10, callbacks=[], + suppress_debug_info=True, ) diff --git a/dspy/clients/lm.py b/dspy/clients/lm.py index 567178432a..41b450abc5 100644 --- a/dspy/clients/lm.py +++ b/dspy/clients/lm.py @@ -6,7 +6,7 @@ from concurrent.futures import ThreadPoolExecutor from datetime import datetime from typing import Any, Dict, List, Literal, Optional - +import dspy import litellm import ujson @@ -61,6 +61,9 @@ def __init__( self.callbacks = callbacks or [] self.num_retries = num_retries + #turned off by default to avoid LiteLLM logging during every LM call + litellm.suppress_debug_info = dspy.settings.suppress_debug_info + # TODO: Arbitrary model strings could include the substring "o1-". We # should find a more robust way to check for the "o1-" family models. if "o1-" in model: