[GH-ISSUE #753] Negative Keep Alive value won't work #27731

Closed
opened 2026-04-25 02:28:48 -05:00 by GiteaMirror · 2 comments
Owner

Originally created by @nihilimbo on GitHub (Feb 16, 2024).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/753

Bug Report

Description

Bug Summary:
Ollama Web UI will throw a "Ollama: time: missing unit in duration -1" when trying to use -1 as a Keep Alive value in the Advanced tab of the Settings. According to Ollama documentation a -1 value in the keep_alive header instructs Ollama to keep the model loaded indefinitely

Steps to Reproduce:
Go to Settings->Advanced and set Keep Alive to -1, then try to send a message to any model

Expected Behavior:
Chat would work normally and the last used model will be kept loaded in Ollama indefinitely

Actual Behavior:
Got "Ollama: time: missing unit in duration -1" and "Uh-oh! There was an issue connecting to Ollama" errors when trying to send a message after setting KA to -1

Environment

  • Operating System: MacOS Sonoma 14.2.1
  • Browser (if applicable): Chrome 121.0.6167.184

Reproduction Details

Confirmation:

  • I have read and followed all the instructions provided in the README.md.
  • I have reviewed the troubleshooting.md document.
  • I have included the browser console logs.
  • I have included the Docker container logs.

Logs and Screenshots

Browser Console Logs:
[Include relevant browser console logs, if applicable]

Docker Container Logs:
[Include relevant Docker container logs, if applicable]

Screenshots (if applicable):
[Attach any relevant screenshots to help illustrate the issue]

Installation Method

[Describe the method you used to install the project, e.g., manual installation, Docker, package manager, etc.]

Additional Information

[Include any additional details that may help in understanding and reproducing the issue. This could include specific configurations, error messages, or anything else relevant to the bug.]

Note

If the bug report is incomplete or does not follow the provided instructions, it may not be addressed. Please ensure that you have followed the steps outlined in the README.md and troubleshooting.md documents, and provide all necessary information for us to reproduce and address the issue. Thank you!

Originally created by @nihilimbo on GitHub (Feb 16, 2024). Original GitHub issue: https://github.com/open-webui/open-webui/issues/753 # Bug Report ## Description **Bug Summary:** Ollama Web UI will throw a "Ollama: time: missing unit in duration -1" when trying to use -1 as a Keep Alive value in the Advanced tab of the Settings. According to [Ollama documentation](https://github.com/ollama/ollama/releases/tag/v0.1.23) a -1 value in the keep_alive header instructs Ollama to keep the model loaded indefinitely **Steps to Reproduce:** Go to Settings->Advanced and set Keep Alive to -1, then try to send a message to any model **Expected Behavior:** Chat would work normally and the last used model will be kept loaded in Ollama indefinitely **Actual Behavior:** Got "Ollama: time: missing unit in duration -1" and "Uh-oh! There was an issue connecting to Ollama" errors when trying to send a message after setting KA to -1 ## Environment - **Operating System:** MacOS Sonoma 14.2.1 - **Browser (if applicable):** Chrome 121.0.6167.184 ## Reproduction Details **Confirmation:** - [x] I have read and followed all the instructions provided in the README.md. - [x] I have reviewed the troubleshooting.md document. - [ ] I have included the browser console logs. - [ ] I have included the Docker container logs. ## Logs and Screenshots **Browser Console Logs:** [Include relevant browser console logs, if applicable] **Docker Container Logs:** [Include relevant Docker container logs, if applicable] **Screenshots (if applicable):** [Attach any relevant screenshots to help illustrate the issue] ## Installation Method [Describe the method you used to install the project, e.g., manual installation, Docker, package manager, etc.] ## Additional Information [Include any additional details that may help in understanding and reproducing the issue. This could include specific configurations, error messages, or anything else relevant to the bug.] ## Note If the bug report is incomplete or does not follow the provided instructions, it may not be addressed. Please ensure that you have followed the steps outlined in the README.md and troubleshooting.md documents, and provide all necessary information for us to reproduce and address the issue. Thank you!
Author
Owner

@justinh-rahb commented on GitHub (Feb 16, 2024):

Confirming this, I get the same results. -1 is a valid value for keep_alive in Ollama's API so our interface should support this.

<!-- gh-comment-id:1948289954 --> @justinh-rahb commented on GitHub (Feb 16, 2024): Confirming this, I get the same results. `-1` is a valid value for `keep_alive` in Ollama's API so our interface should support this.
Author
Owner

@spammenotinoz commented on GitHub (May 13, 2024):

Really dumb question, Advanced settings are per USER saved on the local browser, and Ollama updates keep alive per api call, so I am not really following how this fix addresses the keep alive issue.
When the model is loaded, it works really well, but wait 5mins and TTFS takes minutes.
There is now an Ollama ENV variable called "OLLAMA_KEEP_ALIVE", syntax is as follows.

  • "OLLAMA_KEEP_ALIVE=-1"
<!-- gh-comment-id:2106420632 --> @spammenotinoz commented on GitHub (May 13, 2024): Really dumb question, Advanced settings are per USER saved on the local browser, and Ollama updates keep alive per api call, so I am not really following how this fix addresses the keep alive issue. When the model is loaded, it works really well, but wait 5mins and TTFS takes minutes. There is now an Ollama ENV variable called "OLLAMA_KEEP_ALIVE", syntax is as follows. - "OLLAMA_KEEP_ALIVE=-1"
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#27731