Repository navigation
fix(studio): use --reasoning for launch defaults - #8521
ousamabenyounes wants to merge 10 commits into
Conversation
|
@codex review |
|
Codex Review: Didn't find any major issues. Keep them coming! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
94baeb6 to
b0c0af4
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b0c0af4b9e
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
Thank you for updating this PR. GitHub now reports the branch as mergeable on current A separately validated current-main implementation remains available as one commit here: It keeps the change generic and avoids regressions introduced since this PR was opened:
Current-main validation: 9 focused launch-reasoning tests passed; 1,659 adjacent capability, placement, and launch tests passed; Ruff, the repository format script, and Two regression guards from that commit are still worth carrying into this PR before merge:
I am intentionally not opening a competing PR while this one remains active. |
a71f987 to
148c8e5
Compare
|
Addressed the inherited reasoning override on |
|
Thank you @Apoze for taking the time to investigate this and share your fix. Incorporated the relevant fix and tests, and made sure your contribution was properly credited through the |
|
I added the two remaining test-only regression guards on top of the current head
Commit: Apoze@e0d0066 Validation: 323 adjacent launch/llama-server reasoning tests passed; Ruff check and git cherry-pick e0d0066193353d5d5abbe796eb10f6eabcf07d5f |
148c8e5 to
70a2843
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 70a2843125
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 54142a3adf
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
Follow-up pushed in I verified Apoze's 2026-08-24 comment and test-only commit CI then exposed two current-main source-sentinel drifts, both fixed as separate test-only commits. The latest push also addresses the three launcher review threads: explicit Local validation:
Remote PR checks are green on the latest SHA; the only non-pass rows are the expected skipped GPU/gate/file-edit/resume jobs. |
|
The launcher change itself is contained, but this branch also rewrites the sentinels in studio/backend/tests/test_non_gguf_reload_settings.py and tests/studio/test_model_picker_contracts.py, which loosens guards unrelated to reasoning. Could you split those two into their own change and keep this one to the llama-server reasoning flag? |
Co-authored-by: Apoze <[email protected]>
Add regression coverage for preserving model thinking defaults on modern --reasoning launches and keeping reasoning_effort-style templates in chat-template kwargs. Adapt the launch test backend double to current main's keyworded health and GPU probes after rebasing. Co-authored-by: Apoze <[email protected]>
Keep LLAMA_ARG_REASONING=auto on the model-derived launch default path, synchronize explicit on/off overrides with reasoning_default, and avoid emitting fallback enable_thinking kwargs when an inconclusive probe leaves an explicit environment override as the only trusted launch control.
e4c893e to
eab442f
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: eab442f62d
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| if explicit_env_reasoning is not None: | ||
| self._reasoning_default = explicit_env_reasoning == _REASONING_ON |
There was a problem hiding this comment.
Keep the recorded default aligned on old binaries
When the capability probe conclusively identifies an older binary (supports_reasoning_flag=False and mtp_probe_inconclusive=False) and LLAMA_ARG_REASONING is explicitly on or off, this assignment records the environment value even though the fallback below still emits the model-derived enable_thinking kwarg. Older managed binaries intentionally ignore that environment variable (unsloth_cli/commands/start.py:1271-1274), so the running template uses thinking_default while omitted Anthropic requests consult the contradictory reasoning_default at routes/inference.py:4239, potentially leaking genuine reasoning or misclassifying literal think markup. Only synchronize this property when the environment override can actually control the selected binary.
Useful? React with 👍 / 👎.
|
Confirmed main still builds the launch with |
…args
Three launch paths disagreed with the reasoning default Studio recorded.
LLAMA_ARG_REASONING was read as on/off only, but llama-server's own parser
(common/arg.cpp is_truthy / is_falsey / is_autoy) also takes enabled/true/1,
disabled/false/0 and -1. An operator on any of those spellings was read as
"no override", so the launch appended its own --reasoning, and llama-server
prefers the command line over the environment ("LLAMA_ARG_REASONING
environment variable is set, but will be overwritten by command line
argument --reasoning"). Their choice was silently discarded.
The kwargs were also derived from the model's default and only then was the
operator's default recorded, so the two disagreed wherever the override could
not be expressed as --reasoning: a build whose --help lacks the flag ignores
LLAMA_ARG_REASONING as well and ran on the model default, and a
reasoning_effort template has no enable_thinking for the flag to carry, so
gpt-oss kept its "high" ladder under LLAMA_ARG_REASONING=off while Studio
reported thinking off. Resolving the override first fixes both.
Restores the launch log dropped with the old kwargs branch, now naming which
of the three channels carries the default, since unslothai#7526 was diagnosed from it.
An exhaustive sweep of supports_reasoning_flag x mtp_probe_inconclusive x 16
environment values x 3 reasoning styles x preserve support x thinking default
(1536 launches) goes from 264 contradictory launches to none. The 27 tests
here cover the new cells and no longer depend on the caller's environment: an
exported LLAMA_ARG_REASONING=on turned three of them red for reasons that had
nothing to do with the code under test.
Co-authored-by: ousamabenyounes <[email protected]>
Co-authored-by: Apoze <[email protected]>
|
Reviewed this properly and pushed the fixes to your branch in The premise checks outThe thing I most wanted to rule out was whether It is not a gate. Upstream,
What I changedI swept the whole input space of
After the fix all 1536 cells agree. The sweep is not vacuous: reverting just the source change takes it back to 264. I also restored the Compatibility
Two follow-ups, not for this PR
Your branch is a fair way behind |
An inconclusive probe dropped enable_thinking from the launch whenever LLAMA_ARG_REASONING was explicit, on the reasoning that a build new enough to read the environment itself must not also be handed a kwarg contradicting it. That kwarg can no longer contradict anything. It is now resolved from the same environment value just above, so it sets enable_thinking to what the environment already asked for, and both write the same default_template_kwargs entry upstream. What the branch did cost was the case it could not rule out: an inconclusive probe is precisely the state where we do not know the binary is modern, and on one that is in fact old, ignoring LLAMA_ARG_REASONING, the launch carried no reasoning instruction at all and the operator's setting silently vanished. Sending the kwarg is correct on both: the value matches the environment on a modern build, and it is the only channel an old build understands. Extends the launch sweep with that axis. Against the branch point, 344 of 1536 launches contradicted the reasoning default Studio recorded; none do now.
|
Follow-up on Correction: I wrote that 264 of 1536 simulated launches contradicted the recorded reasoning default. That was measured before I added the last check to the sweep. The real figure against the branch point is 344 (96 environment-spelling, 40 legacy-desync, 128 effort-ladder, 80 inconclusive-probe). All 344 are clean now. The inconclusive-probe branchI had left this one alone, since it was a deliberate choice you made in response to review. Reading it again after the reorder, I think the reorder removed the reason it existed, so I have taken it out. The branch dropped What the branch did still cost is the case it could not rule out. An inconclusive probe is exactly the state where we do not know the binary is modern. On one that is in fact old, which ignores
Verified on your merged headThanks for merging
This looks good to merge from my side once CI is green. |
The reasoning override matched its own frozensets of on/enabled/true/1 and off/disabled/false/0 and auto/-1. This module already defines exactly those, as _LLAMA_ARG_TRUE_VALUES / _LLAMA_ARG_FALSE_VALUES / _LLAMA_ARG_AUTO_VALUES, and llama_server_args.py carries a documented second copy for the same vocabulary. A third set meant the next time llama.cpp widens what is_truthy accepts, one of them would be missed. No behaviour change: the sets are identical member for member.
|
Third pass, closing the gaps I listed as untested. Pushed One cleanup, no behaviour change
Simulations added since the last comment
Nothing else in Studio reads thisI checked every category that could have been coupled to the launch string. The argv is never persisted, never compared and never re-parsed. The relaunch decision is made from Upstream, verified against current master
One follow-up that matters, and is not this PRllama.cpp PR #28174 (2026-09-02, around b10763) made llama-server default This is pre-existing on Separately, Same user intent, different outcome depending on spelling, and this PR is what makes the surviving spelling the recommended one. It is a one-line addition to that set, but it changes inherited-extras handling rather than the launcher, and you asked to keep this PR to the reasoning flag, so I have left it out and am noting it instead. State
Still cannot answer from this host: real AMD and real Apple Silicon. Nothing in this path reads the device and the 60-cell sweep shows the arguments are invariant under it, but that is a simulation, not gfx1151 or an M-series Mac. |
|
Thanks for the contribution! For now we'll default to using chat-template-kwargs since there can be many new args which needs injecting |
Summary
llama-serverexposes--reasoning--reasoning on|offforenable_thinkingon modern builds--chat-template-kwargsfor older builds, independentpreserve_thinkingstate, andreasoning_effort-style templatesLLAMA_ARG_REASONINGoverrides fromunsloth startFixes #7526
Test verification (RED → GREEN)
Rebased PR head with the original regression test only:
Patched branch:
Follow-up test-only guards from Apoze's reviewed commit were cherry-picked and kept credited. After rebasing onto current
main, the rebased baseline needed the launch test double updated for current keyworded GPU/health probes before the file could run:One current-main Python 3.13 sentinel drift was then corrected test-only after CI exposed it:
One current-main repo CPU sentinel drift was also corrected test-only after CI exposed the model picker's centralized
selectMetaload-id shape:Validation
./run-ci.shupstream baseline: 296 backend tests + 6 CLI reasoning tests passed./run-ci.shpatched branch: 300 backend tests + 6 CLI reasoning tests passed./run-ci.shafter this follow-up commit:git diff --check, Ruff, andtests/test_launch_reasoning_args.pypassed (6 passed)545 passed)git diff --check: passed