Qwen2.5-32B Token limit #228

Closed
opened 2026-02-16 10:18:31 -05:00 by yindo · 2 comments
Owner

Originally created by @chiehw on GitHub (Apr 24, 2025).

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues Dify issues & Dify Official Plugins, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

1.2.0

Plugin version

langgenius/openai_api_compatible 0.0.12

Cloud or Self Hosted

Cloud

Steps to reproduce

I used the openai compatible mode to connect to Qwen2.5-32B, and found that the token limit would be reached after only a few thousand words.
Image

Currently, OpenAI compatible mode still uses GPT2 to calculate tokens, Currently, the OpenAI compatible mode still uses gpt2 to calculate tokens, but most of them are similar to gpt4o token calculations.

✔️ Error log

Query or prefix prompt is too long,you can
reduce the prefix prompt,or shrink the
max token,or switch to a llm with a larger
token limit size.

Originally created by @chiehw on GitHub (Apr 24, 2025). ### Self Checks - [x] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [x] I have searched for existing issues [Dify issues](https://github.com/langgenius/dify/issues) & [Dify Official Plugins](https://github.com/langgenius/dify-official-plugins/issues), including closed ones. - [x] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [x] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [x] Please do not modify this template :) and fill in all the required fields. ### Dify version 1.2.0 ### Plugin version langgenius/openai_api_compatible 0.0.12 ### Cloud or Self Hosted Cloud ### Steps to reproduce I used the openai compatible mode to connect to Qwen2.5-32B, and found that the token limit would be reached after only a few thousand words. ![Image](https://github.com/user-attachments/assets/58e6fe2f-b299-4d1f-a7d8-8338f398517a) Currently, **OpenAI compatible mode still uses GPT2 to calculate tokens**, Currently, the OpenAI compatible mode still uses gpt2 to calculate tokens, but most of them are similar to gpt4o token calculations. ### ✔️ Error log Query or prefix prompt is too long,you can reduce the prefix prompt,or shrink the max token,or switch to a llm with a larger token limit size.
yindo added the bug label 2026-02-16 10:18:31 -05:00
yindo closed this issue 2026-02-16 10:18:31 -05:00
Author
Owner

@chiehw commented on GitHub (Apr 24, 2025):

The default token calculation method is currently gpt2, how about changing it to gpt4o? I can contribute this PR

@chiehw commented on GitHub (Apr 24, 2025): The default token calculation method is currently gpt2, how about changing it to gpt4o? I can contribute this PR
Author
Owner

@dosubot[bot] commented on GitHub (Aug 15, 2025):

Hi, @chiehw. I'm Dosu, and I'm helping the dify-official-plugins team manage their backlog and am marking this issue as stale.

Issue Summary:

  • You reported that using OpenAI compatible mode with Qwen2.5-32B causes token limits to be reached prematurely.
  • The root cause is the mode using GPT-2 token calculation instead of one aligned with Qwen2.5-32B.
  • You suggested changing the default token calculation method from gpt2 to gpt4o.
  • You have offered to contribute a pull request to address this improvement.
  • No maintainer comments or updates have been made on this issue yet.

Next Steps:

  • Please let me know if this issue is still relevant with the latest version of dify-official-plugins by commenting here.
  • If I do not hear back within 5 days, I will automatically close this issue.

Thank you for your understanding and contribution!

@dosubot[bot] commented on GitHub (Aug 15, 2025): Hi, @chiehw. I'm [Dosu](https://dosu.dev), and I'm helping the dify-official-plugins team manage their backlog and am marking this issue as stale. **Issue Summary:** - You reported that using OpenAI compatible mode with Qwen2.5-32B causes token limits to be reached prematurely. - The root cause is the mode using GPT-2 token calculation instead of one aligned with Qwen2.5-32B. - You suggested changing the default token calculation method from gpt2 to gpt4o. - You have offered to contribute a pull request to address this improvement. - No maintainer comments or updates have been made on this issue yet. **Next Steps:** - Please let me know if this issue is still relevant with the latest version of dify-official-plugins by commenting here. - If I do not hear back within 5 days, I will automatically close this issue. Thank you for your understanding and contribution!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-official-plugins#228