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-instruct
model when using Groq as the provider.Problem
Users were encountering the following error when using the
moonshotai/kimi-k2-instruct
model through Groq:Root Cause
The model configuration had
maxTokens
set 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
maxTokens
value formoonshotai/kimi-k2-instruct
from 8192 to 16384 in the Groq provider configuration to align with Groq's API limits.Changes
packages/types/src/providers/groq.ts
:maxTokens
from 8192 to 16384 formoonshotai/kimi-k2-instruct
Testing
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-instruct
model.Fixes #5739
Important
Fixes
max_tokens
error formoonshotai/kimi-k2-instruct
on Groq by updatingmaxTokens
to 16384 ingroq.ts
.max_tokens
error formoonshotai/kimi-k2-instruct
model on Groq by updatingmaxTokens
to 16384.maxTokens
from 8192 to 16384 ingroq.ts
formoonshotai/kimi-k2-instruct
.This description was created by
for ea4860a. You can customize this summary. It will automatically update as commits are pushed.