Skip to content
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

fix: Dynamically set max_tokens for SiliconFlow API #2093

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Karasukaigan
Copy link

@Karasukaigan Karasukaigan commented Mar 1, 2025

Description

Updating max_tokens behavior for SiliconFlow API

Additional Notes

I updated the logic to dynamically set max_tokens based on the model being used. This resolves the issue where the default max_tokens was too short (only 512 tokens as per the official documentation). The new implementation ensures that max_tokens is adjusted according to the specific model's capabilities, aligning with the official guidelines.

Relevant documentation:

Contributor Agreement

By submitting this Pull Request, I confirm that I have read and agree to the following terms:

  • I agree to contribute all code submitted in this PR to the open-source community edition licensed under GPLv3 and the proprietary official edition without compensation.
  • I grant the official edition development team the rights to freely use, modify, and distribute this code, including for commercial purposes.
  • I confirm that this code is my original work, or I have obtained the appropriate authorization from the copyright holder to submit this code under these terms.
  • I understand that the submitted code will be publicly released under the GPLv3 license, and may also be used in the proprietary official edition.

Please check the box below to confirm:

[x] I have read and agree with the above statement.

…limit issue

Description
Updating max_tokens behavior for SiliconFlow API

Additional Notes
I updated the logic to dynamically set max_tokens based on the model being used. This resolves the issue where the default max_tokens was too short (only 512 tokens as per the official documentation). The new implementation ensures that max_tokens is adjusted according to the specific model's capabilities, aligning with the official guidelines.

Contributor Agreement
By submitting this Pull Request, I confirm that I have read and agree to the following terms:

I agree to contribute all code submitted in this PR to the open-source community edition licensed under GPLv3 and the proprietary official edition without compensation.
I grant the official edition development team the rights to freely use, modify, and distribute this code, including for commercial purposes.
I confirm that this code is my original work, or I have obtained the appropriate authorization from the copyright holder to submit this code under these terms.
I understand that the submitted code will be publicly released under the GPLv3 license, and may also be used in the proprietary official edition.
Please check the box below to confirm:

[x] I have read and agree with the above statement.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant