refactor: retry any 4xx or 5xx status

This commit is contained in:
Ian 2026-10-07 18:59:29 -04:00
parent c3fc173137
commit f7c4b5221e

View file

@ -184,9 +184,7 @@ def _is_transient_model_error(exc: BaseException) -> bool:
return True
code = _model_error_status_code(exc)
if code is not None:
import litellm
return 400 <= code < 500 or bool(litellm._should_retry(code))
return code >= 400
return isinstance(exc, APIError)