[GH-ISSUE #12107] issue: num_keep Setting Doesn't Limit Context Retention as Expected #55138

Closed
opened 2026-05-05 17:12:09 -05:00 by GiteaMirror · 0 comments
Owner

Originally created by @weissfl on GitHub (Mar 27, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/12107

Check Existing Issues

  • I have searched the existing issues and discussions.
  • I am using the latest version of Open WebUI.

Installation Method

Docker

Open WebUI Version

v0.5.20

Ollama Version (if applicable)

No response

Operating System

Windows 10

Browser (if applicable)

No response

Confirmation

  • I have read and followed all instructions in README.md.
  • I am using the latest version of both Open WebUI and Ollama.
  • I have included the browser console logs.
  • I have included the Docker container logs.
  • I have listed steps to reproduce the bug in detail.

Expected Behavior

When setting "Tokens To Keep On Context Refresh (num_keep)" to 1, the model should retain only 1 token from previous messages. If asked to recall earlier information, it should not remember details beyond this limit.

Actual Behavior

Despite setting "Tokens To Keep On Context Refresh (num_keep)" to 1, the model retains more than 1 token and successfully recalls information from previous messages.

Steps to Reproduce

  1. Go to Chat Controls / Settings / Advanced Params (I tried all three options).
  2. Find the "Tokens To Keep On Context Refresh (num_keep)" setting.
  3. Change it from default to custom and set it to 1.
  4. Start a conversation and mention your name in one of the first messages.
  5. Send a few more messages.
  6. Ask the model to recall your name.

Unexpected Behavior:
The model still remembers the name, indicating that more than 1 token is retained, despite the setting.

Logs & Screenshots

Image

Additional Information

No response

Originally created by @weissfl on GitHub (Mar 27, 2025). Original GitHub issue: https://github.com/open-webui/open-webui/issues/12107 ### Check Existing Issues - [x] I have searched the existing issues and discussions. - [x] I am using the latest version of Open WebUI. ### Installation Method Docker ### Open WebUI Version v0.5.20 ### Ollama Version (if applicable) _No response_ ### Operating System Windows 10 ### Browser (if applicable) _No response_ ### Confirmation - [x] I have read and followed all instructions in `README.md`. - [x] I am using the latest version of **both** Open WebUI and Ollama. - [x] I have included the browser console logs. - [x] I have included the Docker container logs. - [x] I have listed steps to reproduce the bug in detail. ### Expected Behavior When setting **"Tokens To Keep On Context Refresh (num_keep)"** to **1**, the model should retain **only 1 token** from previous messages. If asked to recall earlier information, it should not remember details beyond this limit. ### Actual Behavior Despite setting **"Tokens To Keep On Context Refresh (num_keep)"** to **1**, the model retains more than 1 token and successfully recalls information from previous messages. ### Steps to Reproduce 1. Go to **Chat Controls** / **Settings** / **Advanced Params** (I tried all three options). 2. Find the **"Tokens To Keep On Context Refresh (num_keep)"** setting. 3. Change it from **default** to **custom** and set it to **1**. 4. Start a conversation and mention your name in one of the first messages. 5. Send a few more messages. 6. Ask the model to recall your name. **Unexpected Behavior:** The model still remembers the name, indicating that **more than 1 token** is retained, despite the setting. ### Logs & Screenshots ![Image](https://github.com/user-attachments/assets/838563b9-205f-490d-8912-1e4f11808ab6) ### Additional Information _No response_
GiteaMirror added the bug label 2026-05-05 17:12:10 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#55138