BerriAI/litellm · error · HTTPException

Only proxy admins can update public model groups. Your role=

Error message

Only proxy admins can update public model groups. Your role={user_api_key_dict.user_role}

What it means

Raised in the public-model-groups update endpoint when the caller's role is not PROXY_ADMIN. Public agent groups are shared, proxy-wide routing surface, so mutating them is restricted to proxy admins; the caller's actual role is embedded. It is the public-groups counterpart of the general agent-management permission check.

Source

Thrown at litellm/proxy/agent_endpoints/endpoints.py:865

    }
    ```
    """
    from litellm.proxy.proxy_server import prisma_client

    if prisma_client is None:
        raise HTTPException(status_code=500, detail=CommonProxyErrors.db_not_connected_error.value)

    try:
        # Update the public model groups
        import litellm
        from litellm.proxy.agent_endpoints.agent_registry import (
            global_agent_registry as AGENT_REGISTRY,
        )
        from litellm.proxy.proxy_server import proxy_config

        # Check if user has admin permissions
        if user_api_key_dict.user_role != LitellmUserRoles.PROXY_ADMIN:
            raise HTTPException(
                status_code=403,
                detail={
                    "error": f"Only proxy admins can update public model groups. Your role={user_api_key_dict.user_role}"
                },
            )

        agent = AGENT_REGISTRY.get_agent_by_id(agent_id=agent_id)
        if agent is None:
            # check if agent exists in DB
            agent = await agents_table(prisma_client).find_unique(where={"agent_id": agent_id})
            if agent is not None:
                agent = AgentResponse(**agent.model_dump())

            if agent is None:
                raise HTTPException(status_code=404, detail=f"Agent with ID {agent_id} not found")

        if litellm.public_agent_groups is None:
            litellm.public_agent_groups = []

View on GitHub (pinned to 77b7c6c40c)

Solutions

  1. Use a key with the PROXY_ADMIN role to update public model groups.

Example fix

Retry with an admin key.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at litellm/proxy/agent_endpoints/endpoints.py:865 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/2676e7d0a5bdcb71. Report an issue: GitHub.