{"record":{"id":"8191174843c78a84","repo":"BerriAI/litellm","slug":"model-with-id-model-info-id-not-found-in-db","errorCode":null,"errorMessage":"Model with id={model_info.id} not found in db","messagePattern":"Model with id=(.+?) not found in db","errorType":"http","errorClass":"HTTPException","httpStatus":400,"severity":"error","filePath":"litellm/proxy/management_endpoints/model_management_endpoints.py","lineNumber":1582,"sourceCode":"            llm_router,\n            premium_user,\n            prisma_client,\n            proxy_logging_obj,\n            store_model_in_db,\n            user_api_key_cache,\n        )\n\n        if prisma_client is None:\n            raise HTTPException(\n                status_code=500,\n                detail={\n                    \"error\": \"No DB Connected. Here's how to do it - https://docs.litellm.ai/docs/proxy/virtual_keys\"\n                },\n            )\n\n        model_in_db: Final = await ModelRepository(prisma_client).table.find_unique(where={\"model_id\": model_info.id})\n        if model_in_db is None:\n            raise HTTPException(\n                status_code=400,\n                detail={\"error\": f\"Model with id={model_info.id} not found in db\"},\n            )\n\n        model_params: Final = Deployment(**model_in_db.model_dump())\n        await ModelManagementAuthChecks.can_user_make_model_call(\n            model_params=model_params,\n            user_api_key_dict=user_api_key_dict,\n            prisma_client=prisma_client,\n            premium_user=premium_user,\n            allow_missing_team=True,\n        )\n\n        # update DB\n        if store_model_in_db is True:\n            \"\"\"\n            - store model_list in db\n            - store keys separately","sourceCodeStart":1564,"sourceCodeEnd":1600,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/management_endpoints/model_management_endpoints.py#L1564-L1600","documentation":"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.","triggerScenarios":"Thrown at litellm/proxy/management_endpoints/model_management_endpoints.py:1582 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify model_info.id matches an existing model in the database."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}