Skip to content

Commit

Permalink
🪙 fix: Deepseek Pricing & Titling (#5459)
Browse files Browse the repository at this point in the history
  • Loading branch information
danny-avila authored Jan 25, 2025
1 parent af430e4 commit 60c846b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions api/app/clients/OpenAIClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -794,7 +794,11 @@ ${convo}
}

title = (
await this.sendPayload(instructionsPayload, { modelOptions, useChatCompletion })
await this.sendPayload(instructionsPayload, {
modelOptions,
useChatCompletion,
context: 'title',
})
).replaceAll('"', '');

const completionTokens = this.getTokenCount(title);
Expand Down Expand Up @@ -1384,7 +1388,7 @@ ${convo}
return reply;
}

if (reasoningTokens.length > 0) {
if (reasoningTokens.length > 0 && this.options.context !== 'title') {
return reasoningTokens.join('') + message.content;
}

Expand Down
2 changes: 1 addition & 1 deletion api/models/tx.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ const tokenValues = Object.assign(
'claude-': { prompt: 0.8, completion: 2.4 },
'command-r-plus': { prompt: 3, completion: 15 },
'command-r': { prompt: 0.5, completion: 1.5 },
'deepseek-reasoner': { prompt: 0.14, completion: 0.55 },
'deepseek-reasoner': { prompt: 0.14, completion: 2.19 },
deepseek: { prompt: 0.07, completion: 0.28 },
/* cohere doesn't have rates for the older command models,
so this was from https://artificialanalysis.ai/models/command-light/providers */
Expand Down

0 comments on commit 60c846b

Please sign in to comment.