Features / 13 of 14

Advanced

Preloading at startup

Have models ready before the first request.

The on_startup hook loads models, and can pick a profile, as soon as llama-swap starts. The first request then does not wait for a model to load.

hooks:
  on_startup:
    profile: coding       # activate this profile at startup and on reload
    preload:
      - qwen
      - embeddings

routing:
  router:
    use: group
    settings:
      groups:
        warm:
          swap: false
          exclusive: false
          members: [qwen, embeddings]

Preloading several models only keeps them all loaded if they are allowed to run together. Without the group above, loading embeddings would unload qwen. Give preloaded models ttl: 0 if they should never unload.

Ask the llama

“How do I load a model when llama-swap starts?”

Ask the llama