Skip to content

Commit ddb1e12

Browse files
authored
fix: litellm logging spam (#792)
1 parent be7e520 commit ddb1e12

File tree

1 file changed

+10
-3
lines changed
  • packages/ragbits-core/src/ragbits/core/llms

1 file changed

+10
-3
lines changed

packages/ragbits-core/src/ragbits/core/llms/litellm.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,16 @@ def __init__(
106106
else:
107107

108108
def download_and_register_model_cost() -> None:
109-
litellm.register_model(
110-
model_cost="https://raw.githubusercontent.com/BerriAI/litellm/main/model_prices_and_context_window.json"
111-
)
109+
# Suppress debug info to prevent "Provider List" messages during registration
110+
original_suppress_debug = litellm.suppress_debug_info
111+
litellm.suppress_debug_info = True
112+
try:
113+
litellm.register_model(
114+
model_cost="https://raw.githubusercontent.com/BerriAI/litellm/main/model_prices_and_context_window.json"
115+
)
116+
finally:
117+
# Restore original setting
118+
litellm.suppress_debug_info = original_suppress_debug
112119

113120
thread = threading.Thread(target=download_and_register_model_cost, daemon=True)
114121
thread.start()

0 commit comments

Comments
 (0)