Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
110 commits
Select commit Hold shift + click to select a range
c6d9216
Add Docker build for Blackwell that runs on any NVIDIA GPU host
danielhanchen May 24, 2026
a75aef0
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 24, 2026
58693c4
Add entrypoint with GPU pre-flight checks + opinionated run.sh wrapper
danielhanchen May 24, 2026
acbb16c
Add docker/test_locally.sh: one-shot end-to-end Docker validation
danielhanchen May 24, 2026
f7b3479
test_locally.sh: use docker buildx (or DOCKER_BUILDKIT=1) for the build
danielhanchen May 24, 2026
56d2701
test_locally.sh: require docker buildx, no legacy fallback
danielhanchen May 24, 2026
23a5b43
test_locally.sh: pre-flight check for docker daemon connectivity
danielhanchen May 24, 2026
fd55ed0
Dockerfile: drop system-python pip/uv bootstrap (PEP 668)
danielhanchen May 24, 2026
00cbc82
smoke_test.py: import unsloth before unsloth_zoo / transformers / trl…
danielhanchen May 24, 2026
1cdc5f1
Dockerfile: install gcc + g++ + python3-dev in runtime stage
danielhanchen May 24, 2026
dde5170
Expand arch list to every current x86_64 NVIDIA CC per developer.nvid…
danielhanchen May 24, 2026
4bfb4b8
Add docker/hf_{push,pull}.sh: simulate docker push/pull against HF Hub
danielhanchen May 24, 2026
7354642
hf_{push,pull}.sh: use new `hf` CLI, fall back to deprecated `hugging…
danielhanchen May 24, 2026
8344fa0
test_locally.sh: use nbformat directly, drop fragile jupyter nbconver…
danielhanchen May 24, 2026
391532c
test_locally.sh: skip notebook install cells, strip stray jupyter magic
danielhanchen May 24, 2026
e7cfcea
Add linux/arm64 (DGX Spark / Grace) support via QEMU at build time
danielhanchen May 24, 2026
131f1d3
docker-publish.yml: native arm64 runner + per-arch digest merge
danielhanchen May 24, 2026
897e5e7
Dockerfile: tighten arch-flag assertion + correct fat-binary claims
danielhanchen May 24, 2026
1769204
Dockerfile: arm64 DGX Spark NVRTC + ptxas fix (cu13 alongside cu128)
danielhanchen May 24, 2026
e728eed
Dockerfile: switch runtime base cudnn-runtime -> base (~2.7 GB lighter)
danielhanchen May 24, 2026
c463d58
entrypoint.sh: correct driver-floor message (570+ unconditionally on …
danielhanchen May 24, 2026
fa9609d
Dockerfile: arm64 install cu13 nvrtc/nvcc directly without cuda-keyri…
danielhanchen May 24, 2026
34fb65f
Dockerfile: install vLLM nightly on amd64 for GRPO fast_inference
danielhanchen May 24, 2026
215ed9b
Dockerfile: arm64 build aborted by set -e in vLLM auto-gate
danielhanchen May 24, 2026
6d536d8
Dockerfile: re-upgrade numpy after vLLM install (2.2.6 wheel is broken)
danielhanchen May 24, 2026
79e9363
Fix two upstream regressions surfaced by the Blackwell Docker validation
danielhanchen May 24, 2026
a01fa21
docker: add Dockerfile.studio extending the Blackwell image with Unsl…
danielhanchen May 24, 2026
29a6bde
Address reviewer findings on PR #5748: 4 release-path bugs
danielhanchen May 24, 2026
5cb5eb7
Remove async_task_outputs from repo (accidentally committed)
danielhanchen May 24, 2026
6e45c27
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 24, 2026
291e2cf
docker/Dockerfile.studio: keep source for the editable install
danielhanchen May 24, 2026
914f91c
docker: add timm + addict to the base image
danielhanchen May 24, 2026
0d574d8
Address reviewer-2 findings on PR #5748
danielhanchen May 24, 2026
a9b8d68
Remove individual_reviews from repo (accidentally committed)
danielhanchen May 24, 2026
f116f78
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 24, 2026
c91fa26
tests/studio: assert losses_per_step matches max_steps, not stale 7
danielhanchen May 24, 2026
cceeeb1
Address 3 MAJOR review findings on the docker PR
danielhanchen May 25, 2026
2faf827
docker: round-3 review fixes (concurrency, lockfile wording)
danielhanchen May 25, 2026
6b91708
Merge branch 'main' into docker-blackwell-build
danielhanchen May 27, 2026
9723d72
docker-publish: pin UNSLOTH_ZOO_REF on tag pushes
danielhanchen May 27, 2026
4d34845
docker/run.sh: translate UNSLOTH_GPUS index selectors to device= form
danielhanchen May 27, 2026
10f0a03
docker/test_locally.sh: fail fast + pin notebook fetch to immutable SHA
danielhanchen May 27, 2026
f34a4cd
Merge branch 'main' into docker-blackwell-build
danielhanchen Jun 12, 2026
6448587
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 12, 2026
f1a63db
docker: ship Jupyter, Studio and prebuilt llama.cpp out of the box
danielhanchen Jun 12, 2026
9e9877e
docker: pin the llama.cpp bake by target arch, add docker_confirm.sh
danielhanchen Jun 12, 2026
38d7b5e
docker: whitelist new build-context files, add docker_confirm.ps1
danielhanchen Jun 12, 2026
e8ac40f
docker/studio: deterministic Studio install inside the image build
danielhanchen Jun 12, 2026
d431f3c
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 12, 2026
6fd1220
docker: mirror the llama.cpp bake into build/bin so Studio setup reus…
danielhanchen Jun 12, 2026
c62bb19
docker_confirm.sh: rename unused poll counter for shellcheck SC2034
danielhanchen Jun 12, 2026
f4e378e
docker: review fixes from the 8-reviewer pass and staging CI
danielhanchen Jun 12, 2026
81b0d1e
docker: second review pass fixes
danielhanchen Jun 12, 2026
3d56379
docker ci: aggressive runner disk reclaim before image builds
danielhanchen Jun 12, 2026
96edc89
gpu_init: satisfy the import-hoist lint in the compile-thread patch
danielhanchen Jun 12, 2026
b2fe9f4
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 12, 2026
25d95c0
docker: zstd + matplotlib for out-of-the-box notebook coverage
danielhanchen Jun 12, 2026
c515aa0
docker: audio decode out of the box (ffmpeg + matched torchcodec bake)
danielhanchen Jun 12, 2026
e06b1fb
docker: split the torchcodec bake across build stages
danielhanchen Jun 12, 2026
3e6d37c
docker: install vLLM on the arm64 leg too and probe it in the confirm…
danielhanchen Jun 12, 2026
cfeb772
Merge remote-tracking branch 'origin/main' into pr-5748-head
danielhanchen Jun 12, 2026
9f9cd41
docker: add wget to the runtime image
danielhanchen Jun 12, 2026
09c9c95
ci: retrigger after bulk-cancelled runs
danielhanchen Jun 12, 2026
11430aa
docker: unbreak standalone vllm serve (ninja-build + flashinfer-jit-c…
danielhanchen Jun 12, 2026
487ea4f
dataprep: detect vllm 0.19 server readiness (renamed log line, stderr)
danielhanchen Jun 12, 2026
9987323
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 12, 2026
9d39aee
studio: honor UNSLOTH_TORCH_INDEX_FAMILY in CUDA repair path, assert …
danielhanchen Jun 12, 2026
6f6b638
Fix import on driverless hosts under UNSLOTH_ALLOW_CPU=1
danielhanchen Jun 12, 2026
8242b73
docker: mirror soname symlinks into llama.cpp build/bin, assert the r…
danielhanchen Jun 12, 2026
5b4eb34
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 12, 2026
eba071f
docker/studio: make the quantizer build assertion content based
danielhanchen Jun 12, 2026
5c5b534
Merge remote-tracking branch 'origin/main' into pr-5748-head
danielhanchen Jun 12, 2026
d01da4c
docker_confirm: accept locally built images when pull fails
danielhanchen Jun 12, 2026
2cd58d5
docker: ship cuda-nvcc and cudart-dev in the runtime image
danielhanchen Jun 12, 2026
5bb47cf
docker: bake soundfile, evaluate, tensorboard for notebook deps
danielhanchen Jun 13, 2026
ea91c7a
docker: add jiwer, langid, easydict, protobuf to baked notebook deps
danielhanchen Jun 13, 2026
dec240a
Merge remote-tracking branch 'origin/main' into pr-5748-head
Jun 14, 2026
aba16af
docker: notebook deps, image size cuts, per-notebook transformers
danielhanchen Jun 15, 2026
448e225
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 15, 2026
d0d5f3c
docker: pre-load unslothai/notebooks into JupyterLab, edit-safe refresh
danielhanchen Jun 15, 2026
338aff5
docker: notebook refresh ignores header/footer-only upstream changes
danielhanchen Jun 16, 2026
7e2e842
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 16, 2026
921ab18
docker: heal deleted notebooks on boot + fix notebooks helper dockeri…
danielhanchen Jun 16, 2026
d5df6c0
docker: track latest llama.cpp release + show its update banner in St…
danielhanchen Jun 24, 2026
b897cf8
docker: add unsloth-studio-update for in-place Studio updates
danielhanchen Jun 24, 2026
7606081
docker: add unsloth-llama-update for in-place llama.cpp prebuilt updates
danielhanchen Jun 24, 2026
08f9b67
docker: optional Cloudflare tunnel for JupyterLab (UNSLOTH_JUPYTER_CL…
danielhanchen Jun 24, 2026
c0abb0a
Merge remote-tracking branch 'origin/main' into dbb-merge-main
danielhanchen Jun 26, 2026
053a4f3
docker-publish: clean build-args + add least-privilege default permis…
danielhanchen Jun 26, 2026
52067fb
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 26, 2026
8f693c6
docker: fix notebook pip-shim drops, first-boot overwrite, base :late…
danielhanchen Jun 26, 2026
f45c455
Merge remote-tracking branch 'origin/main' into dbb-merge-main
danielhanchen Jun 26, 2026
8402dce
docker-publish: pin one llama.cpp prebuilt release across both arch legs
danielhanchen Jun 26, 2026
0ebbdbb
docker: address review follow-ups (pip-shim flags, sync ownership, ta…
danielhanchen Jun 26, 2026
d476c77
docker: address review round 3 (notebook -r filter, studio zoo ref, p…
danielhanchen Jun 26, 2026
7083a2d
docker: pip-shim catches direct-reference protected installs + --opt=…
danielhanchen Jun 26, 2026
2ee7f4b
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 26, 2026
2c31686
docker: address review round 4 (jupyter probe, CPU messaging, llama E…
danielhanchen Jun 27, 2026
f152569
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 27, 2026
68f5394
docker_confirm.ps1: probe JupyterLab /login, not /api
danielhanchen Jun 29, 2026
8fc483e
Merge remote-tracking branch 'origin/main' into docker-blackwell-build
danielhanchen Jul 1, 2026
08a1bf6
Merge remote-tracking branch 'origin/main' into docker-blackwell-build
danielhanchen Jul 5, 2026
034fbc9
Docker notebook safety hardening and vLLM startup timeout fix
danielhanchen Jul 5, 2026
6cb2201
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 5, 2026
326f57e
docker-publish: freeze the unsloth-zoo ref to a concrete sha before f…
danielhanchen Jul 6, 2026
d63b6c4
docker/run.sh: forward Studio service env to the container
danielhanchen Jul 6, 2026
19e3bc3
docker: move the image torch stack to 2.11.0 and document the amd64 s…
danielhanchen Jul 6, 2026
782a7d5
Merge remote-tracking branch 'origin/main' into docker-blackwell-build
danielhanchen Jul 6, 2026
0a41967
Normalize kwarg spacing in loader.py after the main merge
danielhanchen Jul 6, 2026
cba7223
docker: Colab-grade JupyterLab and Studio UX for the Unsloth image (#…
danielhanchen Jul 6, 2026
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
605 changes: 605 additions & 0 deletions .github/workflows/docker-publish.yml

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions .github/workflows/studio-backend-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ on:
- 'unsloth/**'
- 'unsloth_cli/**'
- 'tests/**'
# The "Docker JupyterLab/notebook feature validation" step below runs
# tests/validate_studio_features.py, which checks docker/jupyter (the
# labextension, overrides.json, login branding) and the docker notebook
# helpers. Without docker/** here a docker-only change skips that guard.
- 'docker/**'
- 'pyproject.toml'
- '.github/workflows/studio-backend-ci.yml'
push:
Expand Down Expand Up @@ -238,3 +243,9 @@ jobs:
echo "::endgroup::"
done

- name: Docker JupyterLab/notebook feature validation
# Named validate_studio_features.py (not test_*.py) so pytest's default
# discovery skips it; run it explicitly here so a regression in the
# notebook view, Colab compat, strip, JupyterLab defaults or login
# branding fails CI instead of only when someone runs it by hand.
run: python tests/validate_studio_features.py
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -235,5 +235,7 @@ package-lock.json
!studio/backend/core/data_recipe/oxc-validator/package-lock.json
!studio/package-lock.json
llama.cpp/
async_task_outputs/
individual_reviews/
# Stray "~" dir some tools create from a literal ~ TMPDIR; never part of the repo.
/~/
37 changes: 37 additions & 0 deletions docker/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
**
!Dockerfile
!entrypoint.sh
!smoke_test.py
!fetch_llama_prebuilt.py
!supervisord.conf
!studio_launch.sh
!unsloth_studio_update.sh
!unsloth_llama_update.sh
!unsloth_jupyter_tunnel.sh
!unsloth_nb_compat.py
!unsloth_pip_shim.py
!unsloth_nb_pip_magic.py
!unsloth_ipython_startup.py
!unsloth_run.py
!unsloth_sync_notebooks.sh
!unsloth_nb_content_sig.py
!unsloth_nb_view.py
!unsloth_nb_strip_colab.py
!unsloth_colab_compat.py
!jupyter
!jupyter/unsloth_branding.py
!jupyter/jupyter_server_config.d
!jupyter/jupyter_server_config.d/**
!jupyter/overrides.json
!jupyter/favicon.ico
!jupyter/logo.png
!jupyter/login.html
!jupyter/install_sloth_stickers.py
!jupyter/unsloth_labext
!jupyter/unsloth_labext/package.json
!jupyter/unsloth_labext/tsconfig.json
!jupyter/unsloth_labext/.yarnrc.yml
!jupyter/unsloth_labext/src
!jupyter/unsloth_labext/src/**
!jupyter/unsloth_labext/style
!jupyter/unsloth_labext/style/**
761 changes: 761 additions & 0 deletions docker/Dockerfile

Large diffs are not rendered by default.

274 changes: 274 additions & 0 deletions docker/Dockerfile.studio

Large diffs are not rendered by default.

41 changes: 41 additions & 0 deletions docker/NOTICE
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
Unsloth Docker Studio and JupyterLab image
==========================================

This directory builds the Unsloth Docker Studio and JupyterLab image. The image
bundles Unsloth Studio, which is licensed under the GNU Affero General Public
License v3.0 (see /studio/LICENSE.AGPL-3.0). Unsloth Core is licensed under the
Apache License 2.0 (see /LICENSE).


Additional terms under AGPLv3 Section 7
---------------------------------------

As permitted by Section 7(b) of the GNU Affero General Public License v3.0, and
in support of the "Appropriate Legal Notices" requirement for interactive user
interfaces, the following author attributions and legal notices are designated
as required Appropriate Legal Notices for this image. If you convey, modify, or
make the image (or any work based on it) available to users over a network, you
must keep these notices intact and displayed to those users:

* The attribution "Built by the Unsloth team".
* The copyright line "Copyright 2026-Present the Unsloth team".
* The license notice "Licensed under Apache 2.0 and the GNU AGPLv3".
* The Unsloth logo and the "Unsloth Dark" theme shown in the JupyterLab top
bar and on the loading splash.
* The Help > About dialog, including the following links:
- Source: https://github.com/unslothai/unsloth
- Website: https://unsloth.ai
- License: https://github.com/unslothai/unsloth#license
- AGPLv3: https://www.gnu.org/licenses/agpl-3.0.html
- Apache: https://www.apache.org/licenses/LICENSE-2.0

These notices are displayed on the JupyterLab login page, the Help > About
dialog, the loading splash and the top bar. They are enforced at build time and
at runtime by docker/jupyter/unsloth_branding.py (see docker/jupyter/BRANDING.md
for details). Removing or altering them, whether by editing the build workflow,
the branding sources or the integrity guard, does not remove this license
condition.

"Unsloth" and the Unsloth logo are trademarks of the Unsloth team. This NOTICE
governs copyright attribution under the AGPLv3 and does not grant any trademark
license.
67 changes: 67 additions & 0 deletions docker/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
#!/usr/bin/env bash
# Build the unsloth-blackwell image on this B200 host (or any Linux host with Docker).
# The build host's GPU is NOT used -- nvcc cross-compiles for sm_100 + sm_120.
#
# Usage:
# ./build.sh # builds unsloth-blackwell:latest pinned to unsloth main
# TAG=2026.05.1 ./build.sh # custom tag
# UNSLOTH_REF=v2026.5.6 UNSLOTH_ZOO_REF=v2026.5.4 ./build.sh # pin git refs
set -euo pipefail

cd "$(dirname "$0")"

IMAGE_NAME="${IMAGE_NAME:-unsloth-blackwell}"
TAG="${TAG:-latest}"
CUDA_VERSION="${CUDA_VERSION:-12.8.1}"
UBUNTU_VERSION="${UBUNTU_VERSION:-24.04}"
PYTHON_VERSION="${PYTHON_VERSION:-3.12}"
UNSLOTH_REF="${UNSLOTH_REF:-main}"
UNSLOTH_ZOO_REF="${UNSLOTH_ZOO_REF:-main}"

# llama.cpp prebuilt: default to the newest unslothai/llama.cpp release, resolved
# here to a concrete tag so the build-arg changes only when upstream publishes a
# new release (correct Docker layer caching) and the build stays reproducible.
# Pin it explicitly for a frozen build: LLAMA_PREBUILT_TAG=b9596-mix-e6f2453 ./build.sh
resolve_latest_llama_tag() {
curl -fsSL -o /dev/null -w '%{url_effective}' \
"https://github.com/unslothai/llama.cpp/releases/latest" 2>/dev/null \
| sed -n 's#.*/releases/tag/##p'
}
if [ -z "${LLAMA_PREBUILT_TAG:-}" ]; then
LLAMA_PREBUILT_TAG="$(resolve_latest_llama_tag || true)"
if [ -n "$LLAMA_PREBUILT_TAG" ]; then
echo "Resolved latest llama.cpp release: ${LLAMA_PREBUILT_TAG}"
else
LLAMA_PREBUILT_TAG="latest"
echo "Could not resolve latest llama.cpp tag here; passing 'latest' (resolved inside the build)"
fi
fi

echo "Building ${IMAGE_NAME}:${TAG}"
echo " CUDA ${CUDA_VERSION} Ubuntu ${UBUNTU_VERSION} Python ${PYTHON_VERSION}"
echo " unsloth @${UNSLOTH_REF}"
echo " unsloth-zoo @${UNSLOTH_ZOO_REF}"
echo " llama.cpp ${LLAMA_PREBUILT_TAG}"
echo " arch list 8.0;8.6;8.9;9.0;10.0;12.0+PTX"
echo

DOCKER_BUILDKIT=1 docker build \
--progress=plain \
--build-arg CUDA_VERSION="${CUDA_VERSION}" \
--build-arg UBUNTU_VERSION="${UBUNTU_VERSION}" \
--build-arg PYTHON_VERSION="${PYTHON_VERSION}" \
--build-arg UNSLOTH_REF="${UNSLOTH_REF}" \
--build-arg UNSLOTH_ZOO_REF="${UNSLOTH_ZOO_REF}" \
--build-arg LLAMA_PREBUILT_TAG="${LLAMA_PREBUILT_TAG}" \
-t "${IMAGE_NAME}:${TAG}" \
.

echo
echo "Built ${IMAGE_NAME}:${TAG}"
echo
echo "Smoke test on this host (B200, sm_100):"
echo " docker run --rm --gpus all ${IMAGE_NAME}:${TAG} python /workspace/smoke_test.py"
echo
echo "Smoke test on an RTX 5090 host (sm_120):"
echo " docker pull ${IMAGE_NAME}:${TAG} # or load .tar"
echo " docker run --rm --gpus all ${IMAGE_NAME}:${TAG} python /workspace/smoke_test.py"
Loading
Loading