Skip to content

fix(sdk): cap effective_max_output_tokens with DEFAULT_MAX_OUTPUT_TOKENS_CAP#3319

Open
vanhci wants to merge 1 commit into
OpenHands:mainfrom
vanhci:fix/issue-3317
Open

fix(sdk): cap effective_max_output_tokens with DEFAULT_MAX_OUTPUT_TOKENS_CAP#3319
vanhci wants to merge 1 commit into
OpenHands:mainfrom
vanhci:fix/issue-3317

Conversation

@vanhci
Copy link
Copy Markdown

@vanhci vanhci commented May 20, 2026

Fixes #3317. When litellm model metadata reports a max_output_tokens value that exceeds the model's actual API limit (e.g., moonshot/kimi-k2.5 through custom base_url), apply DEFAULT_MAX_OUTPUT_TOKENS_CAP (16384) as a universal safety cap. This generalizes the fix from #2264 which only handled bedrock/ models.

@all-hands-bot
Copy link
Copy Markdown
Collaborator

[Automatic Post]: I have assigned @juanmichelini as a reviewer based on git blame information. Thanks in advance for the help!

This comment was created by an AI agent (OpenHands) on behalf of the user.

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.

[Bug] SDK effective_max_output_tokens exceeds actual model limits for non-Bedrock providers (moonshot, deepseek via custom base_url)

2 participants