llama-swap with multiple inference engines #1005
|
I've been using llama-swap with llama-server (sans router) for a while without issues. As llama-server now has the router mode which allows model switching, I wanted to repurpose llama-swap as a higher level proxy to manage model switching and loading across inference engine. For example, on my Mac, I would like to be able to switch between mlx server, llama.cpp and ollama. Ideally this would extend to vllm in the future. Anyways, I'm running into an issue where I just don't see how llama-swap is supposed to handle model swapping when the "checkEndpoint" is a health check and not a "is model loaded". I started to work around this issue using Caddy and passing through args but this seemed hackish. Use Case: Given finite memory and a matrix config which indicates which sets of models can be loaded in parallel how is the config supposed to set? I'm NOT using Docker on my Mac, for obvious reasons, and I prefer to use the HTTP API to load/unload models with llama.cpp, ollama for example. The inference engine start up when the user logs in via plist without loading models. Or is this unsupported and llama-swap must be able to explicitly control each inference engine? If so that seems like a limitation since it's more efficient to keep the engine running especially if I keep certain small models in memory (embeddings, ocr) while swapping between larger models. Thanks in advance. |
Replies: 2 comments 1 reply
|
llama-swap wasn't design for the use case you described where it will call the other server's (llama-server, ollama, etc) proprietary APIs to control the state of their resources. It is designed to reliably swap servers on demand with proper queuing of requests, etc. You may be able to leverage a wrapper script like I try to keep things as simple as possible. I use llama-server in standalone mode for gguf models, comfui and vllm in docker containers, and audio.cpp/whisper.cpp for audio things. I don't run other servers because it's harder to manage the memory resource and keep a synchronised and consistent state. |
llama-swap wasn't design for the use case you described where it will call the other server's (llama-server, ollama, etc) proprietary APIs to control the state of their resources. It is designed to reliably swap servers on demand with proper queuing of requests, etc. You may be able to leverage a wrapper script like
cmd/vllm-wrapperthat makes use ofcmdandcmdStopto send API calls to the other servers.I try to keep things as simple as possible. I use llama-server in standalone mode for gguf models, comfui and vllm in docker containers, and audio.cpp/whisper.cpp for audio things. I don't run other servers because it's harder to manage the memory resource and keep a synchronised and con…