[GH-ISSUE #10507] 400: <400> InternalError.Algo.InvalidParameter: Range of max_tokens should be [1, 8192] #86660

Closed
opened 2026-05-15 10:58:54 -05:00 by GiteaMirror · 0 comments
Owner

Originally created by @homestoo on GitHub (Feb 21, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/10507

Hello, after updating to the latest version v0.5.16, when I set the maximum number of tokens (num_predict) to a value greater than 8192, I encounter the following error:

400: <400> InternalError.Algo.InvalidParameter: Range of max_tokens should be [1, 8192]

This issue occurs whether I use the chat interface or the /api/chat/completions API endpoint.
Since I am using content from a knowledge base, the token count returned by the vector model often exceeds 8192. It seems that the previous two versions did not have this maximum limit.
If I do not set the maximum number of tokens (num_predict) and use the default value, the openwebui chat can return content. However, when I call the knowledge base model using the /api/chat/completions API endpoint and the token count exceeds 8192, nothing is returned, and I get a 400 error.

Originally created by @homestoo on GitHub (Feb 21, 2025). Original GitHub issue: https://github.com/open-webui/open-webui/issues/10507 Hello, after updating to the latest version v0.5.16, when I set the maximum number of tokens (num_predict) to a value greater than 8192, I encounter the following error: 400: <400> InternalError.Algo.InvalidParameter: Range of max_tokens should be [1, 8192] This issue occurs whether I use the chat interface or the `/api/chat/completions` API endpoint. Since I am using content from a knowledge base, the token count returned by the vector model often exceeds 8192. It seems that the previous two versions did not have this maximum limit. If I do not set the maximum number of tokens (num_predict) and use the default value, the openwebui chat can return content. However, when I call the knowledge base model using the `/api/chat/completions` API endpoint and the token count exceeds 8192, nothing is returned, and I get a 400 error.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#86660