[GH-ISSUE #1244] [FEAT]: System prompt allocation window too constraining. #779

Closed
opened 2026-02-22 18:21:19 -05:00 by yindo · 1 comment
Owner

Originally created by @timothycarambat on GitHub (May 1, 2024).
Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/1244

Originally assigned to: @timothycarambat on GitHub.

What would you like to see?

Right now, when you send a prompt that is going to overflow the window of a model
https://github.com/Mintplex-Labs/anything-llm/blob/42e1d8e8ceffd378323b3ea71986f03beaf54d1a/server/utils/helpers/chat/index.js#L54

or are pinning documents that will overflow the budget for system prompts
https://github.com/Mintplex-Labs/anything-llm/blob/42e1d8e8ceffd378323b3ea71986f03beaf54d1a/server/utils/chats/stream.js#L110

We then begin to truncate the messages. This becomes an issue when the user wishes to pin many many documents and have the history and user prompt be more constrained.

Ideally, the user should not have the system prompt constrained to only 15% (fixed) of the overall window. This limits high-context models such as gemini 1.5 substantially where they can only have 150K tokens of the 1M context.

Originally created by @timothycarambat on GitHub (May 1, 2024). Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/1244 Originally assigned to: @timothycarambat on GitHub. ### What would you like to see? Right now, when you send a prompt that is going to overflow the window of a model https://github.com/Mintplex-Labs/anything-llm/blob/42e1d8e8ceffd378323b3ea71986f03beaf54d1a/server/utils/helpers/chat/index.js#L54 or are pinning documents that will overflow the budget for `system` prompts https://github.com/Mintplex-Labs/anything-llm/blob/42e1d8e8ceffd378323b3ea71986f03beaf54d1a/server/utils/chats/stream.js#L110 We then begin to truncate the messages. This becomes an issue when the user wishes to pin many many documents and have the history and user prompt be more constrained. Ideally, the user should not have the `system` prompt constrained to only 15% (fixed) of the overall window. This limits high-context models such as gemini 1.5 substantially where they can only have 150K tokens of the 1M context.
yindo added the enhancementfeature request labels 2026-02-22 18:21:19 -05:00
yindo closed this issue 2026-02-22 18:21:19 -05:00
Author
Owner

@RahSwe commented on GitHub (May 1, 2024):

Very hyped about this enhancement =)

@RahSwe commented on GitHub (May 1, 2024): Very hyped about this enhancement =)
yindo changed title from [FEAT]: System prompt allocation window too constraining. to [GH-ISSUE #1244] [FEAT]: System prompt allocation window too constraining. 2026-06-05 14:37:09 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mintplex-Labs/anything-llm#779