BerriAI/litellm · error · HTTPException

Model with id={model_info.id} not found in db

Error message

Model with id={model_info.id} not found in db

What it means

Lookup failure in model update: no model row with model_info.id exists in the database (it may exist only in config), so the DB update has no target.

Source

Thrown at litellm/proxy/management_endpoints/model_management_endpoints.py:1582

            llm_router,
            premium_user,
            prisma_client,
            proxy_logging_obj,
            store_model_in_db,
            user_api_key_cache,
        )

        if prisma_client is None:
            raise HTTPException(
                status_code=500,
                detail={
                    "error": "No DB Connected. Here's how to do it - https://docs.litellm.ai/docs/proxy/virtual_keys"
                },
            )

        model_in_db: Final = await ModelRepository(prisma_client).table.find_unique(where={"model_id": model_info.id})
        if model_in_db is None:
            raise HTTPException(
                status_code=400,
                detail={"error": f"Model with id={model_info.id} not found in db"},
            )

        model_params: Final = Deployment(**model_in_db.model_dump())
        await ModelManagementAuthChecks.can_user_make_model_call(
            model_params=model_params,
            user_api_key_dict=user_api_key_dict,
            prisma_client=prisma_client,
            premium_user=premium_user,
            allow_missing_team=True,
        )

        # update DB
        if store_model_in_db is True:
            """
            - store model_list in db
            - store keys separately

View on GitHub (pinned to 77b7c6c40c)

Solutions

  1. Verify model_info.id matches an existing model in the database.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at litellm/proxy/management_endpoints/model_management_endpoints.py:1582 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/8191174843c78a84. Report an issue: GitHub.