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.
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.

+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?
<!-- 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
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.
<!-- 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.
<!-- 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
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.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
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.
@tjbck commented on GitHub (Jun 9, 2024):
#1268 PR Welcome!
@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?
@tjbck commented on GitHub (Aug 1, 2024):
Already implemented as Functions.
https://openwebui.com/functions
@GrayXu commented on GitHub (Aug 1, 2024):
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.
@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.
@justinh-rahb commented on GitHub (Aug 1, 2024):
Or just use this function:
https://openwebui.com/f/hub/context_clip_filter
@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.