Gemini maximum number of tokens is set up as 2048. Actually in Google AI Studio, there is no such a cap #861

Closed
opened 2026-02-21 17:28:44 -05:00 by yindo · 3 comments
Owner

Originally created by @WSDzju on GitHub (Jan 3, 2024).

Self Checks

Dify version

0.4.1

Cloud or Self Hosted

Cloud

Steps to reproduce

gemini cannot set the number of tokens more than 2048

✔️ Expected Behavior

No response

Actual Behavior

No response

Originally created by @WSDzju on GitHub (Jan 3, 2024). ### Self Checks - [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 file this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). ### Dify version 0.4.1 ### Cloud or Self Hosted Cloud ### Steps to reproduce <img width="361" alt="gemini" src="https://github.com/langgenius/dify/assets/147698475/3b2348a7-8062-4314-a0e2-b2d87b513482"> cannot set the number of tokens more than 2048 ### ✔️ Expected Behavior _No response_ ### ❌ Actual Behavior _No response_
yindo added the 🐞 bug label 2026-02-21 17:28:44 -05:00
yindo closed this issue 2026-02-21 17:28:45 -05:00
Author
Owner

@crazywoola commented on GitHub (Jan 3, 2024):

But there is a limitation for API

maxOutputTokens 1-2048 gemini-pro:8192 gemini-pro-vision 2048
@crazywoola commented on GitHub (Jan 3, 2024): But there is a limitation for [API](https://cloud.google.com/vertex-ai/docs/generative-ai/model-reference/gemini?hl=zh-cn#:~:text=The%20token%20limit%20is%2032k,The%20token%20limit%20is%2016k) > maxOutputTokens | 1-2048 | gemini-pro:8192 | gemini-pro-vision 2048 -- | -- | -- | ---
Author
Owner

@WSDzju commented on GitHub (Jan 3, 2024):

But there is a limitation for API

maxOutputTokens 1-2048 gemini-pro:8192 gemini-pro-vision 2048

The limitation for Gemini-pro is 8192? The actual output tokens can be 8192 when choosing gemini-pro?

@WSDzju commented on GitHub (Jan 3, 2024): > But there is a limitation for [API](https://cloud.google.com/vertex-ai/docs/generative-ai/model-reference/gemini?hl=zh-cn#:~:text=The%20token%20limit%20is%2032k,The%20token%20limit%20is%2016k) > > > > > maxOutputTokens 1-2048 gemini-pro:8192 gemini-pro-vision 2048 The limitation for Gemini-pro is 8192? The actual output tokens can be 8192 when choosing gemini-pro?
Author
Owner

@crazywoola commented on GitHub (Jan 3, 2024):

I don’t think so because the valid range is maximum to 2048 according to the docs.

@crazywoola commented on GitHub (Jan 3, 2024): I don’t think so because the valid range is maximum to 2048 according to the docs.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#861