server : fix reasoning budget WebUI precedence over model.ini#24517
Merged
Conversation
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
ngxson
approved these changes
Jun 12, 2026
ServeurpersoCom
approved these changes
Jun 12, 2026
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. |
Member
Author
I need it for when I use the same model with the web UI and with a 3rd-party agent (e.g. |
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
cont #23434
When
reasoning-budgetis set inmodel.ini, the per-requestthinking_budget_tokensfrom 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()— thejson_value(body, "thinking_budget_tokens", -1)call is now made first, andopt.reasoning_budgetis used only when the body value is-1(unset).Requirements