ollama / ollama/ollama-python

Unable to set keep_alive parameter

Open
#401 1 comment 0 reactions 1 assignee View on GitHub

@ParthSareen is already working on this.

Since Jan 30, 2025.

Dominant language
Python
Stars
10.5k
Forks
1.2k
Avg merge
4m
Merged PRs (30d)
1

Description

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?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.