Repository navigation
Studio engines: find a per-user uv for vLLM / SGLang installs, and tell a retried failure apart - #18504
Conversation
…ure apart The vLLM / SGLang install looked for uv only on PATH, so a uv installed in ~/.local/bin was missed whenever Studio started without the shell profile that adds it. Use the shared uv lookup the other Studio installers use. The job file now records when each attempt ended, Settings shows "Last attempt: <time>" under a failed install, and opening the install prompt for a retry hides the previous failure. Fixes unslothai#18492
|
@codex review |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. What shall we delve into next? 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". |
…route effect from #18420 (#18534) ## Summary Two tests in `studio/frontend/tests/image-generation-defaults.test.ts` fail on `main` (seen in `Frontend unit tests (Windows)` on #18504, which only touches engine installs; they fail the same way on Linux): ``` not ok - routed image picks apply and transactionally roll back model defaults assert.ok(routeStart >= 0 && routeEnd > routeStart) not ok - a base file in a Turbo / Flash folder or repo keeps the backend's recipe, not the distilled one /models/chroma1-flash Chroma1-HD.safetensors + { guidance: 3.5, steps: 26 } - { guidance: 0, steps: 9 } ``` ## Root cause Both come from #18420, and in both the product change is intended: - **Route test.** It located the routed-pick block between `const pick = diffusionRoutePick(` and the comment `// Reload the current model with the current advanced options.`. #18420 removed that comment, so the end anchor was not found. The route effect itself still applies defaults through `applyImageModelDefaults(wanted, "auto", ...)` and rolls back with `revertPick(revert)` when the load does not start. - **Base file in a Flash folder.** #18420 filled in the frontend defaults table to match the backend row for row (Chroma, Anima, Krea, `flux1-*`, MiniMax-H3-Image). The test pinned `{ steps: 9, guidance: 0 }`, which was the fallback a base Chroma1-HD file got while the table had no Chroma row. It now gets Chroma's own recipe (26 / 3.5), which is exactly what the test's name promises: the base file's recipe, not the Flash one (16 / 1). ## Changes - Route test: the block ends at the effect's own dependency list (`]);`), so it no longer depends on a comment. The four assertions inside it are unchanged. - Base-file test: each case now asserts the key resolves to the base file's own recipe (`defaultsFor(file)`) and is not the distilled recipe (Anima-Turbo 10 / 1, Chroma1-Flash 16 / 1), instead of pinning whatever number the table held at the time. Test-only change. ## Testing - `node --test tests/image-generation-defaults.test.ts`: 26 passed (2 fail on `main`). - Sabotage, each against this branch: - `defaultsKeyFor` returning a Flash / Turbo folder's own key before the file's: the base-file test fails (along with two neighbours that guard the same rule). - Dropping the route effect's `revertPick(revert)`: the route test fails.
|
Thanks @debojyoti-dev. vLLM and SGLang installs failed with "uv is unavailable. Repair the Unsloth installation and retry." when uv was installed per user in With A retry that failed with the same message also left Settings unchanged, so it looked like nothing happened. The job file now records Live before and after in Settings > About > More engines, main (
In the load dialog the install prompt opens on its own after a failure, so the old error still shows next to it there, and "Last attempt" shows a time without a date. Both can be fixed separately. |


Fixes #18492.
What this changes
Finding uv. The vLLM / SGLang install looked for uv only with
shutil.which("uv"). Studio's web UI, systemd/launchd service and desktop launches don't read the shell profile that adds~/.local/binto PATH, so a uv installed per user by its standalone installer was never found and the install failed withuv is unavailable. Repair the Unsloth installation and retry.The installer now uses the same lookup as the other Studio installers (cosmos guardrail, NVFP4, sd.cpp cuDNN):utils.mlx_repair._uv_executable, which tries PATH first and then~/.local/bin,~/.cargo/bin,/opt/homebrew/binand/usr/local/bin.Telling a retry's failure apart from the last one. A retry that failed the same way left the page exactly as it was, so it looked like nothing happened.
finished_atwhen an attempt ends (success, error, cancelled, waiting). A new attempt clears it.managedEngines.lastAttempt, translated in all 25 locales.Screenshots
Settings > About > More engines, real browser,
/api/enginesanswered in-process by each tree's ownengine_install(status/start_install) with uv missing everywhere. Only the GPU / WSL gates were bypassed, since this machine has no supported GPU.Testing
Real install in a Linux container (Debian bookworm), set up like the report: uv 0.9.5 only in
/home/chris/.local/bin, a Studio venv without uv, and the process started withPATH=<studio venv>/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin(no.bashrc). Two attempts throughengine_install.start_install("vllm"), with onlysupport_reason/gpu_platformreplaced (no NVIDIA GPU in the container). Each attempt is cancelled once the realuv pip syncis downloading.main:
this branch:
With uv removed from
~/.local/bintoo, both attempts still fail with the same message, now with differentfinished_atvalues (1795105638.08 and 1795105640.15).Tests
studio/backend/tests/test_engine_install_uv_lookup.py(4 tests: per-user uv off PATH is used, PATH still wins, each attempt records its own end time, progress updates don't end an attempt). All 4 fail on main.studio/frontend/tests/engine-install-last-attempt.test.ts(SSR render ofEngineInstall: failure shows its time, two failures render differently, older backends withoutfinished_atstill show the failure, a running retry hides the old failure).test_managed_engines.py,test_engine_atomic_json.py,test_engine_status_stays_cold.py+ the new file: 272 passed, 1 skipped (main: 268 passed, 1 skipped).test_managed_engines.py199 passed, 3 failed, the same 3 that fail on clean main here (test_engine_cuda_home_is_the_locked_pip_nvcc,test_docker_engine_python_survives_image_replacement[*]);test_managed_engines_rocm,test_engine_atomic_json,test_engine_status_stays_cold,test_managed_engine_offer,test_wsl_hostall pass.npm test16,775 tests, 16,773 pass; the 2 failures (escaped-inline-math,markdown-cut-reply-repair, both timing-based) pass when rerun alone;npm run typecheckpasses;npm run i18n:check:strictpasses; eslint on the changed files reports only the 3 errors already present on main.Not covered: a complete vLLM/SGLang install on a real supported GPU (this machine has an RTX 3050 on driver 566, below the 580 the engines need), and macOS.