Skip to content

Commit 663747e

Browse files
committed
Use deepseek-r1 recommended temperature
1 parent 7b66827 commit 663747e

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/api/providers/openrouter.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,12 +110,20 @@ export class OpenRouterHandler implements ApiHandler, SingleCompletionHandler {
110110
maxTokens = 8_192
111111
break
112112
}
113+
114+
let temperature = 0
115+
switch (this.getModel().id) {
116+
case "deepseek/deepseek-r1":
117+
// Recommended temperature for DeepSeek reasoning models
118+
temperature = 0.6
119+
}
120+
113121
// https://openrouter.ai/docs/transforms
114122
let fullResponseText = ""
115123
const stream = await this.client.chat.completions.create({
116124
model: this.getModel().id,
117125
max_tokens: maxTokens,
118-
temperature: 0,
126+
temperature: temperature,
119127
messages: openAiMessages,
120128
stream: true,
121129
// This way, the transforms field will only be included in the parameters when openRouterUseMiddleOutTransform is true.

0 commit comments

Comments
 (0)