Ollama keep_alive on loaded model can stall requests for other models
With OLLAMA_MAX_LOADED_MODELS set to 1, a request for an unloaded model prompts Ollama to schedule the currently loaded model for eviction once it goes idle. If a request for the loaded model arrives during this wait and includes keep_alive, that value overrides the pending unload, so the loaded model stays in memory for the full keep_alive period. Tests on Ollama 0.40.8 with CPU-only inference showed the second model responding in about 9 seconds without keep_alive but not within 150 seconds with keep_alive set to 30 minutes. The server reports no error and /api/ps looks healthy, and the relevant scheduler messages appear only at debug level. The issue is tracked upstream as ollama/ollama#19182, with a proposed fix in #19190.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.


Discussion (0)
Log in to join the discussion and vote.
Log in