Skip to content

server : fix reasoning budget WebUI precedence over model.ini#24517

Merged
ggerganov merged 1 commit into
masterfrom
gg/server-reasoning-budget-webui-precedence
Jun 12, 2026
Merged

server : fix reasoning budget WebUI precedence over model.ini#24517
ggerganov merged 1 commit into
masterfrom
gg/server-reasoning-budget-webui-precedence

Conversation

@ggerganov

@ggerganov ggerganov commented Jun 12, 2026

Copy link
Copy Markdown
Member

Overview

cont #23434

When reasoning-budget is set in model.ini, the per-request thinking_budget_tokens from the WebUI is ignored because the model.ini value takes unconditional precedence.

Swap the precedence so the WebUI per-request value is checked first, with the model.ini value serving as a fallback default.

Additional information

One-line fix in oaicompat_chat_params_parse() — the json_value(body, "thinking_budget_tokens", -1) call is now made first, and opt.reasoning_budget is used only when the body value is -1 (unset).

Requirements

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
@ggerganov ggerganov marked this pull request as ready for review June 12, 2026 13:16
@ggerganov ggerganov requested a review from a team as a code owner June 12, 2026 13:16
@ggerganov ggerganov requested a review from allozaur June 12, 2026 13:16
@ggerganov ggerganov merged commit ebc1077 into master Jun 12, 2026
24 of 25 checks passed
@ggerganov ggerganov deleted the gg/server-reasoning-budget-webui-precedence branch June 12, 2026 15:00
@eapache

eapache commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

TBH I think this is kind of the wrong direction - if reasoning budget is set in config.ini it would be better if the UI automatically reflected that value, instead of defaulting to reasoning off and then overriding the config.ini.

Same class of issue as #24274, the precedence is not clear but if the UI is just going to override all features of the config.ini then why even have the config.ini.

@ggerganov

Copy link
Copy Markdown
Member Author

then why even have the config.ini.

I need it for when I use the same model with the web UI and with a 3rd-party agent (e.g. pi). In that case, the pi uses the config.ini value, while the web UI uses it's own config.

thiswillbeyourgithub added a commit to thiswillbeyourgithub/llama.cpp that referenced this pull request Jun 15, 2026
…recedence

Upstream PR ggml-org#24517 (ggerganov) made the per-request thinking_budget_tokens
take precedence over the CLI / model.ini --reasoning-budget default, with
the CLI value as a fallback. That is the opposite of this branch's earlier
hard-ceiling behaviour, so this resolution drops the ceiling clamp and
adopts the upstream precedence for the budget value itself.

The additive per-request thinking_budget_message fallback from this branch
is kept: it does not touch the precedence change. The block comment is
updated to describe the new precedence instead of the removed ceiling.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
anaisbetts pushed a commit to anaisbetts/llama.cpp that referenced this pull request Jun 16, 2026
…rg#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
(cherry picked from commit ebc1077)
(cherry picked from commit e9c7bc1c4b0ea1a90877e3245d997483f02d1d0d)
adrianhoehne pushed a commit to adrianhoehne/llama.cpp that referenced this pull request Jul 5, 2026
…rg#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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants