mirror of
https://github.com/ollama/ollama-python.git
synced 2026-07-21 09:05:23 -04:00
Unable to set keep_alive parameter #193
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @harshachopra507 on GitHub (Dec 31, 2024).
Originally assigned to: @ParthSareen on GitHub.
Hi,
I am using ollama.AsyncClient() for parallel processing of documents. I am setting keep_alive parameter from ollama.AsyncClient().chat(keep_alive=-1).
I have also tried setting env variable, os.environ["OLLAMA_KEEP_ALIVE"] = "-1"
While checking ollama ps from the terminal, I see connective alive UNTIL 5 minutes (which is default). While running python script, after 5 minutes the code is getting stuck because ollama models running using ollama python client is getting stopped.
How can I resolve this issue?
@ParthSareen commented on GitHub (Jan 30, 2025):
It should be staying in memory hmm. Will check it out. Have you tried setting it to a larger integer value? does that work?