BerriAI/litellm · error · HTTPException

The model `{model_id}` does not exist or is not accessible

Error message

The model `{model_id}` does not exist or is not accessible

What it means

Single-model access check: the requested model_id is not in the caller's available_models list, meaning it is not deployed on this proxy or the key/team lacks permission. Returned as 404 so clients treat it as unknown/inaccessible rather than a transient error.

Source

Thrown at litellm/proxy/utils.py:7088

    Raises:
        HTTPException: If the model is not accessible
    """
    # Handle batch requests with comma-separated models
    if "," in model_id:
        models: Final = [m.strip() for m in model_id.split(",")]
        inaccessible_models: Final = [m for m in models if m not in available_models]
        if inaccessible_models:
            raise HTTPException(
                status_code=404,
                detail="The following model(s) do not exist or are not accessible: {}".format(
                    ", ".join(inaccessible_models)
                ),
            )
    else:
        # Single model validation
        if model_id not in available_models:
            raise HTTPException(
                status_code=404,
                detail=f"The model `{model_id}` does not exist or is not accessible",
            )


_PRESERVED_NONE_FIELDS: Final[list[tuple[str, str]]] = [
    ("message", "content"),  # null when tool_calls present (issue #6677)
    ("message", "role"),  # always required by OpenAI spec
    ("delta", "content"),  # null in streaming chunks
]


def model_dump_with_preserved_fields(
    obj: Any,
    preserve_fields: list[str] | None = None,
    exclude_unset: bool = True,
) -> dict[str, object]:
    """

View on GitHub (pinned to 77b7c6c40c)

Solutions

  1. Verify the model_id exists in the proxy configuration and your key/team is allowed to access it.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at litellm/proxy/utils.py:7088 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/75776191e4efb838. Report an issue: GitHub.