odysseus-dev/odysseus · error · HTTPException

Model is currently downloading

Error message

Model is currently downloading

What it means

Guard in delete_model: a download of this model is currently in progress (tracked in the _downloading set). Deleting mid-download would race with the writer and leave a corrupt cache, so deletion is refused with 400 until the download completes or fails.

Solutions

  1. Wait for the model download to finish, then delete it.
  2. Cancel the download first if deletion is urgent.
Defensive patterns

Strategy: validation

When it happens

Trigger: 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.

Common situations: See trigger scenarios.


AI-assisted analysis of odysseus-dev/odysseus@f9235ebbf1 (2026-08-14). Data as JSON: /api/errors/632c7a2a40f2099a. Report an issue: GitHub.

Appendix: source

Thrown at routes/embedding_routes.py:218

            raise HTTPException(404, f"Unknown model: {model_name}")

        hf_src = catalog[model_name].get("sources", {}).get("hf", "")
        downloaded = _is_downloaded(hf_src) if hf_src else False

        return {
            "model": model_name,
            "downloaded": downloaded,
            "downloading": model_name in _downloading,
        }

    @router.delete("/models/{model_name:path}")
    def delete_model(model_name: str):
        """Delete a cached model."""
        if model_name == _active_model():
            raise HTTPException(400, "Cannot delete the active embedding model")

        if model_name in _downloading:
            raise HTTPException(400, "Model is currently downloading")

        try:
            from fastembed import TextEmbedding
        except ImportError:
            raise HTTPException(503, "fastembed is not installed")

        catalog = {m["model"]: m for m in TextEmbedding.list_supported_models()}
        if model_name not in catalog:
            raise HTTPException(404, f"Unknown model: {model_name}")

        hf_src = catalog[model_name].get("sources", {}).get("hf", "")
        if not hf_src:
            raise HTTPException(400, "No cache source for this model")

        try:
            model_path = _model_cache_path(hf_src)
        except ValueError as e:
            raise HTTPException(400, str(e))

View on GitHub (pinned to f9235ebbf1)