Skip to content

    Model admin API

    The model-admin routes list the available Whisper presets and switch the resident model without restarting the container. Both require the bearer key when API_KEY is set. They are not gated on model readiness, so you can switch models even while the current one is warming or failed.

    Returns the active model, the currently loaded model, and the selectable presets.

    Terminal window
    curl -H 'Authorization: Bearer change-me' \
    http://localhost:8000/api/model/presets

    Response shape:

    {
    "active": "large-v3",
    "loaded": "large-v3",
    "presets": [
    { "size": "tiny", "label": "Tiny", "params": "39M" },
    { "size": "large-v3-turbo", "label": "Large v3 Turbo", "params": "809M" }
    ]
    }
    SizeLabelParameters
    tinyTiny39M
    baseBase74M
    smallSmall244M
    mediumMedium769M
    large-v3Large v31550M
    large-v3-turboLarge v3 Turbo809M
    distil-large-v3Distil Large v3756M

    A custom MODEL_SIZE that is not in this list is also selectable and is prepended to the presets.

    Switches the resident model. Body: {"size": "<preset or configured size>"}.

    Terminal window
    curl -X POST http://localhost:8000/api/model/activate \
    -H 'Authorization: Bearer change-me' \
    -H 'Content-Type: application/json' \
    -d '{"size": "large-v3-turbo"}'

    On success returns 200 with the updated presets info ({"active": "large-v3-turbo", "loaded": "large-v3-turbo", ...}). The switch unloads the current model, frees GPU memory, and loads the requested one — a size that is not baked in is downloaded on first activation. The choice is persisted to <DATA_DIR>/active_model and resumed on restart.

    StatusCodeCause
    400invalid_modelSize is not a known preset or the configured MODEL_SIZE
    401Missing/invalid bearer key
    503model_load_failedThe requested model failed to load