Skip to content

Commit ebc1077

Browse files
authored
server : fix reasoning budget WebUI precedence over model.ini (ggml-org#24517)
When reasoning-budget is set in model.ini, the per-request thinking_budget_tokens from the WebUI was ignored because the model.ini value took unconditional precedence. Swap the precedence so the WebUI per-request value is checked first, with the model.ini value serving as a fallback default. Assisted-by: pi:llama.cpp/Qwen3.6-27B
1 parent 3e7bd4f commit ebc1077

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

tools/server/server-common.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1126,9 +1126,9 @@ json oaicompat_chat_params_parse(
11261126

11271127
// Reasoning budget: pass parameters through to sampling layer
11281128
{
1129-
int reasoning_budget = opt.reasoning_budget;
1130-
if (reasoning_budget == -1 && body.contains("thinking_budget_tokens")) {
1131-
reasoning_budget = json_value(body, "thinking_budget_tokens", -1);
1129+
int reasoning_budget = json_value(body, "thinking_budget_tokens", -1);
1130+
if (reasoning_budget == -1) {
1131+
reasoning_budget = opt.reasoning_budget;
11321132
}
11331133

11341134
if (!chat_params.thinking_end_tag.empty()) {

0 commit comments

Comments
 (0)