BerriAI/litellm · error · NotFoundError

NotFoundError

Error message

NotFoundError: {exception_provider} - {message}

What it means

Generic provider status-code mapping: an upstream exception with HTTP 404 is re-raised as LiteLLM's NotFoundError, preserving the provider name and original message so callers get a normalized 404-class error.

Solutions

  1. Verify the model name and endpoint exist for this provider; the resource was not found.
  2. Check for typos in model/deployment names and API base URLs.
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at litellm/litellm_core_utils/exception_mapping_utils.py:417 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/02693f27162dd26a. Report an issue: GitHub.

Appendix: source

Thrown at litellm/litellm_core_utils/exception_mapping_utils.py:417

    elif hasattr(original_exception, "status_code"):
        if original_exception.status_code == 400:
            raise BadRequestError(
                message=f"{exception_provider} - {message}",
                llm_provider=custom_llm_provider,
                model=model,
                response=getattr(original_exception, "response", None),
                litellm_debug_info=extra_information,
            )
        elif original_exception.status_code == 401:
            raise AuthenticationError(
                message=f"AuthenticationError: {exception_provider} - {message}",
                llm_provider=custom_llm_provider,
                model=model,
                response=getattr(original_exception, "response", None),
                litellm_debug_info=extra_information,
            )
        elif original_exception.status_code == 404:
            raise NotFoundError(
                message=f"NotFoundError: {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 == 408:
            raise Timeout(
                message=f"Timeout Error: {exception_provider} - {message}",
                model=model,
                llm_provider=custom_llm_provider,
                litellm_debug_info=extra_information,
            )
        elif original_exception.status_code == 422:
            raise BadRequestError(
                message=f"{exception_provider} - {message}",
                model=model,
                llm_provider=custom_llm_provider,

View on GitHub (pinned to 77b7c6c40c)