Fix max_tokens limit for moonshotai/kimi-k2-instruct on Groq #5740
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes the max_tokens error for the
moonshotai/kimi-k2-instructmodel when using Groq as the provider.Problem
Users were encountering the following error when using the
moonshotai/kimi-k2-instructmodel through Groq:Root Cause
The model configuration had
maxTokensset to 8192, but Groq API allows up to 16,384 tokens for this specific model. The error occurred because Roo Code was setting max_tokens to a value that exceeded Groq's API limits for this model.Solution
Updated the
maxTokensvalue formoonshotai/kimi-k2-instructfrom 8192 to 16384 in the Groq provider configuration to align with Groq's API limits.Changes
packages/types/src/providers/groq.ts:maxTokensfrom 8192 to 16384 formoonshotai/kimi-k2-instructTesting
Verification
The fix ensures that the max_tokens parameter sent to Groq API will be within the allowed limit of 16,384 tokens for the
moonshotai/kimi-k2-instructmodel.Fixes #5739
Important
Fixes
max_tokenserror formoonshotai/kimi-k2-instructon Groq by updatingmaxTokensto 16384 ingroq.ts.max_tokenserror formoonshotai/kimi-k2-instructmodel on Groq by updatingmaxTokensto 16384.maxTokensfrom 8192 to 16384 ingroq.tsformoonshotai/kimi-k2-instruct.This description was created by
for ea4860a. You can customize this summary. It will automatically update as commits are pushed.