[PR #2523] [CLOSED] Added OLLAMA_DEFAULT_KEEPALIVE, OLLAMA_KEEPALIVE environment variables #36793

Closed
opened 2026-04-22 21:25:50 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/2523
Author: @Chris-AS1
Created: 2/15/2024
Status: Closed

Base: mainHead: keepalive-env


📝 Commits (3)

  • 7c9fc2e added keepalive on generate, chat. implemented custom marshalling
  • 71ad6e8 added parsing tests for the session duration
  • 157811c implemented SessionDuration for both client and server. added ctx parsing tests.

📊 Changes

4 files changed (+258 additions, -75 deletions)

View changed files

📝 api/types.go (+72 -33)
api/types_test.go (+124 -0)
📝 cmd/cmd.go (+27 -12)
📝 server/routes.go (+35 -30)

📄 Description

This pull request introduces the ability to set keep_alive via the environment variable OLLAMA_KEEPALIVE. It currently supports both generate and chat endpoints.
I added tests to verify the parsing, as it was inconsistent without a dedicated marshalling function.

This is related to #2146.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ollama/ollama/pull/2523 **Author:** [@Chris-AS1](https://github.com/Chris-AS1) **Created:** 2/15/2024 **Status:** ❌ Closed **Base:** `main` ← **Head:** `keepalive-env` --- ### 📝 Commits (3) - [`7c9fc2e`](https://github.com/ollama/ollama/commit/7c9fc2e3f1b34f567ca1cd0aaf579603a1a441f9) added keepalive on generate, chat. implemented custom marshalling - [`71ad6e8`](https://github.com/ollama/ollama/commit/71ad6e8e29652147af60518d5bba1c819c847568) added parsing tests for the session duration - [`157811c`](https://github.com/ollama/ollama/commit/157811c64fd1f41e7b4e5c9d12cea2a831df87b3) implemented `SessionDuration` for both client and server. added ctx parsing tests. ### 📊 Changes **4 files changed** (+258 additions, -75 deletions) <details> <summary>View changed files</summary> 📝 `api/types.go` (+72 -33) ➕ `api/types_test.go` (+124 -0) 📝 `cmd/cmd.go` (+27 -12) 📝 `server/routes.go` (+35 -30) </details> ### 📄 Description This pull request introduces the ability to set `keep_alive` via the environment variable `OLLAMA_KEEPALIVE`. It currently supports both `generate` and `chat` endpoints. I added tests to verify the parsing, as it was inconsistent without a dedicated marshalling function. This is related to #2146. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-22 21:25:50 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#36793