[PR #2186] [MERGED] Fix clearing kv cache between requests with the same prompt #42061

Closed
opened 2026-04-24 21:51:07 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/2186
Author: @jmorganca
Created: 1/25/2024
Status: Merged
Merged: 1/25/2024
Merged by: @jmorganca

Base: mainHead: cache


📝 Commits (2)

  • d23d19c Fix clearing kv cache between requests with the same prompt
  • f032bba fix powershell script

📊 Changes

4 files changed (+65 additions, -0 deletions)

View changed files

📝 llm/dyn_ext_server.go (+1 -0)
📝 llm/generate/gen_common.sh (+11 -0)
📝 llm/generate/gen_windows.ps1 (+23 -0)
llm/patches/01-cache.diff (+30 -0)

📄 Description

This is a (draft) fix for #1573, as it seems that the kv cache isn't cleared properly when the exact same prompt is provided repetitively.


🔄 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/2186 **Author:** [@jmorganca](https://github.com/jmorganca) **Created:** 1/25/2024 **Status:** ✅ Merged **Merged:** 1/25/2024 **Merged by:** [@jmorganca](https://github.com/jmorganca) **Base:** `main` ← **Head:** `cache` --- ### 📝 Commits (2) - [`d23d19c`](https://github.com/ollama/ollama/commit/d23d19c46538e40bd1746e794b188e442d37cce0) Fix clearing kv cache between requests with the same prompt - [`f032bba`](https://github.com/ollama/ollama/commit/f032bba48823a4ebda4368c76f26db0d37911876) fix powershell script ### 📊 Changes **4 files changed** (+65 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `llm/dyn_ext_server.go` (+1 -0) 📝 `llm/generate/gen_common.sh` (+11 -0) 📝 `llm/generate/gen_windows.ps1` (+23 -0) ➕ `llm/patches/01-cache.diff` (+30 -0) </details> ### 📄 Description This is a (draft) fix for #1573, as it seems that the kv cache isn't cleared properly when the exact same prompt is provided repetitively. --- <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-24 21:51:07 -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#42061