[PR #102] [MERGED] Session #20529

Closed
opened 2026-04-19 15:06:34 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/102
Author: @mxyng
Created: 7/18/2023
Status: Merged
Merged: 7/27/2023
Merged by: @mxyng

Base: mainHead: session-id


📝 Commits (7)

📊 Changes

5 files changed (+343 additions, -212 deletions)

View changed files

📝 api/types.go (+58 -2)
📝 cmd/cmd.go (+16 -8)
📝 llama/llama.go (+187 -86)
📝 llama/utils.go (+9 -98)
📝 server/routes.go (+73 -18)

📄 Description

an active model is kept in memory until another session is requested or the session has expired, freeing any memory associated with the model.

This adds a SessionDuration field to the generate request to customize the session window (default 5m) and a SessionExpiresAt field to the generate response informing users of when the session will expire.

  • A session duration value of -1 disables session expiration.
  • A session duration value of 0 disables model caching, i.e. models will be garbage collected as soon as generation is complete

resolves #60
resolves #108


🔄 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/102 **Author:** [@mxyng](https://github.com/mxyng) **Created:** 7/18/2023 **Status:** ✅ Merged **Merged:** 7/27/2023 **Merged by:** [@mxyng](https://github.com/mxyng) **Base:** `main` ← **Head:** `session-id` --- ### 📝 Commits (7) - [`35af37a`](https://github.com/ollama/ollama/commit/35af37a2cb7097dcbac2a0f88eb2636436f82d2a) session id - [`32aec66`](https://github.com/ollama/ollama/commit/32aec66e6ad909759da45c18d0a4504e0dd73fc1) add load duration - [`3003fc0`](https://github.com/ollama/ollama/commit/3003fc03fcd2b12919433506dfc675b30cdca85f) update predict code - [`f62a882`](https://github.com/ollama/ollama/commit/f62a882760c78d799d4044b633a8dda37e097ac8) add session expiration - [`c490416`](https://github.com/ollama/ollama/commit/c4904161891cb077834155798099410af2bbfed9) lock on llm.lock(); decrease batch size - [`cca6118`](https://github.com/ollama/ollama/commit/cca61181cb08995ffc2ac93439425ac3fa997a5b) sample metrics - [`688661a`](https://github.com/ollama/ollama/commit/688661ab9b5bb821555efda75f016689dfd1b2da) increase default batch size to 1024 ### 📊 Changes **5 files changed** (+343 additions, -212 deletions) <details> <summary>View changed files</summary> 📝 `api/types.go` (+58 -2) 📝 `cmd/cmd.go` (+16 -8) 📝 `llama/llama.go` (+187 -86) 📝 `llama/utils.go` (+9 -98) 📝 `server/routes.go` (+73 -18) </details> ### 📄 Description an active model is kept in memory until another session is requested or the session has expired, freeing any memory associated with the model. This adds a `SessionDuration` field to the generate request to customize the session window (default 5m) and a `SessionExpiresAt` field to the generate response informing users of when the session will expire. * A session duration value of `-1` disables session expiration. * A session duration value of `0` disables model caching, i.e. models will be garbage collected as soon as generation is complete resolves #60 resolves #108 --- <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-19 15:06:34 -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#20529