BerriAI/litellm · error · ProxyModelNotFoundError

{route}: Invalid model name passed in model={model_name}. Ca

Error message

{route}: Invalid model name passed in model={model_name}. Call `/v1/models` to view available models for your key.

What it means

Model resolution failure in the LLM request router: the model name in the request does not match any deployment (router lookup failed and the direct-call fallback also rejected it). The message directs the caller to /v1/models to list the models available to their key.

Source

Thrown at litellm/proxy/route_llm_request.py:675

                except Exception:
                    # If router fails (e.g., model not found in router), fall back to direct call
                    return getattr(litellm, f"{route_type}")(**data)
            elif _is_a2a_agent_model(data.get("model", "")):
                from litellm.proxy.agent_endpoints.a2a_routing import (
                    route_a2a_agent_request,
                )

                result: Final = await route_a2a_agent_request(data, route_type, user_api_key_dict=user_api_key_dict)
                if result is not None:
                    return result
                # Fall through to raise exception below if result is None

    elif user_model is not None or route_type == "allm_passthrough_route":
        return getattr(litellm, f"{route_type}")(**data)

    # if no route found then it's a bad request
    route_name: Final = ROUTE_ENDPOINT_MAPPING.get(route_type, route_type)
    raise ProxyModelNotFoundError(
        route=route_name,
        model_name=data.get("model", ""),
    )

View on GitHub (pinned to 77b7c6c40c)

Solutions

  1. Call GET /v1/models with your key and use one of the listed model names.
  2. Fix typos in the model field of the request.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at litellm/proxy/route_llm_request.py:675 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/397a9f76efc81ea9. Report an issue: GitHub.