-
Notifications
You must be signed in to change notification settings - Fork 7.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"finish_reason": "FinishReason.MAX_TOKENS" while llm output maxtoken set to 8192 #8550
Comments
I found a similar issue that was previously reported and resolved. The issue titled "Output the finish reason value for LLM node" was closed by a pull request that added the Regarding your specific issue with the Additionally, the default value of the You might want to check the parameter settings on the orchestration page to ensure that the |
I am using gemini flash which have 1 M context window ,but it should this : "usage": { Then I switched to Chatgpt 4o mini, this time the input is complete; so I am guessing something wrong with gemini model setup in dify,where can I set variables for the model? |
To address the "FinishReason.MAX_TOKENS" issue with the Gemini model in Dify, you need to configure the model parameters, specifically the "maximum tokens" setting. This can be done in the LLM node configuration under the "Configure Model Parameters" section. In the configuration file for the Gemini model ( - name: max_output_tokens
use_template: max_tokens
required: true
default: 2048
min: 1
max: 2048 Adjust the "max_output_tokens" parameter to a suitable value within the range of 1 to 2048 to prevent the model from hitting the token limit [1]. |
Self Checks
Dify version
Dify 0.8.0
Cloud or Self Hosted
Self Hosted (Docker)
Steps to reproduce
✔️ Expected Behavior
No response
❌ Actual Behavior
No response
The text was updated successfully, but these errors were encountered: