Skip to content

Commit

Permalink
perf: optimize model deepseek、claude、gemini max_tokens
Browse files Browse the repository at this point in the history
  • Loading branch information
jamebal committed Jan 14, 2025
1 parent e4eede9 commit fc01365
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions service/src/chatgpt/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,25 @@ export async function initApi(key: KeyConfig, chatModel: string, maxContextCount
options.maxModelTokens = 16385
options.maxResponseTokens = 4096
}
else if (model.toLowerCase().includes('deepseek-chat')) {
// 'deepseek-chat'
options.maxModelTokens = 65536
options.maxResponseTokens = 8192
}
else if (model.toLowerCase().includes('claude')) {
// 'claude'
options.maxModelTokens = 65536
options.maxResponseTokens = 8192
}
else if (model.toLowerCase().includes('gemini')) {
// 'gemini'
options.maxModelTokens = 32767
options.maxResponseTokens = 8192
}
// If none of the above, use the default values
else {
options.maxModelTokens = 4096
options.maxResponseTokens = 1024
options.maxModelTokens = 16385
options.maxResponseTokens = 4096
}

if (isNotEmptyString(OPENAI_API_BASE_URL))
Expand Down

0 comments on commit fc01365

Please sign in to comment.