mirror of
https://github.com/open-webui/open-webui.git
synced 2026-06-03 07:24:59 -05:00
[GH-ISSUE #12375] issue: OpenAI API token limit not working #16574
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @luna8484 on GitHub (Apr 3, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/12375
Check Existing Issues
Installation Method
Pip Install
Open WebUI Version
v0.5.20
Ollama Version (if applicable)
No response
Operating System
Windows 10
Browser (if applicable)
No response
Confirmation
README.md.Expected Behavior
Hello, thank you for taking the time to read this.
I am currently using the 4o model through the OpenAI API. Previously, options like "max tokens" were not functioning at all, so I modified the apps/openai/main.py file to forcefully limit tokens as shown below.
However, after the update, it seems to bypass this modification and operates without the limit. As a result, my API costs have skyrocketed.
I assume there is something I am missing.
Could you please let me know how to properly set token limits when using the OpenAI API?
Thank you very much!
Actual Behavior
.
Steps to Reproduce
.
Logs & Screenshots
@luna8484 commented on GitHub (Apr 3, 2025):
@tjbck commented on GitHub (Apr 3, 2025):
max_token is definitely being forwarded with the latest version.
@luna8484 commented on GitHub (Apr 3, 2025):
@luna8484 commented on GitHub (Apr 3, 2025):
I can't seem to make it work. Could you give me some advice, please?