catch litellm no deployment error (token ratelimit / ValueError) and raise LLMProviderErrorRetryableTask (#758)

This commit is contained in:
Shuchang Zheng
2024-08-29 12:19:51 -07:00
committed by GitHub
parent 6f61573f9b
commit 06daa9834f

View File

@@ -108,6 +108,13 @@ class LLMAPIHandlerFactory:
LOG.info("LLM API call successful", llm_key=llm_key, model=llm_config.model_name)
except litellm.exceptions.APIError as e:
raise LLMProviderErrorRetryableTask(llm_key) from e
except ValueError as e:
LOG.exception(
"LLM token limit exceeded",
llm_key=llm_key,
model=main_model_group,
)
raise LLMProviderErrorRetryableTask(llm_key) from e
except Exception as e:
LOG.exception(
"LLM request failed unexpectedly",