Unable to set keep_alive parameter #193

Open
opened 2026-02-15 16:28:38 -05:00 by yindo · 1 comment
Owner

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?

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?
Author
Owner

@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?

@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?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: ollama/ollama-python#193