Skip to content

Commit f4f0ddb

Browse files
committed
DeepSeek V3.1 thinking is now the default. Disable with --reasoning-budget 0.
1 parent 56f7e38 commit f4f0ddb

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

common/chat.cpp

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1328,12 +1328,8 @@ static common_chat_params common_chat_params_init_deepseek_v3_1(const common_cha
13281328
additional_context);
13291329
data.prompt = prompt;
13301330
data.format = COMMON_CHAT_FORMAT_DEEPSEEK_V3_1;
1331-
if (string_ends_with(data.prompt, "<think>\n")) {
1332-
if (!inputs.enable_thinking) {
1333-
data.prompt += "</think>";
1334-
} else {
1335-
data.thinking_forced_open = true;
1336-
}
1331+
if (inputs.enable_thinking) {
1332+
data.thinking_forced_open = true;
13371333
}
13381334
return data;
13391335
}
@@ -1377,8 +1373,13 @@ static void common_chat_parse_deepseek_v3_1(common_chat_msg_parser & builder) {
13771373
// The rest is regular content
13781374
builder.add_content(builder.consume_rest());
13791375
} else {
1380-
// If no "</think>" tag found, treat everything as regular content
1381-
builder.add_reasoning_content(builder.consume_rest());
1376+
if (builder.syntax().thinking_forced_open) {
1377+
// If no "</think>" tag found, treat everything as reasoning content
1378+
builder.add_reasoning_content(builder.consume_rest());
1379+
} else {
1380+
// If no "</think>" tag found, treat everything as regular content
1381+
builder.add_content(builder.consume_rest());
1382+
}
13821383
}
13831384
}
13841385

0 commit comments

Comments
 (0)