[GH-ISSUE #8545] Feature Request: Support OpenAI Model Context Trimming and File Cleanup #53830

Closed
opened 2026-05-05 15:24:32 -05:00 by GiteaMirror · 0 comments
Owner

Originally created by @MCQSJ on GitHub (Jan 14, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/8545

Currently, Open WebUI supports context trimming (setting the number of context messages sent with each request) only for Ollama models. This feature is not available for OpenAI models, which can lead to excessive token usage and increased costs when conversations grow long. Additionally, uploaded files remain stored locally even after the associated chat is deleted, which can lead to unnecessary storage usage.

Describe the solution you'd like

  1. OpenAI Model Context Trimming: Add support for setting the context length (number of previous messages sent with each request) for OpenAI models. This would allow users to control token usage and avoid unnecessary costs when conversations become lengthy.
  2. Automatic File Cleanup: Implement a feature to automatically delete uploaded files when the associated chat is deleted. This would help manage local storage more efficiently and ensure that unused files do not accumulate.

Describe alternatives you've considered

  • For context trimming: Manually editing the conversation history before sending it to OpenAI, but this is cumbersome and not user-friendly.
  • For file cleanup: Manually deleting files from the local storage, but this requires additional effort and is prone to oversight.

Additional context

  • Context Trimming: This feature is particularly important for OpenAI models, as token usage directly impacts costs. Allowing users to set a context limit would provide better control over expenses.
  • File Cleanup: Uploaded files can take up significant storage space over time, especially in environments with limited resources. Automating this process would improve the overall user experience.
Originally created by @MCQSJ on GitHub (Jan 14, 2025). Original GitHub issue: https://github.com/open-webui/open-webui/issues/8545 ## Is your feature request related to a problem? Please describe. Currently, Open WebUI supports context trimming (setting the number of context messages sent with each request) only for Ollama models. This feature is not available for OpenAI models, which can lead to excessive token usage and increased costs when conversations grow long. Additionally, uploaded files remain stored locally even after the associated chat is deleted, which can lead to unnecessary storage usage. ## Describe the solution you'd like 1. **OpenAI Model Context Trimming**: Add support for setting the context length (number of previous messages sent with each request) for OpenAI models. This would allow users to control token usage and avoid unnecessary costs when conversations become lengthy. 2. **Automatic File Cleanup**: Implement a feature to automatically delete uploaded files when the associated chat is deleted. This would help manage local storage more efficiently and ensure that unused files do not accumulate. ## Describe alternatives you've considered - For context trimming: Manually editing the conversation history before sending it to OpenAI, but this is cumbersome and not user-friendly. - For file cleanup: Manually deleting files from the local storage, but this requires additional effort and is prone to oversight. ## Additional context - **Context Trimming**: This feature is particularly important for OpenAI models, as token usage directly impacts costs. Allowing users to set a context limit would provide better control over expenses. - **File Cleanup**: Uploaded files can take up significant storage space over time, especially in environments with limited resources. Automating this process would improve the overall user experience.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#53830