Skip to content

Studio: upgrade a Desktop Chat only install to the full install from Settings - #14593

Merged
danielhanchen merged 22 commits into
unslothai:mainfrom
oobabooga:worktree-dc047-full-install-upgrade
Oct 22, 2026
Merged

danielhanchen merged 22 commits into
unslothai:mainfrom
oobabooga:worktree-dc047-full-install-upgrade

Conversation

@oobabooga

@oobabooga oobabooga commented Oct 22, 2026 •

Copy link
Copy Markdown
Member

Desktop users who chose Chat only (GGUF) (#14245) currently have to use Repair installation to upgrade. That action is buried under Danger zone, its wording assumes PyTorch is already installed, and Settings searches for "train", "pytorch" or "chat only" find nothing. After the upgrade, Train can remain disabled until the app restarts.

This PR adds Upgrade to full install to Settings, updates the Train and Export hints to point there, and refreshes hardware detection after the upgrade so Train can become available without another app restart. On an eligible install, clicking the greyed Train row also opens the same upgrade dialog.

What changes

  • Settings > General gains an Install type row below the version and update controls. Eligible Chat only installations get an Upgrade to full install button. Settings search finds the row through terms such as "train", "pytorch" and "chat only", and excludes it when the row is hidden.
  • The confirmation dialog explains what the full install adds: training, export, video, safetensors models and additional image generation features. It warns about the download of several gigabytes and the server restart, and confirms that chats, models and settings are kept.
  • Train and Export hints direct eligible users to the new Settings action. Train stays disabled until training is available.
  • On an eligible Desktop Chat only install, the greyed Train row is clickable: it stays greyed out, its tooltip reads "Training is not installed. Click to install it (at least 5 GB of disk space).", and clicking it opens the same Upgrade to the full install dialog as Settings. It never navigates to or preloads Train until training is available. Hosts that cannot be upgraded keep today's disabled row and hint.
  • The confirmation dialog states the disk space the full install needs: at least 5 GB. Measured on Linux with an NVIDIA GPU, the environment grows from 1.16 GB to 7.02 GB.
  • Repair and progress messages explain that a Chat only installation is being upgraded and that this can take several minutes. Upgrade failures also get a specific message. The new Settings strings are translated in every locale.

Who gets the upgrade option

The option appears once hardware detection identifies a Chat only installation as no_torch, provided Desktop manages the backend and the backend reports no blocking hint.

  • Windows and Linux: GPU detection runs without PyTorch. It uses the existing filter for identifying GPUs that an incompatible PyTorch build cannot use: NVIDIA, ROCm-supported AMD, Intel Arc and Intel Data Center GPUs. An inconclusive detection result also allows the offer. CPU-only machines and machines with only unsupported integrated GPUs report no_gpu and keep the existing hardware requirement hint.
  • Apple Silicon: The offer is withheld when the installer would skip MLX because the machine does not meet its requirements: macOS 14 or later and Python 3.10 or later. Train and Export explain the missing requirement. An unreadable macOS version is treated as unsupported, matching the installer.
  • Other reasons for Chat only mode keep their existing hints and receive no upgrade offer.

Web and CLI installations, and Desktop connected to a backend started in a terminal, receive no upgrade action. Their existing --no-torch advice remains, except where the Mac requirement message applies. Automatic startup repair continues to preserve Chat only mode.

Implementation

The button calls the existing repairInstall(), which reruns the installer with UNSLOTH_NO_TORCH=0.

The disabled Train issue came from retaining the previous backend's hardware result while the replacement backend was still detecting hardware. The frontend now marks that result stale after a backend replacement. Train shows its checking spinner, and polling continues until a new result arrives. If detection is deferred, the old reason is cleared so the completed upgrade is not offered again.

The startup bundle budget increases by the measured growth, mostly from the new English Settings strings.

Known limits

GPU eligibility does not reproduce the installer's full selection of PyTorch packages. Some machines can still receive the offer but end up with CPU PyTorch and disabled training: Van Gogh (gfx1033), Jetson before CUDA 13, NVIDIA drivers older than CUDA 11, or installations pinned to a CPU package index. The existing Train tooltip already directs these machines to Repair installation.

GPU changes made while the app is running are detected on the next start.

Verification

Windows 11 Desktop was compared on a Ryzen AI MAX+ 395 with Radeon 8060S using two debug builds: main at the merge base (0391814917, frontend and backend), and that base plus this PR. Each used a fresh profile, a fresh Chat only install and an en-US WebView.

Both upgraded successfully and returned chat_only: false. On main, Train was still disabled after 60 seconds. With this PR, it showed the checking spinner and became enabled after 2 seconds.

  • Backend: 511 hardware, verdict, health, export and CPU-build tests pass, including the PyTorch-free sandbox suite. Regression coverage checks GPU, CPU-only, Intel UHD and inconclusive detection results. The CPU-only and Intel UHD cases fail when the new check is bypassed.
  • Frontend: Coverage includes upgrade eligibility, Settings search, dialog text, the Train hint and hardware state after backend replacement. Typecheck, i18n:check:strict, build and bundle:check pass. The full suite has 12 failures that also occur on main.

Not tested live: CPU-only or iGPU-only machines, macOS Desktop or Linux Desktop.

Linux with an NVIDIA GPU, end to end through the installer the upgrade runs:

Step Chat only install After the upgrade (UNSLOTH_NO_TORCH=0 UNSLOTH_TORCH_UPGRADE=1)
PyTorch not installed 2.13.0+cu130, CUDA available
/api/health chat_only: true, no_torch, no hint chat_only: false
Install mode record manifest no_torch: true, marker present manifest no_torch: false, marker removed
Environment size 1.16 GB 7.02 GB
User data outside the environment 7,707 files 0 changed, database row counts identical, same password still signs in

Train row, both builds against the same backend with a Chat only verdict on a GPU host (no_torch, no hint), in the Desktop shell: on main the row is disabled and a click does nothing; with this PR the row is enabled but greyed, a click opens the dialog, Cancel starts nothing, and Upgrade starts the managed repair. Same result on 3 of 3 runs.

Screenshots

BEFORE is main at the merge base, AFTER is this PR.

Train hint

1-train-hint

Settings > General

2-settings-general

Settings search for "pytorch"

3-settings-search

Repair installation on a Chat only install

4-repair-confirm

Progress screen during the upgrade

5-progress

Train once the app is back

6-after-upgrade

Export page hint

7-export

Train row on a Chat only install

Train row tooltip before and after

Clicking the greyed Train row

Clicking Train before and after

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-22T15:01:33.974314Z 853a53a Manual request
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@oobabooga

Copy link
Copy Markdown
Member Author

Reached Codex review convergence at oobabooga#404.

@danielhanchen danielhanchen self-assigned this Oct 22, 2026
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. More of your lovely PRs please.

Reviewed commit: 4a08a12cd6

ℹ️ 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".

@danielhanchen

Copy link
Copy Markdown
Member

pre-commit.ci run

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

Reviewed commit: ae72d9a983

ℹ️ 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".

On an upgradable Desktop Chat only install, clicking Train now opens the
same Upgrade to the full install dialog as Settings > General instead of
doing nothing. The row stays greyed out and never navigates or preloads
Train until the backend reports training is available. The dialog states
the at least 5 GB of disk space the full install needs.

[skip ci]
danielhanchen pushed a commit to danielhanchen/unsloth-staging-2 that referenced this pull request Oct 22, 2026
danielhanchen pushed a commit to danielhanchen/unsloth-staging-2 that referenced this pull request Oct 22, 2026
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🎉

Reviewed commit: 7ef55a92c0

ℹ️ 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".

chatgpt-codex-connector[bot]

This comment was marked as resolved.

@danielhanchen

Copy link
Copy Markdown
Member

@codex review

@danielhanchen

Copy link
Copy Markdown
Member

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4ba2bcf350

ℹ️ 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".

Comment on lines +1730 to 1733
elif _installed_without_torch() and _a_gpu_build_would_train_here():
# GGUF-only by request: "needs a GPU" is wrong on a GPU host and nothing is broken.
# Without such a GPU it stays no_gpu: the Desktop offers the full install on no_torch.
CHAT_ONLY_REASON = "no_torch"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Reclassify no-torch hosts after inventory changes

When a Desktop --no-torch process starts without an eligible GPU and later gets a supported eGPU, this one-time branch leaves the reason as no_gpu. Although current_chat_only_verdict() refreshes no_gpu, absent torch yields build_reason = None, so it never promotes the host to no_torch; the reverse transition is also frozen because no_torch returns before consulting inventory and the sidebar does not poll that reason. Consequently Upgrade to full install stays hidden after attachment (or remains offered after detachment) until the backend restarts, so this classification needs to be reapplied by the inventory refresh path.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not changing this: GPU changes while the app runs are a documented known limit of this PR (picked up on the next start), and hot-plugging an eGPU into a running Desktop Chat only install is outside what this targets.

@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Oct 22, 2026
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. What shall we delve into next?

Reviewed commit: e7a644812c

ℹ️ 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".

chatgpt-codex-connector[bot]

This comment was marked as resolved.

@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Oct 22, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Oct 22, 2026
@danielhanchen

Copy link
Copy Markdown
Member

@codex review

1 similar comment
@danielhanchen

Copy link
Copy Markdown
Member

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

Reviewed commit: 853a53a083

ℹ️ 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".

@danielhanchen
danielhanchen merged commit 625cced into unslothai:main Oct 22, 2026
shimmyshimmer pushed a commit to shimmyshimmer/unsloth-staging-4 that referenced this pull request Oct 23, 2026
…er (unslothai#14861)

On a Desktop Chat only install whose hardware can train, the greyed
Train row's hover hint and the Export unavailable banner only described
the problem. The way to fix it was a click on the row itself (unslothai#14593) or
a trip to Settings. This PR puts a small **Install Training** button in
both places, opening the same Upgrade to the full install dialog.

## What changes

- **Train row hint:** on an upgradable install it now reads "Training is
not installed. It needs at least 5 GB of disk space." with an Install
Training button under it. The row itself still opens the dialog on
click, as before.
- **Export page:** the red Export unavailable banner gets the same
button under its message.
- Both buttons open the existing confirm dialog; nothing installs until
Upgrade is pressed there.
- Shown only where unslothai#14593 already offers the upgrade: a measured
`no_torch` verdict, no blocking hint, and a Desktop that manages its
backend. Web and CLI installs, hosts without a trainable GPU, Macs the
MLX wheels skip and AMD hosts behind closed device nodes see exactly
what they see today.

## Implementation

- `NavRowDef` gains an optional `tooltipAction`, which `NavItem` renders
as a button under the tooltip text. A row still checking its capability
(spinner) never shows it.
- The sidebar's `TooltipProvider` sets `disableHoverableContent`, so the
pointer could never reach a button inside a nav tooltip: it closed as
soon as the pointer left the row. `SidebarMenuButton` gets an
`interactiveTooltip` prop that opts that one tooltip back into hoverable
content; every other sidebar tooltip is unchanged.
- The startup bundle budget rises by the measured growth: +424 B raw /
+141 B transfer.

## Verification

Both frontend builds were loaded in Chromium against the same real
backend: a `--no-torch` install of this branch on a Linux host with
NVIDIA GPUs, which reports `chat_only: true`, `no_torch`, no hint. A
minimal stand-in for the Desktop shell's native commands was used, since
the effect only exists inside Desktop and this host has no WebKit
driver.

| | main (`ee55c3c9a`) | this PR |
|---|---|---|
| Train row hint | text only | text plus Install Training button |
| Pointer moved from the row onto the button | n/a | tooltip stays open,
button clickable |
| Button click | n/a | opens Upgrade to the full install |
| Export unavailable banner | text only | text plus Install Training
button |
| Banner button, then Upgrade | n/a | dialog opens, managed repair
starts |

Same result on 3 of 3 runs.

- Frontend: 13,688 tests, 0 failures. Typecheck, `i18n:check:strict`,
build and `bundle:check` pass.
- A new test pins both buttons and the hoverable opt-in; it fails on
main.

Not tested: a real macOS or Windows Desktop window, and keyboard-only
access to the tooltip button (the row itself stays keyboard reachable
and opens the same dialog).

## Screenshots

BEFORE is main at `ee55c3c9a`, AFTER is this PR, both against the same
Chat only backend.

**Train row hint**

![Train row hint before and
after](https://raw.githubusercontent.com/danielhanchen/unsloth-staging-2/pr-media/pr/14861/pair_train_hint-eaff98b844bb.png)

**Export unavailable banner**

![Export banner before and
after](https://raw.githubusercontent.com/danielhanchen/unsloth-staging-2/pr-media/pr/14861/pair_export_banner-4d5e87063f00.png)
danielhanchen added a commit to Etherll/unsloth that referenced this pull request Nov 1, 2026
… on GPU-less Chat only installs (unslothai#16175)

## Problem

On a host without a GPU, Studio greys out Train with "Training needs an
NVIDIA or AMD GPU.", although unslothai#14717 added CPU training.

- **Full install** (the default; the installers put CPU PyTorch on such
a host): the verdict is `no_gpu`. Even past the gate, the training
worker's `import unsloth` refuses with "Unsloth cannot find any torch
accelerator? You need a GPU."
- **Desktop Chat only install:** the verdict is also `no_gpu`, not
`no_torch`, so Install Training (unslothai#14861) and the Settings upgrade row
(unslothai#14593) are not offered.

## Cause

Both gates predate CPU training. unslothai#14593 reports `no_torch` off Mac only
when `_a_gpu_build_would_train_here()` finds a card, since a full
install on a GPU-less host could not train then. unslothai#14717 kept Studio out
of CPU training by setting `UNSLOTH_DISABLE_CPU_FALLBACK=1` in `main.py`
and `run.py`, which the training worker inherits. unsloth-zoo#2162 has
since made Studio's training worker run on the CPU backend, and
2026.10.11 ships both.

## Fix

- `hardware.py`: `trains_on_cpu(reason)` is true for `no_gpu` with
PyTorch installed and for `no_torch` without a usable GPU. `/api/health`
reports it as `cpu_training`. `chat_only` stays true, so Chat, Export
and Video are unchanged.
- Every off-Mac `--no-torch` install reports `no_torch`, so Install
Training is offered there too.
- The training worker sets `UNSLOTH_FORCE_CPU=1` when `trains_on_cpu()`
holds, before importing unsloth. Every other Studio process keeps the
opt-out.
- `/api/train/start` refuses vision and audio datasets, embedding,
decision and drafter training on CPU with a 400, since the CPU backend
trains text models with SFTTrainer only.
- Frontend: Train, `/studio` and its shortcuts follow a new
`isTrainUnavailable()` instead of `isChatOnly()`. The Train page notes
that training runs on the CPU and, as on MLX, hides the drafter section
and leaves a saved or imported drafter out of the request. On a GPU-less
Chat only install the upgrade dialog and Settings row promise CPU
training only, not export or video.

## Behavior boundaries

- A host whose GPU this PyTorch cannot use keeps its repair message
instead of falling back to CPU.
- CPU training is on by default, as `import unsloth` has been since
unslothai#14717.
- A vision model with a text dataset is not refused up front; the CPU
backend's own error surfaces at model load.

## Verification

Live A/B on Linux with `CUDA_VISIBLE_DEVICES=""`,
`trl-internal-testing/tiny-Qwen3ForCausalLM` and a 64-row JSONL, through
`/api/train/start` with Studio defaults:

| | main | this PR |
|---|---|---|
| `/api/health` | `chat_only`, `no_gpu` | `chat_only`, `no_gpu`,
`cpu_training: true` |
| LoRA, 6 steps | "Unsloth cannot find any torch accelerator? You need a
GPU." | completes, adapter saved |
| Full finetuning, 4 steps | not run | completes |
| Image dataset | not run | 400 |

New backend tests cover the verdicts, the health field, the start route
refusals and the worker environment; they fail on main. Backend files
touching these paths: 8,726 passed, with one failure that also fails on
main. The full frontend suite has no failures beyond main's. Typecheck,
i18n parity and the bundle budget pass, and lint has no new findings.

Not tested: the Desktop Install Training flow end to end on a GPU-less
host, Windows or macOS, and models larger than the tiny test model.

## Screenshots

`main` (`4d28d72802`) and this PR, two isolated installs with every GPU
hidden, fresh en-US browser profile.

Sidebar with the Train row hovered:

<img width="2424" height="846" alt="cpu_training_train_row"
src="https://github.com/user-attachments/assets/5a954770-3bc7-4c83-ba28-fe0d1df87509"
/>


`/studio` opened directly. On `main` it redirects to Chat:

<img width="4424" height="936" alt="cpu_training_train_page"
src="https://github.com/user-attachments/assets/9bf247f3-76b5-4e8c-bcb7-a877086ae330"
/>



### Before / after on a GPU-less host

Two isolated installs (merge base `c510fc1ca` vs this PR), both launched
with `CUDA_VISIBLE_DEVICES=""`, `/studio` opened directly. Before: the
route redirects to Chat and Train is greyed out. After: the Train page
stays open with the CPU training notice.

![Train page before and after on a GPU-less
host](https://raw.githubusercontent.com/danielhanchen/unsloth-staging-2/pr-media/pr/16175/pr16175_before_after-8bc8ca2591ef.png)

---------

Co-authored-by: Daniel Han <[email protected]>
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.

2 participants