llama-swap

llama-swap

Docker app from PikkonMG's Repository

Overview

llama-swap is a lightweight proxy server that provides automatic model swapping for llama.cpp (llama-server). It hot-swaps models on demand based on API requests so you can serve many GGUF models from a single endpoint without restarting. Features: automatic model loading/unloading, macros, aliases, groups for multi-model concurrency, TTL auto-unload, streaming log viewer, and OpenAI-compatible API. SETUP: 1. Place your GGUF model files in the Models path below. 2. Create a config.yaml (see template https://github.com/PikkonMG/Unraid-docker-templates/blob/main/examples/llama-swap/example-llama-swap-config.yaml) and place it in the Config path. 3. In your config.yaml, reference models as /models/yourmodel.gguf 4. For NVIDIA GPU: install the Unraid Nvidia plugin, select the cuda tag, and set ExtraParams to: --gpus all 5. For AMD GPU: select the rocm tag and set ExtraParams to: --device /dev/kfd --device /dev/dri --group-add video --security-opt seccomp=unconfined 6. For Intel iGPU or other Vulkan-capable GPUs: select the vulkan tag and set ExtraParams to: --device /dev/dri 7. For CPU only: select the cpu tag and remove ExtraParams entirely

Runtime arguments

Web UI
http://[IP]:[PORT:8080]/ui
Network
bridge
Privileged
false
Extra Params
--gpus all

Template configuration

Web UI / API PortPorttcp

Port for the OpenAI-compatible API and log viewer web UI.

Target
8080
Default
8080
Value
8080
Models DirectoryPathro

Path to the folder containing your GGUF model files. Referenced in config.yaml as /models/filename.gguf

Target
/models
Default
/mnt/user/appdata/llama-swap/models
Value
/mnt/user/appdata/llama-swap/models
Config DirectoryPathrw

Path to the folder containing your config.yaml file. Hot-reload should be enabled via -watch-config.

Target
/config
Default
/mnt/user/appdata/llama-swap/config
Value
/mnt/user/appdata/llama-swap/config
NVIDIA_VISIBLE_DEVICESVariable

Which NVIDIA GPU(s) to expose. Use 'all' or a specific GPU UUID from the Nvidia plugin settings page. Only needed for NVIDIA tags.

Default
all
Value
all
NVIDIA_DRIVER_CAPABILITIESVariable

NVIDIA driver capabilities to expose. Use 'compute,utility' for LLM inference or 'all' for full access.

Default
all
Value
all

Details

Repository
ghcr.io/mostlygeek/llama-swap:cuda
Last Updated2026-06-01
First Seen2026-04-06

Run llama-swap on Unraid.

llama-swap is listed in Community Apps for Unraid OS. Explore Unraid to build a flexible home server, NAS, or homelab.