mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 18:54:30 +00:00
(fix) improve logging when no fallbacks found
This commit is contained in:
parent
7742950c57
commit
ccd100fab3
1 changed files with 24 additions and 18 deletions
|
@ -768,6 +768,7 @@ class Router:
|
|||
f"An exception occurs: {e}\n\n Traceback{traceback.format_exc()}"
|
||||
)
|
||||
original_exception = e
|
||||
fallback_model_group = None
|
||||
try:
|
||||
if (
|
||||
hasattr(e, "status_code") and e.status_code == 400
|
||||
|
@ -807,6 +808,11 @@ class Router:
|
|||
if list(item.keys())[0] == model_group:
|
||||
fallback_model_group = item[model_group]
|
||||
break
|
||||
if fallback_model_group is None:
|
||||
self.print_verbose(
|
||||
f"No fallback model group found for original model_group={model_group}. Fallbacks={fallbacks}"
|
||||
)
|
||||
raise original_exception
|
||||
for mg in fallback_model_group:
|
||||
"""
|
||||
Iterate through the model groups and try calling that deployment
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue