]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
server : fix reasoning budget WebUI precedence over model.ini (#24517)
authorGeorgi Gerganov <redacted>
Fri, 12 Jun 2026 14:59:56 +0000 (17:59 +0300)
committerGitHub <redacted>
Fri, 12 Jun 2026 14:59:56 +0000 (17:59 +0300)
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
tools/server/server-common.cpp

index 9f3caac8f723dd2918fcffb40ce452daf82e9e5c..aebaf1f91bb938a241deb0167a75471f5f377b66 100644 (file)
@@ -1126,9 +1126,9 @@ json oaicompat_chat_params_parse(
 
     // Reasoning budget: pass parameters through to sampling layer
     {
-        int reasoning_budget = opt.reasoning_budget;
-        if (reasoning_budget == -1 && body.contains("thinking_budget_tokens")) {
-            reasoning_budget = json_value(body, "thinking_budget_tokens", -1);
+        int reasoning_budget = json_value(body, "thinking_budget_tokens", -1);
+        if (reasoning_budget == -1) {
+            reasoning_budget = opt.reasoning_budget;
         }
 
         if (!chat_params.thinking_end_tag.empty()) {