{"record":{"id":"fb2a4b653e7e5b90","repo":"BerriAI/litellm","slug":"model-not-found-fb2a4b","errorCode":null,"errorMessage":"model not found","messagePattern":"model not found","errorType":"exception","errorClass":"Exception","httpStatus":400,"severity":"error","filePath":"litellm/proxy/management_endpoints/model_management_endpoints.py","lineNumber":1934,"sourceCode":"        _model_id: str | None = None\n        _model_info: Final = getattr(model_params, \"model_info\", None)\n        if _model_info is None:\n            raise Exception(\"model_info not provided\")\n\n        _model_id = _model_info.id\n        if _model_id is None:\n            raise Exception(\"model_info.id not provided\")\n\n        _existing_litellm_params = await ModelRepository(prisma_client).table.find_unique(where={\"model_id\": _model_id})\n\n        if _existing_litellm_params is None:\n            if llm_router is not None and llm_router.get_deployment(model_id=_model_id) is not None:\n                raise HTTPException(\n                    status_code=400,\n                    detail={\"error\": \"Can't edit model. Model in config. Store model in db via `/model/new`. to edit.\"},\n                )\n            else:\n                raise Exception(\"model not found\")\n        deployment: Final = Deployment(**_existing_litellm_params.model_dump())\n\n        await ModelManagementAuthChecks.can_user_make_model_call(\n            model_params=deployment,\n            user_api_key_dict=user_api_key_dict,\n            prisma_client=prisma_client,\n            premium_user=premium_user,\n        )\n\n        _raise_on_strategy_router_write_violation(\n            incoming_params=model_params.litellm_params,\n            existing_params=deployment.litellm_params,\n        )\n\n        # update DB\n        if store_model_in_db is True:\n            _existing_litellm_params_dict: Final = dict(_existing_litellm_params.litellm_params)\n","sourceCodeStart":1916,"sourceCodeEnd":1952,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/management_endpoints/model_management_endpoints.py#L1916-L1952","documentation":"Guard in the model update endpoint raised after the DB lookup (ModelRepository.table.find_unique) found no LiteLLM_BrandedDeleteModelTable row for the supplied model_info.id and the in-memory llm_router also has no deployment with that model_id. It means the caller is trying to update a model that does not exist anywhere — a stale or fabricated model id, not a transport or auth problem. Re-check the model id or create the model first via /model/new.","triggerScenarios":"Thrown at litellm/proxy/management_endpoints/model_management_endpoints.py:1934 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the model id exists 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"}