Replies: 3 comments
|
I forgot to add, my question is about the llama-server that you can spin up to create an openapi compatible endpoint. |
|
Short answer: Your options, depending on your setup: 1. If you use Ollama (you mentioned it) # global default (default is 5m)
OLLAMA_KEEP_ALIVE=10m ollama serveor per request: { "model": "qwen2.5-coder:7b", "prompt": "hi", "keep_alive": "10m" }Setting 2. If you use # start it only when you need it, Ctrl-C / pkill when done — VRAM is freed instantly
python -m llama_cpp.server --model model.gguf --n_gpu_layers 8If you want it automatic, wrap it: a small shell script or a systemd service with 3. If you use model = Llama("model.gguf", n_gpu_layers=8)
# ... use it ...
del model
import gc; gc.collect() # weights/KV cache released hereSo: Ollama = set |
|
No idle TTL like Ollama's The Python What people do: wrap the instance, reset a timer on each request, and on expiry If you need Ollama-style unload, run llama.cpp's |
Uh oh!
There was an error while loading. Please reload this page.
I might have missed something but is it possible to unload a model if it wasn't used for X minutes? Ollama has something like that, freeing up vram for other things (image generation etc.) if the llm isn't in use currently.
All reactions