[PR #306] [MERGED] automatically set num_keep if num_keep < 0 #56785

Closed
opened 2026-04-29 11:21:23 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/306
Author: @mxyng
Created: 8/7/2023
Status: Merged
Merged: 8/8/2023
Merged by: @mxyng

Base: mainHead: default-keep-system


📝 Commits (1)

  • 4dc5b11 automatically set num_keep if num_keep < 0

📊 Changes

3 files changed (+28 additions, -14 deletions)

View changed files

📝 api/types.go (+1 -0)
📝 llama/llama.go (+8 -14)
📝 server/routes.go (+19 -0)

📄 Description

num_keep defines how many tokens to keep in the context when truncating inputs. if left to its default value of -1, the server will calculate num_keep to be the left of the system instructions

resolves #299


🔄 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/306 **Author:** [@mxyng](https://github.com/mxyng) **Created:** 8/7/2023 **Status:** ✅ Merged **Merged:** 8/8/2023 **Merged by:** [@mxyng](https://github.com/mxyng) **Base:** `main` ← **Head:** `default-keep-system` --- ### 📝 Commits (1) - [`4dc5b11`](https://github.com/ollama/ollama/commit/4dc5b117ddb8fe1e002f9e8849f63c652499bf34) automatically set num_keep if num_keep < 0 ### 📊 Changes **3 files changed** (+28 additions, -14 deletions) <details> <summary>View changed files</summary> 📝 `api/types.go` (+1 -0) 📝 `llama/llama.go` (+8 -14) 📝 `server/routes.go` (+19 -0) </details> ### 📄 Description num_keep defines how many tokens to keep in the context when truncating inputs. if left to its default value of -1, the server will calculate num_keep to be the left of the system instructions resolves #299 --- <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-29 11:21:24 -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#56785