server : fix reasoning budget WebUI precedence over model.ini (#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
This commit is contained in:
@@ -1126,9 +1126,9 @@ json oaicompat_chat_params_parse(
|
|||||||
|
|
||||||
// Reasoning budget: pass parameters through to sampling layer
|
// Reasoning budget: pass parameters through to sampling layer
|
||||||
{
|
{
|
||||||
int reasoning_budget = opt.reasoning_budget;
|
int reasoning_budget = json_value(body, "thinking_budget_tokens", -1);
|
||||||
if (reasoning_budget == -1 && body.contains("thinking_budget_tokens")) {
|
if (reasoning_budget == -1) {
|
||||||
reasoning_budget = json_value(body, "thinking_budget_tokens", -1);
|
reasoning_budget = opt.reasoning_budget;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!chat_params.thinking_end_tag.empty()) {
|
if (!chat_params.thinking_end_tag.empty()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user