BerriAI/litellm · error · HTTPException

Can't find model '{model_name}' in Database. Access group ma

Error message

Can't find model '{model_name}' in Database. Access group management is only supported for database models.

What it means

Prerequisite guard in access-group management: the requested model_name has no rows in the LiteLLM database (PrismaModelTable), so there is no deployment to tag with the access group. Access groups only apply to DB-stored models, not config.yaml models.

Source

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

    """
    Update all deployments for the given model names to include the access group.

    Args:
        model_names: List of model names whose deployments should be updated
        access_group: The access group name to add
        prisma_client: Database client

    Returns:
        The (model_id, updated model_info) pair of every deployment actually written,
        so callers can verify each one survived the post-write reload
    """
    deployments: Final = await _model_table(prisma_client).find_many(where={"model_name": {"in": model_names}})
    verbose_proxy_logger.debug("Found %s deployments for model_names: %s", len(deployments), model_names)

    found_names: Final = {deployment.model_name for deployment in deployments}
    for model_name in model_names:
        if model_name not in found_names:
            raise HTTPException(
                status_code=400,
                detail={
                    "error": f"Can't find model '{model_name}' in Database. Access group management is only supported for database models."
                },
            )

    tagged: Final = [
        await _tag_deployment_with_access_group(
            model_id=deployment.model_id,
            model_info=deployment.model_info,
            access_group=access_group,
            prisma_client=prisma_client,
        )
        for deployment in deployments
    ]
    return tuple(pair for pair in tagged if pair is not None)

View on GitHub (pinned to 77b7c6c40c)

Solutions

  1. Create the model in the database first (POST /model/new), then manage its access group.
  2. Access groups only work for database models, not config-file models.
Defensive patterns

Strategy: validation

When it happens

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