[GH-ISSUE #2949] Request to Limit Dialog Rounds posted to llm #51742

Closed
opened 2026-05-05 12:55:20 -05:00 by GiteaMirror · 7 comments
Owner

Originally created by @fxsome on GitHub (Jun 9, 2024).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/2949

Is your feature request related to a problem? Please describe.
Some times I want to continue the dialog ,but too much token is spent. Because all history are sent to llm. I want to save some.

Describe the solution you'd like
Limit dialog rounds, provide several strategy such as :
1,only keep most recent N rounds;
2, Keep the system prompt , the first user message, and most recnet N rounds;
3.only keep first N rounds and the last user message ;
4. no limit

Additional context
LM studio provides things like the attchment pic, but it based on tokens, not chat rounds, I think dialog rounds are better.
Snipaste_2024-06-09_19-50-37

Originally created by @fxsome on GitHub (Jun 9, 2024). Original GitHub issue: https://github.com/open-webui/open-webui/issues/2949 **Is your feature request related to a problem? Please describe.** Some times I want to continue the dialog ,but too much token is spent. Because all history are sent to llm. I want to save some. **Describe the solution you'd like** Limit dialog rounds, provide several strategy such as : 1,only keep most recent N rounds; 2, Keep the system prompt , the first user message, and most recnet N rounds; 3.only keep first N rounds and the last user message ; 4. no limit **Additional context** LM studio provides things like the attchment pic, but it based on tokens, not chat rounds, I think dialog rounds are better. ![Snipaste_2024-06-09_19-50-37](https://github.com/open-webui/open-webui/assets/44434587/038e46ea-a4cd-4789-9055-659c6b562fb7)
Author
Owner

@tjbck commented on GitHub (Jun 9, 2024):

#1268 PR Welcome!

<!-- gh-comment-id:2156724119 --> @tjbck commented on GitHub (Jun 9, 2024): #1268 PR Welcome!
Author
Owner

@GrayXu commented on GitHub (Aug 1, 2024):

+1, this would be a very meaningful feature.
btw, such a feat issue might be closed as not planned?

<!-- gh-comment-id:2263148753 --> @GrayXu commented on GitHub (Aug 1, 2024): +1, this would be a very meaningful feature. btw, such a feat issue might be closed as not planned?
Author
Owner

@tjbck commented on GitHub (Aug 1, 2024):

+1, this would be a very meaningful feature.

btw, such a feat issue might be closed as not planned?

Already implemented as Functions.

https://openwebui.com/functions

<!-- gh-comment-id:2263155236 --> @tjbck commented on GitHub (Aug 1, 2024): > +1, this would be a very meaningful feature. > > btw, such a feat issue might be closed as not planned? Already implemented as Functions. https://openwebui.com/functions
Author
Owner

@GrayXu commented on GitHub (Aug 1, 2024):

Already implemented as Functions.
https://openwebui.com/functions

Thanks, Functions is very cool. But I tried it out, are you referring to Max turns? This function seems to not allow further conversation after reaching the limit, which is different from OP's question. I wonder if there are other options?

If not, I will try to see how to implement a function that achieves a similar feature.

<!-- gh-comment-id:2263348451 --> @GrayXu commented on GitHub (Aug 1, 2024): >Already implemented as Functions. > https://openwebui.com/functions Thanks, Functions is very cool. But I tried it out, are you referring to Max turns? This function seems to not allow further conversation after reaching the limit, which is different from OP's question. I wonder if there are other options? If not, I will try to see how to implement a function that achieves a similar feature.
Author
Owner

@GrayXu commented on GitHub (Aug 1, 2024):

For anyone facing similar issues, you can utilize https://github.com/GrayXu/openwebui-cut-context to achieve the proper functionality implementation.

<!-- gh-comment-id:2263717482 --> @GrayXu commented on GitHub (Aug 1, 2024): For anyone facing similar issues, you can utilize https://github.com/GrayXu/openwebui-cut-context to achieve the proper functionality implementation.
Author
Owner

@justinh-rahb commented on GitHub (Aug 1, 2024):

Or just use this function:
https://openwebui.com/f/hub/context_clip_filter

<!-- gh-comment-id:2263762204 --> @justinh-rahb commented on GitHub (Aug 1, 2024): Or just use this function: https://openwebui.com/f/hub/context_clip_filter
Author
Owner

@mxdlzg commented on GitHub (Nov 4, 2024):

If the function runs on the server side, does it waste the bandwidth of the client?
After all, rounds can be truncated directly on the client side.

<!-- gh-comment-id:2453982775 --> @mxdlzg commented on GitHub (Nov 4, 2024): If the function runs on the server side, does it waste the bandwidth of the client? After all, rounds can be truncated directly on the client side.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#51742