-
Notifications
You must be signed in to change notification settings - Fork 2.5k
fix: correct context size for deepseek/deepseek-chat-v3.1:free model #7955
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 |
|---|---|---|
|
|
@@ -263,5 +263,13 @@ export const parseOpenRouterModel = ({ | |
| modelInfo.maxTokens = 32768 | ||
| } | ||
|
|
||
| // Set deepseek-chat-v3.1:free model to correct context size | ||
| // OpenRouter reports 64k but the actual context is 163.8k tokens | ||
|
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. Is there any documentation or issue tracker link we could reference about why OpenRouter reports incorrect values for this model? It would help future maintainers understand why this override exists. |
||
| if (id === "deepseek/deepseek-chat-v3.1:free") { | ||
|
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. I see we're adding another hardcoded override here, but the user feedback on issue #7952 specifically mentioned: "hard-coding this specific provider is not the solution. bad bot". While this does fix the immediate problem, should we consider a more scalable approach? Perhaps:
The pattern of hardcoded overrides (we already have 5 others above) is accumulating technical debt. |
||
| modelInfo.contextWindow = 163840 // 163.8k tokens | ||
| // Recalculate maxTokens based on the corrected context window | ||
| modelInfo.maxTokens = maxTokens || Math.ceil(163840 * 0.2) | ||
| } | ||
|
|
||
| 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.
Good test coverage! The test properly validates that the override works as expected, checking both the context window and the recalculated maxTokens.