BerriAI/litellm · error · HTTPException

Model(s) not found: {', '.join(missing_models)}

Error message

Model(s) not found: {', '.join(missing_models)}

What it means

Existence guard on the model_names path: validate_models_exist compared the submitted names against the live llm_router and at least one name has no matching deployment. The missing names are listed in the message; use model_ids for precise targeting.

Source

Thrown at litellm/proxy/management_endpoints/model_access_group_management_endpoints.py:399

    if not has_model_names and not has_model_ids:
        raise HTTPException(
            status_code=400,
            detail={"error": "Either model_names or model_ids must be provided and non-empty"},
        )

    # If model_ids is provided, use it (more precise targeting)
    use_model_ids: Final = has_model_ids

    # Validate model_names exist in router (only if using model_names path)
    if not use_model_ids and has_model_names:
        assert data.model_names is not None
        all_valid, missing_models = validate_models_exist(
            model_names=data.model_names,
            llm_router=llm_router,
        )

        if not all_valid:
            raise HTTPException(
                status_code=400,
                detail={"error": f"Model(s) not found: {', '.join(missing_models)}"},
            )

    # Check if database is connected
    if prisma_client is None:
        raise HTTPException(
            status_code=500,
            detail={"error": "Database not connected. Cannot create access group."},
        )

    try:
        # Check if access group already exists
        existing_access_groups: Final = await get_all_access_groups_from_db(prisma_client=prisma_client)

        if data.access_group in existing_access_groups:
            raise HTTPException(
                status_code=409,

View on GitHub (pinned to 77b7c6c40c)

Solutions

  1. Create the missing models first, or correct the model names to existing ones.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at litellm/proxy/management_endpoints/model_access_group_management_endpoints.py:399 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/a30b2ba72cf51b35. Report an issue: GitHub.