{"record":{"id":"f87e04ef57b0382e","repo":"odysseus-dev/odysseus","slug":"no-cache-source-for-this-model","errorCode":null,"errorMessage":"No cache source for this model","messagePattern":"No cache source for this model","errorType":"http","errorClass":"HTTPException","httpStatus":400,"severity":"error","filePath":"routes/embedding_routes.py","lineNumber":231,"sourceCode":"        \"\"\"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:\n            model_path = _model_cache_path(hf_src)\n        except ValueError as e:\n            raise HTTPException(400, str(e))\n        if not model_path.is_dir():\n            return {\"deleted\": False, \"message\": \"Model not cached\"}\n\n        shutil.rmtree(model_path)\n        logger.info(f\"Deleted cached model: {model_name} ({model_path})\")\n        return {\"deleted\": True, \"model\": model_name}\n\n    @router.get(\"/endpoint\")\n    def get_endpoint():\n        \"\"\"Get the current custom embedding endpoint config.\"\"\"\n        saved = _load_custom_endpoint()\n        current_url = os.environ.get(\"EMBEDDING_URL\", \"\")\n        return {","sourceCodeStart":213,"sourceCodeEnd":249,"githubUrl":"https://github.com/odysseus-dev/odysseus/blob/f9235ebbf13f693a6fd29ce70b097f6ec83705bf/routes/embedding_routes.py#L213-L249","documentation":"Guard in delete_model: the model is in fastembed's catalog but its catalog entry has no HuggingFace source path, so the code cannot determine which cache directory to remove. Deletion is refused because the cache location for this model is unknown.","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":["Re-download the model instead of deleting its cache source.","Choose a model that was downloaded through the app so its cache can be managed."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f9235ebbf13f693a6fd29ce70b097f6ec83705bf","analyzedAt":"2026-08-14T21:47:48.359Z","contentChangedAt":"2026-08-14T21:47:48.359Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}