[GH-ISSUE #14977] feat: How to set the maximum context length in a single session (设置单次会话中的最大上下文长度或者设置历史对话轮次的最大数量) #32958

Closed
opened 2026-04-25 06:47:43 -05:00 by GiteaMirror · 0 comments
Owner

Originally created by @johnnyhuangcs on GitHub (Jun 14, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/14977

Check Existing Issues

  • I have searched the existing issues and discussions.

Problem Description

How to set the maximum context length in a single session, that is, the maximum length of text given to the model API interface at a time? If it exceeds, it will be truncated.
Because users may ask and answer many questions in a single session, the context is too long, which slows down the reasoning and reply.

如何设置单次会话中的最大上下文长度或者设置传递给 API 的历史对话轮次的最大数量,即一次性传递给模型 API 接口的文本的最大长度?如果超出,则会被截断。
由于用户在单次会话中可能会多轮提出和回答大量问题,因此上下文过长会降低推理和回复的速度。

Desired Solution you'd like

set the maximum context length in a single session. If it exceeds, it will be truncated. Or set the maximum number of historical conversation rounds to remember in a single conversation

设置单次会话中上下文的最大长度。如果超出,则会被截断。或者设置单次对话中记忆的历史对话轮次的最大数量

Alternatives Considered

No response

Additional Context

No response

Originally created by @johnnyhuangcs on GitHub (Jun 14, 2025). Original GitHub issue: https://github.com/open-webui/open-webui/issues/14977 ### Check Existing Issues - [x] I have searched the existing issues and discussions. ### Problem Description How to set the maximum context length in a single session, that is, the maximum length of text given to the model API interface at a time? If it exceeds, it will be truncated. Because users may ask and answer many questions in a single session, the context is too long, which slows down the reasoning and reply. 如何设置单次会话中的最大上下文长度或者设置传递给 API 的历史对话轮次的最大数量,即一次性传递给模型 API 接口的文本的最大长度?如果超出,则会被截断。 由于用户在单次会话中可能会多轮提出和回答大量问题,因此上下文过长会降低推理和回复的速度。 ### Desired Solution you'd like set the maximum context length in a single session. If it exceeds, it will be truncated. Or set the maximum number of historical conversation rounds to remember in a single conversation 设置单次会话中上下文的最大长度。如果超出,则会被截断。或者设置单次对话中记忆的历史对话轮次的最大数量 ### Alternatives Considered _No response_ ### Additional Context _No response_
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#32958