{"record":{"id":"af9cbb27c4c95be6","repo":"BerriAI/litellm","slug":"no-db-connected-here-s-how-to-do-it-https-doc","errorCode":null,"errorMessage":"No DB Connected. Here's how to do it - https://docs.litellm.ai/docs/proxy/virtual_keys","messagePattern":"No DB Connected\\. Here's how to do it - https://docs\\.litellm\\.ai/docs/proxy/virtual_keys","errorType":"http","errorClass":"HTTPException","httpStatus":500,"severity":"error","filePath":"litellm/proxy/management_endpoints/model_management_endpoints.py","lineNumber":1573,"sourceCode":"        \"\"\"\n        [BETA] - This is a beta endpoint, format might change based on user feedback. - https://github.com/BerriAI/litellm/issues/964\n\n        - Check if id in db\n        - Delete\n        \"\"\"\n\n        from litellm.proxy.proxy_server import (\n            MODEL_RECONCILE_LOCK,\n            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,","sourceCodeStart":1555,"sourceCodeEnd":1591,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/management_endpoints/model_management_endpoints.py#L1555-L1591","documentation":"Infrastructure guard on the [BETA] model delete endpoint: prisma_client is None because no database is configured, but deletion operates on DB-stored models. Returns 500 with a docs link before any lookup.","triggerScenarios":"Thrown at litellm/proxy/management_endpoints/model_management_endpoints.py:1573 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set DATABASE_URL to a PostgreSQL connection string. See https://docs.litellm.ai/docs/proxy/virtual_keys."],"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"}