Skip to content

Commit 08d9ece

Browse files
add flag to suppress litellm logs in dspy.LM (#1768)
* add flag to suppress litellm logs in dspy.LM * add suppress flag to dspy.configure
1 parent 863ebed commit 08d9ece

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

dsp/utils/settings.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
experimental=False,
2525
backoff_time=10,
2626
callbacks=[],
27+
suppress_debug_info=True,
2728
)
2829

2930

dspy/clients/lm.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from concurrent.futures import ThreadPoolExecutor
77
from datetime import datetime
88
from typing import Any, Dict, List, Literal, Optional
9-
9+
import dspy
1010
import litellm
1111
import ujson
1212

@@ -61,6 +61,9 @@ def __init__(
6161
self.callbacks = callbacks or []
6262
self.num_retries = num_retries
6363

64+
#turned off by default to avoid LiteLLM logging during every LM call
65+
litellm.suppress_debug_info = dspy.settings.suppress_debug_info
66+
6467
# TODO: Arbitrary model strings could include the substring "o1-". We
6568
# should find a more robust way to check for the "o1-" family models.
6669
if "o1-" in model:

0 commit comments

Comments
 (0)