mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-27 03:34:10 +00:00
(fix) improve logging when no fallbacks found
This commit is contained in:
parent
0a5f8d564b
commit
c4ff2fcb4a
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()}"
|
f"An exception occurs: {e}\n\n Traceback{traceback.format_exc()}"
|
||||||
)
|
)
|
||||||
original_exception = e
|
original_exception = e
|
||||||
|
fallback_model_group = None
|
||||||
try:
|
try:
|
||||||
if (
|
if (
|
||||||
hasattr(e, "status_code") and e.status_code == 400
|
hasattr(e, "status_code") and e.status_code == 400
|
||||||
|
@ -807,6 +808,11 @@ class Router:
|
||||||
if list(item.keys())[0] == model_group:
|
if list(item.keys())[0] == model_group:
|
||||||
fallback_model_group = item[model_group]
|
fallback_model_group = item[model_group]
|
||||||
break
|
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:
|
for mg in fallback_model_group:
|
||||||
"""
|
"""
|
||||||
Iterate through the model groups and try calling that deployment
|
Iterate through the model groups and try calling that deployment
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue