BerriAI/litellm · error · InternalServerError
InternalServerError
Error message
InternalServerError: {exception_provider} - {message} What it means
Generic provider status-code mapping: an upstream exception with HTTP 500 is re-raised as LiteLLM's InternalServerError, preserving provider and message so callers get a normalized 5xx-class error.
Solutions
- The provider returned a 5xx error; retry with backoff.
- Check the provider's status page; if persistent, contact the provider.
Defensive patterns
Strategy: retry
When it happens
Trigger: Thrown at litellm/litellm_core_utils/exception_mapping_utils.py:449 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of BerriAI/litellm@77b7c6c40c (2026-08-18).
Data as JSON: /api/errors/b8a8a8075db42536.
Report an issue: GitHub.
Appendix: source
Thrown at litellm/litellm_core_utils/exception_mapping_utils.py:449
elif original_exception.status_code == 422:
raise BadRequestError(
message=f"{exception_provider} - {message}",
model=model,
llm_provider=custom_llm_provider,
response=getattr(original_exception, "response", None),
litellm_debug_info=extra_information,
body=getattr(original_exception, "body", None),
)
elif original_exception.status_code == 429:
raise RateLimitError(
message=f"RateLimitError: {exception_provider} - {message}",
model=model,
llm_provider=custom_llm_provider,
response=getattr(original_exception, "response", None),
litellm_debug_info=extra_information,
)
elif original_exception.status_code == 500:
raise InternalServerError(
message=f"InternalServerError: {exception_provider} - {message}",
model=model,
llm_provider=custom_llm_provider,
response=getattr(original_exception, "response", None),
litellm_debug_info=extra_information,
)
elif original_exception.status_code == 502:
raise BadGatewayError(
message=f"BadGatewayError: {exception_provider} - {message}",
model=model,
llm_provider=custom_llm_provider,
response=getattr(original_exception, "response", None),
litellm_debug_info=extra_information,
)
elif original_exception.status_code == 503:
raise ServiceUnavailableError(
message=f"ServiceUnavailableError: {exception_provider} - {message}",
model=model,View on GitHub (pinned to 77b7c6c40c)