{"record":{"id":"103cc2a8233b39ca","repo":"odysseus-dev/odysseus","slug":"cannot-delete-the-active-embedding-model","errorCode":null,"errorMessage":"Cannot delete the active embedding model","messagePattern":"Cannot delete the active embedding model","errorType":"http","errorClass":"HTTPException","httpStatus":400,"severity":"error","filePath":"routes/embedding_routes.py","lineNumber":215,"sourceCode":"\n        catalog = {m[\"model\"]: m for m in TextEmbedding.list_supported_models()}\n        if model_name not in catalog:\n            raise HTTPException(404, f\"Unknown model: {model_name}\")\n\n        hf_src = catalog[model_name].get(\"sources\", {}).get(\"hf\", \"\")\n        downloaded = _is_downloaded(hf_src) if hf_src else False\n\n        return {\n            \"model\": model_name,\n            \"downloaded\": downloaded,\n            \"downloading\": model_name in _downloading,\n        }\n\n    @router.delete(\"/models/{model_name:path}\")\n    def delete_model(model_name: str):\n        \"\"\"Delete a cached model.\"\"\"\n        if model_name == _active_model():\n            raise HTTPException(400, \"Cannot delete the active embedding model\")\n\n        if model_name in _downloading:\n            raise HTTPException(400, \"Model is currently downloading\")\n\n        try:\n            from fastembed import TextEmbedding\n        except ImportError:\n            raise HTTPException(503, \"fastembed is not installed\")\n\n        catalog = {m[\"model\"]: m for m in TextEmbedding.list_supported_models()}\n        if model_name not in catalog:\n            raise HTTPException(404, f\"Unknown model: {model_name}\")\n\n        hf_src = catalog[model_name].get(\"sources\", {}).get(\"hf\", \"\")\n        if not hf_src:\n            raise HTTPException(400, \"No cache source for this model\")\n\n        try:","sourceCodeStart":197,"sourceCodeEnd":233,"githubUrl":"https://github.com/odysseus-dev/odysseus/blob/f9235ebbf13f693a6fd29ce70b097f6ec83705bf/routes/embedding_routes.py#L197-L233","documentation":"Error \"Cannot delete the active embedding model\" thrown in odysseus-dev/odysseus.","triggerScenarios":"Triggered when the corresponding server-side validation or runtime check at the recorded location rejects the request or operation and returns this error message to the caller.","commonSituations":"See trigger scenarios.","solutions":["Activate a different embedding model first, then delete this one.","Keep the active model installed; delete only inactive models."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f9235ebbf13f693a6fd29ce70b097f6ec83705bf","analyzedAt":"2026-08-14T21:47:48.359Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}