File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -78,6 +78,8 @@ def language_detector(text: str) -> None:
7878max_lines = 100_000
7979min_lang_prob = 0.50
8080
81+ printed_unexpected_api_keys = False # to print it only once
82+
8183# loader specific arguments
8284loader_specific_keys = {
8385 "anki_deck" : str ,
@@ -212,10 +214,12 @@ def wrapped_model_name_matcher(model: str) -> str:
212214 for k , v in dict (os .environ ).items ():
213215 if k .endswith ("_API_KEY" ):
214216 backend = k .split ("_API_KEY" )[0 ].lower ()
215- if backend not in all_backends and is_verbose :
217+ if backend not in all_backends and is_verbose and not printed_unexpected_api_keys :
216218 yel (f"Found API_KEY for backend { backend } that is not a known backend for litellm." )
217219 else :
218220 backends .append (backend )
221+ if is_verbose :
222+ printed_unexpected_api_keys = True
219223 assert backends , "No API keys found in environnment"
220224
221225 # filter by providers
You can’t perform that action at this time.
0 commit comments