Use deepseek-r1 recommended temperature

This commit is contained in:
Piotr Rogowski
2025-01-25 23:34:50 +01:00
parent 7b668277fa
commit 663747eb2d

View File

@@ -110,12 +110,20 @@ export class OpenRouterHandler implements ApiHandler, SingleCompletionHandler {
maxTokens = 8_192 maxTokens = 8_192
break break
} }
let temperature = 0
switch (this.getModel().id) {
case "deepseek/deepseek-r1":
// Recommended temperature for DeepSeek reasoning models
temperature = 0.6
}
// https://openrouter.ai/docs/transforms // https://openrouter.ai/docs/transforms
let fullResponseText = "" let fullResponseText = ""
const stream = await this.client.chat.completions.create({ const stream = await this.client.chat.completions.create({
model: this.getModel().id, model: this.getModel().id,
max_tokens: maxTokens, max_tokens: maxTokens,
temperature: 0, temperature: temperature,
messages: openAiMessages, messages: openAiMessages,
stream: true, stream: true,
// This way, the transforms field will only be included in the parameters when openRouterUseMiddleOutTransform is true. // This way, the transforms field will only be included in the parameters when openRouterUseMiddleOutTransform is true.