Repository navigation
Studio setup: report a missing llama.cpp in Tauri mode instead of aborting the install - #7720
Conversation
…rting the install setup.sh ends by exiting non-zero when the llama.cpp prebuilt did not produce a usable server and it was called from install.sh, so the installer can report the GGUF failure after finishing PATH and shortcut setup. In Tauri mode that non-zero exit is not "report", it is "abort": install.rs turns it into "Installation failed". So one transient prebuilt download failure, and a single HTTP 403 rate limit is enough, fails the entire first-launch install of the desktop app, moments after setup.sh's own footer said Installed. Everything except GGUF inference is in fact working, and whisper.cpp in this same script already degrades rather than failing for exactly this case. Tauri mode now emits a [TAURI:STEP] line naming what is missing and how to get it back. Every other caller keeps the non-zero exit unchanged.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2733359e4b
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| case "${UNSLOTH_TAURI_MODE:-0}" in | ||
| 1|true) | ||
| printf '[TAURI:STEP] %s\n' \ | ||
| "llama.cpp unavailable; GGUF inference is disabled until 'unsloth studio update' succeeds" |
There was a problem hiding this comment.
Apply degraded Tauri handling to the Windows installer
This special case only changes the Unix setup path. On Windows, install.rs::resolve_install_script selects install.ps1, which sets UNSLOTH_TAURI_MODE and invokes studio/setup.ps1; its degraded footer still calls Exit-SetupFailure, and install.ps1 converts that nonzero status into an installation failure. Consequently, the same transient llama.cpp download failure that this change tolerates on Linux/macOS still aborts the desktop first-launch install on Windows; mirror this handling in setup.ps1 and cover that path.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Confirmed and fixed in 2637490. install.ps1 sets SKIP_STUDIO_BASE=1 (2764) and UNSLOTH_TAURI_MODE (2787), then turns any non-zero setup.ps1 status into Exit-InstallFailure (2826), which install.rs reports as "Installation failed", so Windows reproduced this exactly. setup.ps1 now gates on UNSLOTH_TAURI_MODE the same way Exit-SetupFailure already does at line 83, and still fails for every other caller. Pinned by a static block check in tests/sh/test_llama_degraded_tauri_mode.sh.
| printf '[TAURI:STEP] %s\n' \ | ||
| "llama.cpp unavailable; GGUF inference is disabled until 'unsloth studio update' succeeds" |
There was a problem hiding this comment.
Surface the degradation as a visible warning
During a full first-launch install, install.rs converts this marker into an install-step event, but the frontend listener in use-tauri-backend.ts discards the payload and only increments currentStepIndex; InstallingContent displays a fixed label from INSTALL_STEPS, not the emitted text. The successful exit then immediately starts the backend and leaves the setup screen, so users are never actually told that GGUF is disabled or how to repair it even though the install is now recorded as successful; emit or persist this through a warning channel that the post-install UI displays.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Right, and worse than I thought. install.rs maps [TAURI:STEP] to install-step, and use-tauri-backend.ts only increments a counter without ever storing the payload, so the text was discarded. install.sh already emits exactly 7 unique STEP markers against the 7-entry INSTALL_STEPS list, so an eighth rendered "Step 8 of 7". Switched to [TAURI:PROGRESS] in 2637490, which becomes install-progress-detail and is rendered verbatim on the installing screen. New test asserts the notice never emits [TAURI:STEP].
| case "${UNSLOTH_TAURI_MODE:-0}" in | ||
| 1|true) | ||
| printf '[TAURI:STEP] %s\n' \ | ||
| "llama.cpp unavailable; GGUF inference is disabled until 'unsloth studio update' succeeds" |
There was a problem hiding this comment.
Include GGUF export in the disabled-feature notice
When this branch is reached on a fresh install after both the prebuilt and source fallback fail, the llama.cpp directory also lacks llama-quantize, not just llama-server. setup.sh installs that binary for the GGUF export pipeline, and unsloth/save.py::check_llama_cpp raises when it is absent, so the successful degraded install disables normal quantized GGUF exports as well as inference. Reporting only that inference is disabled misleads users into expecting Studio's advertised GGUF export workflow to work; name both unavailable capabilities in the recovery notice.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Not taking this one. GGUF export self-heals: unsloth/save.py wraps check_llama_cpp() in try/except and falls back to install_llama_cpp(), so an export run installs what it needs on demand. Only llama-server inference has no fallback, which is what the notice already says. Naming export here would tell the user something is broken when it is not.
Two problems with the first version, both found in review. The notice used [TAURI:STEP], which is the wrong channel twice over. install.rs maps it to install-step, and use-tauri-backend.ts counts those without ever storing the payload, so the text was thrown away. Worse, install.sh already emits exactly seven unique STEP markers against the seven-entry INSTALL_STEPS list, so an eighth pushed the counter past the end and rendered 'Step 8 of 7'. [TAURI:PROGRESS] becomes install-progress-detail, which the installing screen renders verbatim. Windows had the identical defect and was not covered. install.ps1 sets both SKIP_STUDIO_BASE=1 and UNSLOTH_TAURI_MODE, then turns any non-zero setup.ps1 status into Exit-InstallFailure, which install.rs reports as 'Installation failed'. setup.ps1 now gates on UNSLOTH_TAURI_MODE the same way Exit-SetupFailure already does, and still fails for every other caller. Tests: 8 cases, adding one that the notice never emits [TAURI:STEP] and a setup.ps1 block check for the Windows parity.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 263749068e
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| printf '[TAURI:PROGRESS] %s\n' \ | ||
| "llama.cpp unavailable; GGUF inference is disabled until 'unsloth studio update' succeeds" |
There was a problem hiding this comment.
Persist the degraded-install warning after setup
On a Tauri first-launch install where llama.cpp fails, this progress event is emitted at the very end of setup and the successful start_install invocation immediately switches the frontend to starting (use-tauri-backend.ts:363-370); progressDetail is rendered only by the installing screen (startup-screen.tsx:391-392), so the warning at best flashes briefly and then disappears while the app continues successfully. The fresh evidence in this revision is that the new notice is sent only through [TAURI:PROGRESS], without any state or post-install warning that survives that status transition; persist and display the degraded state after installation instead.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
The observations about the frontend are right, but the conclusion rests on there being no other channel, and there is one. LLAMA_SERVER_NOT_FOUND_DETAIL (llama_cpp.py:131) says "This is a GGUF model, but the llama.cpp runtime (llama-server) is not installed. Run unsloth studio setup..." and is raised both at load (llama_cpp.py:7470) and in the remote-GGUF preflight before any multi-GB download (model_config.py:3114). routes/inference.py:6504 and :6926 turn it into a 400 with that detail rather than a generic 500, and the chat runtime shows it as an error toast plus a native notification. So the user is told at the moment it matters, with the recovery command, and the vanishing install-time line loses no information.
Separately and worth recording: there is a real gap here, just not one this PR creates. get_update_status cannot distinguish "no llama.cpp at all" from "up to date" (both give supported=false, update_available=false), so discovery is reactive rather than proactive and the update banner never appears. Closing that needs a new missing state on the status endpoint plus UI, which is a feature and unrelated to whether setup.sh aborts or reports.
|
@codex review |
|
Codex Review: Didn't find any major issues. Can't wait for the next one! 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". |
|
@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". |
This is a behaviour change to first-launch install, so it wants a look before merging. After this, a desktop install whose llama.cpp prebuilt failed to download succeeds without GGUF inference, where today it fails outright.
The problem
setup.shends with:The intent is right for the shell installer.
install.shneeds the non-zero exit so it can finish PATH and shortcut setup and only then report the GGUF failure. The comment above the block says exactly that.In Tauri mode it does something else.
install.rsturns the resulting error intoInstallation failed, so the whole first-launch install of the desktop app is aborted. One transient prebuilt download failure is enough, and a single HTTP 403 rate limit will do it.The result the user sees is a contradiction:
setup.sh's own footer prints the Installed banner and the usage hints, and then the app reports that installation failed. Nothing is repaired by retrying the install, because the venv, the frontend, the shortcuts and every non-GGUF workflow were all set up correctly. Only the llama.cpp binary is missing, andunsloth studio updatefetches it later.whisper.cpp in this same script already handles its own prebuilt failure this way. It prints a warning naming what is unavailable and what still works, and does not fail the install.
The change
Tauri mode emits a
[TAURI:PROGRESS]line saying what is missing and how to get it back:Every other caller keeps
setup_fail 1exactly as before.install.shis unaffected.setup.ps1gets the same treatment, because Windows had the identical defect:install.ps1sets bothSKIP_STUDIO_BASE=1andUNSLOTH_TAURI_MODE, then turns any non-zerosetup.ps1status intoExit-InstallFailure, whichinstall.rsreports as "Installation failed". The guard is the same@("1", "true") -contains $env:UNSLOTH_TAURI_MODEform thatExit-SetupFailurealready uses at the top of that file.Why the progress channel and not the step channel
The first version of this used
[TAURI:STEP], which was wrong twice over:install.rsmaps it toinstall-step, anduse-tauri-backend.tsonly increments a counter with it. The payload is never stored, so the text was silently discarded.install.shalready emits exactly 7 unique STEP markers, against a 7-entryINSTALL_STEPSlist instartup-screen.tsx. An eighth marker pushescurrentStepIndexpast the end, andstepNumis not clamped, so the screen renders "Step 8 of 7".[TAURI:PROGRESS]becomesinstall-progress-detail, whichsetProgressDetailstores and the installing screen renders verbatim below the step line. It also leaves the step counter alone.Testing
tests/sh/test_llama_degraded_tauri_mode.sh, 8 cases, all passing. It extracts the block and runs it withsetup_failstubbed, so the contract is pinned without executing an install:UNSLOTH_TAURI_MODEunset or 0unsloth studio update(SKIP_STUDIO_BASE=0) is still silent[TAURI:STEP], so it cannot consume an install stepsetup.ps1gates onUNSLOTH_TAURI_MODE, emits the progress line, and still reachesExit-SetupFailureotherwiseThe first two cases fail against the current
setup.shand pass with this change. The file is picked up automatically by the discovery-based Backend CI shell step, andtests/studio/test_ci_shell_suite_coverage.pystill passes 15/15.