llama-swap
Hot-swap proxy that runs many local AI servers behind one OpenAI- and Anthropic-compatible API.
Quick answer
llama-swap is a hot-swap proxy that runs many local AI servers behind one OpenAI- and Anthropic-compatible API, listed under Local model runtimes. A typical small-business use: serve many GGUF or vLLM models on one machine without leaving them all loaded. The project publishes no official RAM figure, so we do not estimate a monthly server cost. License: MIT, which allows internal business use.
Last updated · facts verified against official docs on · sources
Activity data comes from GitHub and was last refreshed Nov 23, 2026.
What is llama-swap?
llama-swap is a single Go binary that starts the local inference server a request asks for (llama.cpp, vLLM, stable-diffusion.cpp, whisper.cpp, ComfyUI and other OpenAI- or Anthropic-compatible servers) and unloads the previous one, or keeps several loaded with a swap matrix. It exposes chat, embeddings, audio, image and Anthropic Messages endpoints, plus a web UI, from one config file.
Where it fits in a 10–200 person business
- Serve many GGUF or vLLM models on one machine without leaving them all loaded
- One OpenAI-compatible endpoint for a team chat UI that switches models by name
- Add idle timeouts (ttl) so VRAM is freed when a model is unused
These use cases are our editorial suggestions, not claims made by the project.
Can a business use llama-swap? (license)
| License | MIT |
|---|---|
| Type | Permissive: MIT / Apache-2.0: use, modify and sell with few obligations. |
| Internal business use | Allowed under the license text |
| What to watch | Permissive. Internal and commercial use allowed; keep the copyright notice. Models and upstream servers keep their own licenses. |
This is a plain-English summary of the license text, not legal advice. Third-party models you run with it have their own licenses.
Data & compliance: does llama-swap phone home?
| Telemetry (usage data sent to the vendor) | Not documented |
|---|---|
| Other calls home by default (updates, marketplaces, default cloud services) | Not documented |
| Single sign-on (OIDC / SAML / LDAP) | Not documented |
| Audit log | Not documented |
| Role-based access control (RBAC) | Not documented |
| Data residency / GDPR notes from the project | Not documented |
Checked against the project's own docs and repository on . "Not documented" means we could not find the answer in official sources; it does not mean the feature is missing or that no data is sent. Third-party services you connect (model APIs, vector databases, search engines) have their own data policies. Compare all apps.
What hardware does llama-swap need?
The project does not publish a minimum CPU/RAM figure, so we leave the official value blank rather than guess.
GPU: Optional. A CPU image is published (ghcr.io/mostlygeek/llama-swap:cpu). The recommended unified images target NVIDIA (CUDA 12 or 13) or Vulkan GPUs. RAM and VRAM depend on the upstream server and model you configure, not on llama-swap itself.
No official CPU, RAM or disk figures are published for llama-swap. Size the machine for the inference server you put behind it.
Source: github.com/mostlygeek/llama-swap#docker-install-download-images
How much does it cost to host llama-swap per month?
The project publishes no RAM figure we could verify, so we do not estimate a cost.
How to deploy llama-swap
Method: Docker (or a single binary)
docker pull ghcr.io/mostlygeek/llama-swap:unified-cuda13
docker run -it --rm --runtime nvidia -p 9292:8080 \
-v /path/to/models:/models \
-v /path/to/custom/config.yaml:/etc/llama-swap/config/config.yaml \
ghcr.io/mostlygeek/llama-swap:unified-cuda13 From the official instructions: github.com/mostlygeek/llama-swap#docker-install-download-images. Always check the source for the current version before you run it.
Known gotchas when self-hosting llama-swap
- Behind nginx, disable response buffering and caching on streaming routes (/api/events and /v1/chat/completions). Default nginx buffering breaks Server-Sent Events and streaming chat. source
- When you publish a container port, keep LLAMA_SWAP_LISTEN on 0.0.0.0 (the unified image default). Binding the process to localhost inside the container is not reachable through -p. source
- You must supply a config file that names each model and its start command. The unified image default path is /etc/llama-swap/config/config.yaml (or set LLAMA_SWAP_CONFIG). source
Alternatives in Local model runtimes
- Ollama The simplest way to download and run open-weight LLMs locally behind an API. Compare llama-swap vs Ollama
- llama.cpp Lightweight C/C++ engine that runs quantized open models on CPU or GPU, with an OpenAI-compatible server. Compare llama.cpp vs llama-swap
- vLLM High-throughput LLM inference server for GPUs with an OpenAI-compatible API. Compare llama-swap vs vLLM
- LocalAI OpenAI-compatible API for LLMs, vision, voice and images on any hardware. Compare llama-swap vs LocalAI
- TextGen (text-generation-webui) Local LLM app (formerly text-generation-webui) with a browser UI, OpenAI/Anthropic-compatible API and LoRA training. Compare llama-swap vs TextGen (text-generation-webui)
- SGLang Fast serving engine for LLMs and multimodal models on GPU servers, with an OpenAI-style API. Compare llama-swap vs SGLang
- llamafile Mozilla.ai's single-file executables that bundle an open LLM with llama.cpp and run on most OSes with no install. Compare llama-swap vs llamafile
- KTransformers CPU and GPU inference kernels with a model-serving CLI and SGLang integration. Compare KTransformers vs llama-swap
- TensorRT LLM NVIDIA GPU inference toolkit with an OpenAI-compatible serving command. Compare llama-swap vs TensorRT LLM
- Xinference Model-serving platform for LLM, embedding, rerank, speech and image models behind one OpenAI-compatible API. Compare llama-swap vs Xinference
- Lemonade Local OpenAI-compatible server for chat, speech and image models on CPU, GPU or AMD NPU. Compare Lemonade vs llama-swap
- GPUStack GPU cluster manager that deploys vLLM, SGLang and other engines behind an OpenAI-compatible API. Compare GPUStack vs llama-swap
- Text Embeddings Inference Hugging Face's production server for open embedding, re-ranking and classification models. Compare llama-swap vs Text Embeddings Inference
- Harbor (local LLM stack) One CLI to start a pre-wired local AI stack, such as Open WebUI with llama.cpp, Ollama or vLLM, plus 50+ services. Compare Harbor (local LLM stack) vs llama-swap
- RamaLama Run and serve AI models as OCI containers with Podman or Docker, using an image matched to your GPU. Compare llama-swap vs RamaLama
- Infinity High-throughput REST server for embeddings, reranking and classification models. Compare Infinity vs llama-swap
llama-swap FAQ
How much RAM does llama-swap need?
llama-swap does not publish an official RAM figure, so we do not state one. Size the machine for the inference server you put behind it.
Does llama-swap need a GPU?
Optional. A CPU image is published (ghcr.io/mostlygeek/llama-swap:cpu). The recommended unified images target NVIDIA (CUDA 12 or 13) or Vulkan GPUs. RAM and VRAM depend on the upstream server and model you configure, not on llama-swap itself.
How much does it cost to self-host llama-swap?
The software is free to download. The project publishes no official RAM figure, so we do not estimate a monthly server cost.
Is llama-swap free for commercial use?
llama-swap is licensed under MIT (Permissive). Internal business use is allowed under the license text. Permissive. Internal and commercial use allowed; keep the copyright notice. Models and upstream servers keep their own licenses. This is a summary, not legal advice.
What are common problems when self-hosting llama-swap?
Behind nginx, disable response buffering and caching on streaming routes (/api/events and /v1/chat/completions). Default nginx buffering breaks Server-Sent Events and streaming chat. When you publish a container port, keep LLAMA_SWAP_LISTEN on 0.0.0.0 (the unified image default). Binding the process to localhost inside the container is not reachable through -p. You must supply a config file that names each model and its start command. The unified image default path is /etc/llama-swap/config/config.yaml (or set LLAMA_SWAP_CONFIG).
Is llama-swap still maintained?
Yes, it is actively developed. Last commit: Nov 22, 2026. Latest release: v275 (Nov 20, 2026). Checked Nov 23, 2026.
How do I install llama-swap?
The official method is Docker (or a single binary). The exact commands are in the "How to deploy" section above and in the official instructions: https://github.com/mostlygeek/llama-swap#docker-install-download-images
What are self-hosted alternatives to llama-swap?
Other apps in Local model runtimes: Ollama, llama.cpp, vLLM, LocalAI, TextGen (text-generation-webui), SGLang, llamafile, KTransformers, TensorRT LLM, Xinference, Lemonade, GPUStack, Text Embeddings Inference, Harbor (local LLM stack), RamaLama, Infinity.
Sources
- GitHub repository: github.com/mostlygeek/llama-swap
- Official documentation: github.com/mostlygeek/llama-swap#readme
- License text: github.com/mostlygeek/llama-swap/blob/main/LICENSE.md
- Hardware requirements, Deploy instructions: github.com/mostlygeek/llama-swap#docker-install-download-images
- Gotcha 1: github.com/mostlygeek/llama-swap#reverse-proxy-configuration-nginx
- Gotcha 2: github.com/mostlygeek/llama-swap#configuring-startup-with-environment-variables
- Gotcha 3: github.com/mostlygeek/llama-swap#configuration
- Hetzner Cloud pricing (cost estimate): www.hetzner.com/cloud/regular-performance
- GitHub stars, commits and releases: GitHub REST API, fetched
Facts on this page were checked against the project's own repository and docs on 2026-11-10. Spotted something out of date? Tell us.