{"record":{"id":"96c307b6bf40c683","repo":"BerriAI/litellm","slug":"deployment-with-model-id-model-id-not-found-in","errorCode":null,"errorMessage":"Deployment with model_id '{model_id}' not found in Database.","messagePattern":"Deployment with model_id '(.+?)' not found in Database\\.","errorType":"http","errorClass":"HTTPException","httpStatus":400,"severity":"error","filePath":"litellm/proxy/management_endpoints/model_access_group_management_endpoints.py","lineNumber":252,"sourceCode":"    deployment actually written.\n    \"\"\"\n    verbose_proxy_logger.debug(\"Updating specific deployment model_ids: %s\", model_ids)\n    tagged: Final = [\n        await _tag_deployment_with_access_group(\n            model_id=model_id,\n            model_info=(await _find_deployment_or_400(model_id=model_id, prisma_client=prisma_client)),\n            access_group=access_group,\n            prisma_client=prisma_client,\n        )\n        for model_id in model_ids\n    ]\n    return tuple(pair for pair in tagged if pair is not None)\n\n\nasync def _find_deployment_or_400(model_id: str, prisma_client: PrismaClient) -> object:\n    deployment: Final = await _model_table(prisma_client).find_unique(where={\"model_id\": model_id})\n    if deployment is None:\n        raise HTTPException(\n            status_code=400,\n            detail={\"error\": f\"Deployment with model_id '{model_id}' not found in Database.\"},\n        )\n    return deployment.model_info\n\n\ndef remove_access_group_from_deployment(model_info: dict[str, Any], access_group: str) -> tuple[dict[str, Any], bool]:\n    \"\"\"\n    Remove an access group from a deployment's model_info.\n\n    Args:\n        model_info: The model_info dictionary from the deployment\n        access_group: The access group name to remove\n\n    Returns:\n        Tuple[Dict[str, Any], bool]: (updated_model_info, was_modified)\n    \"\"\"\n    access_groups: Final = model_info.get(\"access_groups\", [])","sourceCodeStart":234,"sourceCodeEnd":270,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/management_endpoints/model_access_group_management_endpoints.py#L234-L270","documentation":"Lookup guard in _find_deployment_or_400: no DB row matches the given model_id, so the specific deployment cannot be tagged with the access group. Fired when model_ids targeting references a deleted or mistyped deployment.","triggerScenarios":"Thrown at litellm/proxy/management_endpoints/model_access_group_management_endpoints.py:252 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the model_id exists in the database via /model/info."],"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"}