ollama-python icon indicating copy to clipboard operation
ollama-python copied to clipboard

Unable to set keep_alive parameter

Open harshachopra507 opened this issue 1 year ago • 1 comments

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?

harshachopra507 avatar Dec 31 '24 07:12 harshachopra507

It should be staying in memory hmm. Will check it out. Have you tried setting it to a larger integer value? does that work?

ParthSareen avatar Jan 30 '25 21:01 ParthSareen