When DIFY accesses models through the token of One API, the number of tokens consumed during question answering has always been 0. Is there a problem with the configuration? #115

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

Originally created by @lanqy123 on GitHub (Mar 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 search for existing issues, 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.0.1

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

Image

✔️ Expected Behavior

No response

Actual Behavior

No response

Originally created by @lanqy123 on GitHub (Mar 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 [search for existing issues](https://github.com/langgenius/dify/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.0.1 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce ![Image](https://github.com/user-attachments/assets/2217f4b4-1a8a-4d8f-950c-f72beceb6cb8) ### ✔️ Expected Behavior _No response_ ### ❌ Actual Behavior _No response_
yindo closed this issue 2026-02-16 10:18:08 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Mar 24, 2025):

I found a similar open issue related to token counting in Dify. The issue suggests checking if similar fixes from previous issues related to token counting could apply to version 1.0.0. It also recommends ensuring that configuration settings, such as MAXIMUM_CHUNK_TOKEN_LENGTH, are correctly set, as they can affect token counting [1].

Additionally, there is a known issue in Dify version 1.0.1 where the Ollama plugin creates an excessive number of threads due to a problem in the token counting function during document processing. This might be related to your issue, as it involves token counting problems [2].

You might want to verify your configuration settings and check if any of these known issues apply to your setup.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

@dosubot[bot] commented on GitHub (Mar 24, 2025): <!-- Answer --> I found a similar open issue related to token counting in Dify. The issue suggests checking if similar fixes from previous issues related to token counting could apply to version 1.0.0. It also recommends ensuring that configuration settings, such as `MAXIMUM_CHUNK_TOKEN_LENGTH`, are correctly set, as they can affect token counting <sup>[[1]](https://github.com/langgenius/dify/issues/14917)</sup>. Additionally, there is a known issue in Dify version 1.0.1 where the Ollama plugin creates an excessive number of threads due to a problem in the token counting function during document processing. This might be related to your issue, as it involves token counting problems <sup>[[2]](https://github.com/langgenius/dify/issues/14626)</sup>. You might want to verify your configuration settings and check if any of these known issues apply to your setup. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* --- <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/8f1d14c6-1625-40b5-8860-bb5432fbbb09?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/8f1d14c6-1625-40b5-8860-bb5432fbbb09?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/8f1d14c6-1625-40b5-8860-bb5432fbbb09?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/8f1d14c6-1625-40b5-8860-bb5432fbbb09?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/8f1d14c6-1625-40b5-8860-bb5432fbbb09?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/8f1d14c6-1625-40b5-8860-bb5432fbbb09?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/8f1d14c6-1625-40b5-8860-bb5432fbbb09?feedback_type=other)</sup>
Author
Owner

@lanqy123 commented on GitHub (Mar 24, 2025):

I found a similar open issue related to token counting in Dify. The issue suggests checking if similar fixes from previous issues related to token counting could apply to version 1.0.0. It also recommends ensuring that configuration settings, such as MAXIMUM_CHUNK_TOKEN_LENGTH, are correctly set, as they can affect token counting [1].

Additionally, there is a known issue in Dify version 1.0.1 where the Ollama plugin creates an excessive number of threads due to a problem in the token counting function during document processing. This might be related to your issue, as it involves token counting problems [2].

You might want to verify your configuration settings and check if any of these known issues apply to your setup.

To continue talking to Dosu, mention @dosu.

Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

@lanqy123 commented on GitHub (Mar 24, 2025): > I found a similar open issue related to token counting in Dify. The issue suggests checking if similar fixes from previous issues related to token counting could apply to version 1.0.0. It also recommends ensuring that configuration settings, such as `MAXIMUM_CHUNK_TOKEN_LENGTH`, are correctly set, as they can affect token counting [[1]](https://github.com/langgenius/dify/issues/14917). > > Additionally, there is a known issue in Dify version 1.0.1 where the Ollama plugin creates an excessive number of threads due to a problem in the token counting function during document processing. This might be related to your issue, as it involves token counting problems [[2]](https://github.com/langgenius/dify/issues/14626). > > You might want to verify your configuration settings and check if any of these known issues apply to your setup. > > _To continue talking to [Dosu](https://dosu.dev), mention [@dosu](https://github.com/dosu)._ > > Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/8f1d14c6-1625-40b5-8860-bb5432fbbb09?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/8f1d14c6-1625-40b5-8860-bb5432fbbb09?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/8f1d14c6-1625-40b5-8860-bb5432fbbb09?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/8f1d14c6-1625-40b5-8860-bb5432fbbb09?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/8f1d14c6-1625-40b5-8860-bb5432fbbb09?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/8f1d14c6-1625-40b5-8860-bb5432fbbb09?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/8f1d14c6-1625-40b5-8860-bb5432fbbb09?feedback_type=other)
Author
Owner

@lanqy123 commented on GitHub (Mar 24, 2025):

I found a similar open issue related to token counting in Dify. The issue suggests checking if similar fixes from previous issues related to token counting could apply to version 1.0.0. It also recommends ensuring that configuration settings, such as MAXIMUM_CHUNK_TOKEN_LENGTH, are correctly set, as they can affect token counting [1].

Additionally, there is a known issue in Dify version 1.0.1 where the Ollama plugin creates an excessive number of threads due to a problem in the token counting function during document processing. This might be related to your issue, as it involves token counting problems [2].

You might want to verify your configuration settings and check if any of these known issues apply to your setup.

To continue talking to Dosu, mention @dosu.

Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

Bypassing One API allows for normal token calculation.

@lanqy123 commented on GitHub (Mar 24, 2025): > I found a similar open issue related to token counting in Dify. The issue suggests checking if similar fixes from previous issues related to token counting could apply to version 1.0.0. It also recommends ensuring that configuration settings, such as `MAXIMUM_CHUNK_TOKEN_LENGTH`, are correctly set, as they can affect token counting [[1]](https://github.com/langgenius/dify/issues/14917). > > Additionally, there is a known issue in Dify version 1.0.1 where the Ollama plugin creates an excessive number of threads due to a problem in the token counting function during document processing. This might be related to your issue, as it involves token counting problems [[2]](https://github.com/langgenius/dify/issues/14626). > > You might want to verify your configuration settings and check if any of these known issues apply to your setup. > > _To continue talking to [Dosu](https://dosu.dev), mention [@dosu](https://github.com/dosu)._ > > Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/8f1d14c6-1625-40b5-8860-bb5432fbbb09?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/8f1d14c6-1625-40b5-8860-bb5432fbbb09?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/8f1d14c6-1625-40b5-8860-bb5432fbbb09?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/8f1d14c6-1625-40b5-8860-bb5432fbbb09?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/8f1d14c6-1625-40b5-8860-bb5432fbbb09?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/8f1d14c6-1625-40b5-8860-bb5432fbbb09?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/8f1d14c6-1625-40b5-8860-bb5432fbbb09?feedback_type=other) Bypassing One API allows for normal token calculation.
Author
Owner

@hjyjack commented on GitHub (Mar 30, 2025):

@lanqy123 这个解决了吗,1.1.3还是存在tokens 0的情况。通过langgenius-openai_api_compatible_0.0.11连接。

@hjyjack commented on GitHub (Mar 30, 2025): @lanqy123 这个解决了吗,1.1.3还是存在tokens 0的情况。通过langgenius-openai_api_compatible_0.0.11连接。
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-official-plugins#115