-
Notifications
You must be signed in to change notification settings - Fork 2.6k
fix: override Kimi-K2 context window to 131K to match OpenRouter advertised specs #6760
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -247,5 +247,11 @@ export const parseOpenRouterModel = ({ | |||||||||
| modelInfo.maxTokens = 32768 | ||||||||||
| } | ||||||||||
|
|
||||||||||
| // Override kimi-k2 context window to match OpenRouter's advertised 131K | ||||||||||
| // The API returns 63K but the website shows 131K | ||||||||||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would it be helpful to add a link to the OpenRouter website page as a reference? For example:
Suggested change
|
||||||||||
| if (id === "moonshotai/kimi-k2") { | ||||||||||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consider moving this override closer to other model-specific overrides (lines 236-248) for better code organization and consistency with the existing pattern. |
||||||||||
| modelInfo.contextWindow = 131072 | ||||||||||
| } | ||||||||||
|
|
||||||||||
| return modelInfo | ||||||||||
| } | ||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this intentional? The test comment mentions "Still uses original for maxTokens calculation", but it might be confusing that the context window is overridden to 131K while maxTokens remains based on the original 63K (20% of 63K = 12,600). Consider either: