Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 15 additions & 17 deletions install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ function Install-UnslothStudio {
$ErrorActionPreference = "Stop"
$script:UnslothVerbose = ($env:UNSLOTH_VERBOSE -eq "1")

# ── Maintainer-editable defaults ──
# Temporarily install from git main instead of PyPI.
# Revert to "unsloth>=2026.3.18" / "unsloth-zoo" once a new release is cut.
$DefaultUnslothPkg = "git+https://github.com/unslothai/unsloth.git"
$DefaultZooPkg = "git+https://github.com/unslothai/unsloth_zoo.git"

# ── Parse flags ──
$StudioLocalInstall = $false
$PackageName = "unsloth"
Expand Down Expand Up @@ -819,15 +825,15 @@ shell.Run cmd, 0, False
if ($SkipTorch) {
# No-torch: install unsloth + unsloth-zoo with --no-deps, then
# runtime deps (typer, safetensors, transformers, etc.) with --no-deps.
$baseInstallExit = Invoke-InstallCommand { uv pip install --python $VenvPython --no-deps --reinstall-package unsloth --reinstall-package unsloth-zoo "unsloth>=2026.3.18" unsloth-zoo }
$baseInstallExit = Invoke-InstallCommand { uv pip install --python $VenvPython --no-deps --reinstall-package unsloth --reinstall-package unsloth-zoo $DefaultUnslothPkg $DefaultZooPkg }
if ($baseInstallExit -eq 0) {
$NoTorchReq = Find-NoTorchRuntimeFile
if ($NoTorchReq) {
$baseInstallExit = Invoke-InstallCommand { uv pip install --python $VenvPython --no-deps -r $NoTorchReq }
}
}
} else {
$baseInstallExit = Invoke-InstallCommand { uv pip install --python $VenvPython --reinstall-package unsloth --reinstall-package unsloth-zoo "unsloth>=2026.3.18" unsloth-zoo }
$baseInstallExit = Invoke-InstallCommand { uv pip install --python $VenvPython --reinstall-package unsloth --reinstall-package unsloth-zoo $DefaultUnslothPkg $DefaultZooPkg }
}
if ($baseInstallExit -ne 0) {
Write-Host "[ERROR] Failed to install unsloth (exit code $baseInstallExit)" -ForegroundColor Red
Expand Down Expand Up @@ -857,17 +863,15 @@ shell.Run cmd, 0, False
if ($SkipTorch) {
# No-torch: install unsloth + unsloth-zoo with --no-deps, then
# runtime deps (typer, safetensors, transformers, etc.) with --no-deps.
$baseInstallExit = Invoke-InstallCommand { uv pip install --python $VenvPython --no-deps --upgrade-package unsloth --upgrade-package unsloth-zoo "unsloth>=2026.3.18" unsloth-zoo }
$baseInstallExit = Invoke-InstallCommand { uv pip install --python $VenvPython --no-deps --upgrade-package unsloth --upgrade-package unsloth-zoo $DefaultUnslothPkg $DefaultZooPkg }
if ($baseInstallExit -eq 0) {
$NoTorchReq = Find-NoTorchRuntimeFile
if ($NoTorchReq) {
$baseInstallExit = Invoke-InstallCommand { uv pip install --python $VenvPython --no-deps -r $NoTorchReq }
}
}
} elseif ($StudioLocalInstall) {
$baseInstallExit = Invoke-InstallCommand { uv pip install --python $VenvPython --upgrade-package unsloth "unsloth>=2026.3.18" unsloth-zoo }
} else {
$baseInstallExit = Invoke-InstallCommand { uv pip install --python $VenvPython --upgrade-package unsloth "$PackageName" }
$baseInstallExit = Invoke-InstallCommand { uv pip install --python $VenvPython --upgrade-package unsloth --upgrade-package unsloth-zoo $DefaultUnslothPkg $DefaultZooPkg }
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 Honor --package override in Windows installer

install.ps1 still parses --package, but the base install now always uses $DefaultUnslothPkg/$DefaultZooPkg, so users testing a fork (for example --package roland-sloth) will silently install the default git unsloth instead. This is a regression from the previous behavior where the non-local install path used $PackageName, and it matters because SKIP_STUDIO_BASE=1 means the later setup step does not reinstall base packages.

Useful? React with 👍 / 👎.

}
if ($baseInstallExit -ne 0) {
Write-Host "[ERROR] Failed to install unsloth (exit code $baseInstallExit)" -ForegroundColor Red
Expand All @@ -885,24 +889,18 @@ shell.Run cmd, 0, False
} else {
# Fallback: GPU detection failed to produce a URL -- let uv resolve torch
substep "installing unsloth (this may take a few minutes)..."
$baseInstallExit = Invoke-InstallCommand { uv pip install --python $VenvPython --upgrade-package unsloth --upgrade-package unsloth-zoo $DefaultUnslothPkg $DefaultZooPkg --torch-backend=auto }
if ($baseInstallExit -ne 0) {
Write-Host "[ERROR] Failed to install unsloth (exit code $baseInstallExit)" -ForegroundColor Red
return
}
if ($StudioLocalInstall) {
$baseInstallExit = Invoke-InstallCommand { uv pip install --python $VenvPython unsloth-zoo "unsloth>=2026.3.18" --torch-backend=auto }
if ($baseInstallExit -ne 0) {
Write-Host "[ERROR] Failed to install unsloth (exit code $baseInstallExit)" -ForegroundColor Red
return
}
substep "overlaying local repo (editable)..."
$overlayExit = Invoke-InstallCommand { uv pip install --python $VenvPython -e $RepoRoot --no-deps }
if ($overlayExit -ne 0) {
Write-Host "[ERROR] Failed to overlay local repo (exit code $overlayExit)" -ForegroundColor Red
return
}
} else {
$baseInstallExit = Invoke-InstallCommand { uv pip install --python $VenvPython "$PackageName" --torch-backend=auto }
if ($baseInstallExit -ne 0) {
Write-Host "[ERROR] Failed to install unsloth (exit code $baseInstallExit)" -ForegroundColor Red
return
}
}
}

Expand Down
30 changes: 23 additions & 7 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,14 @@ fi
step() { printf " ${C_DIM}%-15.15s${C_RST}${3:-$C_OK}%s${C_RST}\n" "$1" "$2"; }
substep() { printf " ${C_DIM}%-15s${2:-$C_DIM}%s${C_RST}\n" "" "$1"; }

# ── Maintainer-editable defaults ──
# Temporarily install from git main instead of PyPI.
# Revert to "unsloth>=2026.3.18" / "unsloth-zoo" once a new release is cut.
# _DEFAULT_UNSLOTH_PKG="unsloth>=2026.3.18"
# _DEFAULT_ZOO_PKG="unsloth-zoo"
_DEFAULT_UNSLOTH_PKG="git+https://github.com/unslothai/unsloth.git"
_DEFAULT_ZOO_PKG="git+https://github.com/unslothai/unsloth_zoo.git"

# ── Parse flags ──
STUDIO_LOCAL_INSTALL=false
PACKAGE_NAME="unsloth"
Expand Down Expand Up @@ -60,6 +68,12 @@ for arg in "$@"; do
esac
done

# Honor --package override: if the user passed a custom package name,
# use it instead of the maintainer default for the unsloth install target.
if [ "$PACKAGE_NAME" != "unsloth" ]; then
_DEFAULT_UNSLOTH_PKG="$PACKAGE_NAME"
fi

if [ "$_VERBOSE" = true ]; then
export UNSLOTH_VERBOSE=1
fi
Expand Down Expand Up @@ -1040,15 +1054,15 @@ if [ "$_MIGRATED" = true ]; then
# to prevent transitive torch resolution.
run_install_cmd "install unsloth (migrated no-torch)" uv pip install --python "$_VENV_PY" --no-deps \
--reinstall-package unsloth --reinstall-package unsloth-zoo \
"unsloth>=2026.3.18" unsloth-zoo
"$_DEFAULT_UNSLOTH_PKG" "$_DEFAULT_ZOO_PKG"
_NO_TORCH_RT="$(_find_no_torch_runtime)"
if [ -n "$_NO_TORCH_RT" ]; then
run_install_cmd "install no-torch runtime deps" uv pip install --python "$_VENV_PY" --no-deps -r "$_NO_TORCH_RT"
fi
else
run_install_cmd "install unsloth (migrated)" uv pip install --python "$_VENV_PY" \
--reinstall-package unsloth --reinstall-package unsloth-zoo \
"unsloth>=2026.3.18" unsloth-zoo
"$_DEFAULT_UNSLOTH_PKG" "$_DEFAULT_ZOO_PKG"
fi
if [ "$STUDIO_LOCAL_INSTALL" = true ]; then
substep "overlaying local repo (editable)..."
Expand All @@ -1070,7 +1084,7 @@ elif [ -n "$TORCH_INDEX_URL" ]; then
# runtime deps (typer, safetensors, transformers, etc.) with --no-deps.
run_install_cmd "install unsloth (no-torch)" uv pip install --python "$_VENV_PY" --no-deps \
--upgrade-package unsloth --upgrade-package unsloth-zoo \
"unsloth>=2026.3.18" unsloth-zoo
"$_DEFAULT_UNSLOTH_PKG" "$_DEFAULT_ZOO_PKG"
_NO_TORCH_RT="$(_find_no_torch_runtime)"
if [ -n "$_NO_TORCH_RT" ]; then
run_install_cmd "install no-torch runtime deps" uv pip install --python "$_VENV_PY" --no-deps -r "$_NO_TORCH_RT"
Expand All @@ -1081,22 +1095,24 @@ elif [ -n "$TORCH_INDEX_URL" ]; then
fi
elif [ "$STUDIO_LOCAL_INSTALL" = true ]; then
run_install_cmd "install unsloth (local)" uv pip install --python "$_VENV_PY" \
--upgrade-package unsloth "unsloth>=2026.3.18" unsloth-zoo
--upgrade-package unsloth --upgrade-package unsloth-zoo "$_DEFAULT_UNSLOTH_PKG" "$_DEFAULT_ZOO_PKG"
substep "overlaying local repo (editable)..."
run_install_cmd "overlay local repo" uv pip install --python "$_VENV_PY" -e "$_REPO_ROOT" --no-deps
else
run_install_cmd "install unsloth" uv pip install --python "$_VENV_PY" \
--upgrade-package unsloth "$PACKAGE_NAME"
--upgrade-package unsloth --upgrade-package unsloth-zoo "$_DEFAULT_UNSLOTH_PKG" "$_DEFAULT_ZOO_PKG"
fi
else
# Fallback: GPU detection failed to produce a URL -- let uv resolve torch
substep "installing unsloth (this may take a few minutes)..."
if [ "$STUDIO_LOCAL_INSTALL" = true ]; then
run_install_cmd "install unsloth (auto torch backend)" uv pip install --python "$_VENV_PY" unsloth-zoo "unsloth>=2026.3.18" --torch-backend=auto
run_install_cmd "install unsloth (auto torch backend)" uv pip install --python "$_VENV_PY" \
--upgrade-package unsloth --upgrade-package unsloth-zoo "$_DEFAULT_UNSLOTH_PKG" "$_DEFAULT_ZOO_PKG" --torch-backend=auto
substep "overlaying local repo (editable)..."
run_install_cmd "overlay local repo" uv pip install --python "$_VENV_PY" -e "$_REPO_ROOT" --no-deps
else
run_install_cmd "install unsloth (auto torch backend)" uv pip install --python "$_VENV_PY" "$PACKAGE_NAME" --torch-backend=auto
run_install_cmd "install unsloth (auto torch backend)" uv pip install --python "$_VENV_PY" \
--upgrade-package unsloth --upgrade-package unsloth-zoo "$_DEFAULT_UNSLOTH_PKG" "$_DEFAULT_ZOO_PKG" --torch-backend=auto
fi
fi

Expand Down
7 changes: 5 additions & 2 deletions studio/backend/requirements/base.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Core unsloth packages
unsloth-zoo
unsloth
# Temporarily install from git main instead of PyPI to pick up latest
# fixes (Gemma 4 support, Studio patches). Revert to package names
# once the next PyPI release is cut.
git+https://github.com/unslothai/unsloth_zoo.git
git+https://github.com/unslothai/unsloth.git
15 changes: 12 additions & 3 deletions studio/install_python_stack.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,15 @@ def _infer_no_torch() -> bool:

NO_TORCH = _infer_no_torch()

# -- Maintainer-editable package defaults --------------------------------------
# Temporarily install from git main instead of PyPI to pick up latest fixes
# (Gemma 4 support, Studio patches). Revert to PyPI package names once the
# next release is cut.
# PyPI: _DEFAULT_UNSLOTH_PKG = "unsloth"
# _DEFAULT_ZOO_PKG = "unsloth-zoo"
_DEFAULT_UNSLOTH_PKG = "git+https://github.com/unslothai/unsloth.git"
_DEFAULT_ZOO_PKG = "git+https://github.com/unslothai/unsloth_zoo.git"

# -- Verbosity control ----------------------------------------------------------
# By default the installer shows a minimal progress bar (one line, in-place).
# Set UNSLOTH_VERBOSE=1 in the environment to restore full per-step output:
Expand Down Expand Up @@ -471,11 +480,11 @@ def install_python_stack() -> int:
"--no-cache-dir",
"--no-deps",
"--upgrade-package",
package_name,
"unsloth",
"--upgrade-package",
"unsloth-zoo",
package_name,
"unsloth-zoo",
_DEFAULT_UNSLOTH_PKG,
_DEFAULT_ZOO_PKG,
Comment on lines +483 to +487
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 Preserve custom package name in no-torch update path

In install_python_stack.py, the no-torch branch now hardcodes unsloth plus _DEFAULT_UNSLOTH_PKG, so STUDIO_PACKAGE_NAME is ignored whenever NO_TORCH is true (for example Intel macOS updates or UNSLOTH_NO_TORCH=true). Previously this branch used package_name, so custom package testing via unsloth studio update --package <name> regresses specifically in no-torch environments.

Useful? React with 👍 / 👎.

)
pip_install(
"Installing no-torch runtime deps",
Expand Down
Loading