jamiepine/voicebox · error · HTTPException

{display} model is not downloaded yet. Use /generate to trig

Error message

{display} model is not downloaded yet. Use /generate to trigger a download.

What it means

Raised as HTTPException(400) by the else branch of ensure_model_cached_or_raise() for single-size engines (luxtts, chatterbox, chatterbox_turbo, kokoro) when _is_model_cached() (no arg) returns False. The detail uses cfg.display_name if a ModelConfig matched, otherwise the raw engine string, so the message names the human-readable model.

Source

Thrown at backend/backends/__init__.py:559

    from fastapi import HTTPException

    backend = get_tts_backend_for_engine(engine)
    cfg = None
    for c in get_tts_model_configs():
        if c.engine == engine and c.model_size == model_size:
            cfg = c
            break

    if engine in ("qwen", "qwen_custom_voice", "tada"):
        if not backend._is_model_cached(model_size):
            raise HTTPException(
                status_code=400,
                detail=f"Model {model_size} is not downloaded yet. Use /generate to trigger a download.",
            )
    else:
        if not backend._is_model_cached():
            display = cfg.display_name if cfg else engine
            raise HTTPException(
                status_code=400,
                detail=f"{display} model is not downloaded yet. Use /generate to trigger a download.",
            )


def unload_model_by_config(config: ModelConfig) -> bool:
    """Unload a model given its config. Returns True if it was loaded, False otherwise."""
    from . import get_tts_backend_for_engine
    from ..services import tts, transcribe, llm as llm_service

    if config.engine == "whisper":
        whisper_model = transcribe.get_whisper_model()
        if whisper_model.is_loaded() and whisper_model.model_size == config.model_size:
            transcribe.unload_whisper_model()
            return True
        return False

    if config.engine == "qwen_llm":

View on GitHub (pinned to 51f49dea19)

Solutions

  1. Run /generate once for that engine to trigger the download before streaming.
  2. Download the engine via the model-management UI.
  3. Confirm the engine's model config exists in get_tts_model_configs() so display_name (not the raw key) shows.
  4. Verify the cache directory and _is_model_cached() detection logic for that engine.

Example fix

# before
raise HTTPException(status_code=400, detail=f"{display} model is not downloaded yet. Use /generate to trigger a download.")
# after
raise HTTPException(
    status_code=400,
    detail=f"{display} model is not downloaded yet. Use /generate to trigger a download, or choose an installed engine.",
)
Defensive patterns

Strategy: validation

Validate before calling

def single_size_engine_ready(engine: str) -> bool:
    backend = get_tts_backend_for_engine(engine)
    return backend._is_model_cached()

# Before streaming for luxtts/chatterbox/kokoro:
if not single_size_engine_ready(engine):
    await load_engine_model(engine)

Try / catch

from fastapi import HTTPException
try:
    await ensure_model_cached_or_raise(engine, model_size)
except HTTPException as e:
    if e.status_code == 400:
        await load_engine_model(engine)
    else:
        raise

Prevention

When it happens

Trigger: Streaming endpoint called for a single-size engine whose weights are not on disk. cfg is found via get_tts_model_configs() matching engine+model_size; its display_name is interpolated. If no config matched (unknown model_size for that engine), `engine` itself is used.

Common situations: Fresh install without the chosen engine downloaded. User switched default engine in settings but never downloaded it. Cache directory moved/cleared. A config table mismatch means display_name falls back to the engine key.

Related errors


AI-assisted analysis of jamiepine/voicebox@51f49dea19 (2026-08-12). Data as JSON: /api/errors/d583cf92d4f57d75. Report an issue: GitHub.