Features / 3 of 14

Basics

Swapping models on demand

How llama-swap decides a model is ready.

When a request asks for a model that is not running, llama-swap stops the running one, starts the new one, and holds the request until the new server answers its health check. By default it polls /health on the server.

# seconds to wait for a model to become ready (default 120)
healthCheckTimeout: 300

# show "loading…" messages in chat clients while a model starts
sendLoadingState: true

models:
  qwen:
    cmd: llama-server --port ${PORT} -m /models/qwen3-8b.gguf
    # the server's health endpoint, if it is not /health
    checkEndpoint: /health

Clients see a slow first response and nothing else: no errors, no retries. sendLoadingState sends loading progress in the reasoning field, so chat apps like Open WebUI show that the model is starting.

If a model never becomes ready, its server log explains why. The web UI's Logs page shows it, as does curl localhost:8080/logs/stream/qwen.

Ask the llama

“How does llama-swap know when a model has finished loading?”

Ask the llama