# llama-swap

> Run many local AI models behind one API and hot-swap them on demand

Source: https://talira.ai/catalog/llama-swap-zy8mg6yb
Every listing: https://talira.ai/catalog.md

- Kind: Open source
- Types: Infrastructure, API
- Categories: [ai / inference / servers](https://talira.ai/categories/ai/inference/servers)
- Platforms: linux, macos, windows, freebsd, docker[^3][^4]
- Licence: MIT[^2]
- Pricing: Free and open source[^2]
- Free tier: yes[^2]
- Self-hostable: yes[^3]
- Backed by: [Benson Wong](https://talira.ai/orgs/benson-wong.md)

llama-swap is an MIT-licensed proxy, written in Go, that runs many local AI models behind one OpenAI- and Anthropic-compatible API. Each request's `model` field picks the inference server to use: llama-swap starts it from the command in its YAML config and stops the one it replaces, with optional idle timeouts. It works with [llama.cpp](https://talira.ai/catalog/llama-cpp-g0rydd64.md) and its forks, [vLLM](https://talira.ai/catalog/vllm-f1czevpj.md), stable-diffusion.cpp, audio.cpp, ComfyUI and any other OpenAI- or Anthropic-compatible server, passes through chat, embeddings, audio, image and rerank endpoints, and serves a web UI. It ships as one binary with no dependencies.

## Links

- Website: https://llama-swap.ai/
- GitHub: https://github.com/mostlygeek/llama-swap
- Docs: https://llama-swap.ai/docs

## Ways to install

### Package managers

- [Homebrew](https://talira.ai/catalog/homebrew-djy17yn9.md): <https://github.com/mostlygeek/homebrew-llama-swap>[^1]

## Problems it solves

- only one local LLM fits in my GPU memory but my tools need to call several models
- switch between llama.cpp models automatically based on the model name in an OpenAI API request
- unload a local model after it's been idle so the GPU is free for something else

## Features

- starts and stops local inference servers on demand from each request's model name
- OpenAI-compatible endpoints: completions, chat, responses, embeddings, audio, images and realtime
- Anthropic-compatible messages endpoint
- works with llama.cpp, vLLM, stable-diffusion.cpp, ComfyUI and other compatible servers
- one binary and one YAML config file, no dependencies
- web UI and API to list and unload running models

## Trust

Overall: 0.70 out of 1.
Signals: maintenance 1.00, adoption 0.76, momentum 0.72, community 0.79, backing 0.30, extensibility 0.00.

- last commit 4 days ago
- 154 commits in the last 90 days
- latest release v276 4 days ago
- 6.3k GitHub stars
- 93 contributors
- backed by Benson Wong

## Related

- Works with [llama.cpp](https://talira.ai/catalog/llama-cpp-g0rydd64.md)
- Works with [vLLM](https://talira.ai/catalog/vllm-f1czevpj.md)

## Alternatives

- [llama.cpp](https://talira.ai/catalog/llama-cpp-g0rydd64.md): LLM inference in C/C++
- [Ollama](https://talira.ai/catalog/ollama-gr2tx5nn.md): Start building with open models, locally or in the cloud
- [Xinference](https://talira.ai/catalog/xinference-wky5s024.md): Open source inference platform: serve LLMs, embeddings, rerankers, image, audio and video models behind OpenAI-compatible APIs
- [vLLM](https://talira.ai/catalog/vllm-f1czevpj.md): A high-throughput and memory-efficient inference and serving engine for LLMs
- [TextGen](https://talira.ai/catalog/textgen-ctxan105.md): A desktop app for local LLMs, with a UI and an OpenAI/Anthropic-compatible API
- [LocalAI](https://talira.ai/catalog/localai-5j77s2mj.md): Your own AI, on your own hardware

## Sources

[^1]: https://github.com/mostlygeek/llama-swap#homebrew-install-macoslinux (checked 26 Nov 2026)
[^2]: https://github.com/mostlygeek/llama-swap/blob/main/LICENSE.md (checked 26 Nov 2026)
[^3]: https://llama-swap.ai/ (checked 26 Nov 2026)
[^4]: https://github.com/mostlygeek/llama-swap/releases (checked 26 Nov 2026)
