[PR #13077] sched: context length reuse #14064

Open
opened 2026-04-13 00:43:48 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/13077
Author: @pppy2012
Created: 11/13/2025
Status: 🔄 Open

Base: mainHead: context-length-reuse


📝 Commits (1)

  • 4b7fd15 sched: context length reuse

📊 Changes

2 files changed (+138 additions, -0 deletions)

View changed files

📝 server/sched.go (+66 -0)
📝 server/sched_test.go (+72 -0)

📄 Description

  • reuse an existing runner when NumCtx shrinks while other runner options are unchanged
  • track each runner’s max context and a reuse quota (default 3); after three shorter-than-current requests the runner is reloaded
  • reset the quota when a request raises NumCtx to a new maximum to keep larger configs available

This reduces cold starts and redundant RAM/VRAM loads while respecting the bounded reuse policy.


🔄 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/13077 **Author:** [@pppy2012](https://github.com/pppy2012) **Created:** 11/13/2025 **Status:** 🔄 Open **Base:** `main` ← **Head:** `context-length-reuse` --- ### 📝 Commits (1) - [`4b7fd15`](https://github.com/ollama/ollama/commit/4b7fd1579831908273f9c6b8cff261685d870842) sched: context length reuse ### 📊 Changes **2 files changed** (+138 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `server/sched.go` (+66 -0) 📝 `server/sched_test.go` (+72 -0) </details> ### 📄 Description * reuse an existing runner when NumCtx shrinks while other runner options are unchanged * track each runner’s max context and a reuse quota (default 3); after three shorter-than-current requests the runner is reloaded * reset the quota when a request raises NumCtx to a new maximum to keep larger configs available This reduces cold starts and redundant RAM/VRAM loads while respecting the bounded reuse policy. --- <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-13 00:43:48 -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#14064