Local UI to run and train LLMs and diffusion models. Supports GGUF, MLX, Qwen3.8, DeepSeek-V4.1, MiniMax-H3, Gemma 4, FLUX and more.
Python agentaichatgptdeepseekfine-tuninggemmaimage-generationllamallmllmsopenaipythonqwenreinforcement-learningself-hostedstable-diffusiontext-to-speechttsuiunsloth
Studio: keep project folders on the Docker volume (#12792)
Nilayab5c189432a2
diff --git a/docker/DOCKERHUB-ROCM.md b/docker/DOCKERHUB-ROCM.mdindex fff7289cf55..c7ecf96c919 100644--- a/docker/DOCKERHUB-ROCM.md+++ b/docker/DOCKERHUB-ROCM.md@@ -111,7 +111,7 @@ Included: PyTorch with ROCm, Unsloth, unsloth-zoo, transformers, TRL, PEFT, acceNot included in `latest`, unlike `unsloth/unsloth`: Unsloth Studio and its web UI, JupyterLab, prebuilt llama.cpp and whisper.cpp, vLLM and xformers. `latest` is a training image.-The `studio` tag adds Unsloth Studio, JupyterLab with the Unsloth notebooks (the `AMD-*` set first) and a CPU llama.cpp for GGUF chat, still without whisper.cpp, vLLM or xformers. Training, the notebooks and the UI use the GPU; GGUF chat runs on the CPU, since a ROCm llama.cpp bundle is per-architecture and would pin the image to one card. Studio's data (accounts, chats, outputs) lives at `/opt/unsloth-studio`, so mount a volume there to keep it, with `GPU_FLAGS` set as in the quick start:+The `studio` tag adds Unsloth Studio, JupyterLab with the Unsloth notebooks (the `AMD-*` set first) and a CPU llama.cpp for GGUF chat, still without whisper.cpp, vLLM or xformers. Training, the notebooks and the UI use the GPU; GGUF chat runs on the CPU, since a ROCm llama.cpp bundle is per-architecture and would pin the image to one card. Studio's data (accounts, chats, project folders, outputs) lives at `/opt/unsloth-studio`, so mount a volume there to keep it (projects created by an image from before project folders moved to the volume keep their folder under `/root/Documents` inside the container, so copy their files out before `docker rm`), with `GPU_FLAGS` set as in the quick start:```bashdocker run --rm $GPU_FLAGS --ipc=host -p 127.0.0.1:8000:8000 -p 127.0.0.1:8888:8888 \diff --git a/docker/DOCKERHUB.md b/docker/DOCKERHUB.mdindex 4ecb9e23c6c..56ba7ccbd7d 100644--- a/docker/DOCKERHUB.md+++ b/docker/DOCKERHUB.md@@ -62,7 +62,7 @@ docker rm -f unsloth # stop and delete the containerdocker ps -a # find it again, running or not```-`docker rm -f` deletes the container, not your work: models stay in the Hugging Face cache, your files in the directory you mounted, and Unsloth Studio's accounts and chats on the `unsloth-studio` volume, so the next container with the same `-v unsloth-studio:/opt/unsloth-studio` resumes where this one left off, password included. Only what was written inside the container is lost. `docker volume rm unsloth-studio` discards the Unsloth Studio data too, and cannot be undone.+`docker rm -f` deletes the container, not your work: models stay in the Hugging Face cache, your files in the directory you mounted, and Unsloth Studio's accounts, chats and project folders on the `unsloth-studio` volume, so the next container with the same `-v unsloth-studio:/opt/unsloth-studio` resumes where this one left off, password included. Only what was written inside the container is lost, which includes the folders of projects created by an image from before project folders moved to the volume: those keep their old place under `/root/Documents`, so copy their files out before removing the container. `docker volume rm unsloth-studio` discards the Unsloth Studio data too, and cannot be undone.These take a container, not an image, so `docker stop unsloth/unsloth` fails with "No such container". Use the `NAMES` or `CONTAINER ID` column of `docker ps -a`; without `--name`, Docker assigns a random one.@@ -149,7 +149,7 @@ The working directory is `/workspace`. Mount what you want to keep:|---|---|| `/workspace/host` | Your files. Mount your project directory here. || `/workspace/.cache/huggingface` | Model downloads. Mount your host HF cache to reuse it. |-| `/opt/unsloth-studio` | Unsloth Studio's accounts, chats, outputs, exports and runs (`latest`). Use a named volume: without one, `docker rm` loses them. |+| `/opt/unsloth-studio` | Unsloth Studio's accounts, chats, project folders, outputs, exports and runs (`latest`). Use a named volume: without one, `docker rm` loses them. || `/workspace/.cache/triton` | Compiled kernels. Optional, speeds up restarts. || `/workspace/unsloth-notebooks` | The synced notebooks. Your edits are kept across refreshes. || `/workspace/Unsloth Notebooks` | The same notebooks grouped by topic, rebuilt on each start. |diff --git a/docker/Dockerfile.studio b/docker/Dockerfile.studioindex 3cba015b1bb..cd53b84b356 100644--- a/docker/Dockerfile.studio+++ b/docker/Dockerfile.studio@@ -63,6 +63,7 @@ USER root# which would fill a volume on the home with wheels; cache/ there stays runtime data.ENV UNSLOTH_STUDIO_HOME=/opt/unsloth-studio \UNSLOTH_STUDIO_APP=/opt/unsloth-studio-app \+ UNSLOTH_STUDIO_DOCUMENTS_HOME=/opt/unsloth-studio/documents \UV_CACHE_DIR=/opt/unsloth-studio-app/uv-cache \UNSLOTH_IMAGE_ALLOW_CPU=1 \JUPYTER_PORT=8888 \diff --git a/docker/Dockerfile.studio-rocm b/docker/Dockerfile.studio-rocmindex 62f2941caf0..841ed041d06 100644--- a/docker/Dockerfile.studio-rocm+++ b/docker/Dockerfile.studio-rocm@@ -85,6 +85,7 @@ ARG UNSLOTH_NOTEBOOKS_REF=main# $UNSLOTH_STUDIO_HOME/cache/uv, which would fill a volume on the home with wheels.ENV UNSLOTH_STUDIO_HOME=/opt/unsloth-studio \UNSLOTH_STUDIO_APP=/opt/unsloth-studio-app \+ UNSLOTH_STUDIO_DOCUMENTS_HOME=/opt/unsloth-studio/documents \UV_CACHE_DIR=/opt/unsloth-studio-app/uv-cache \JUPYTER_PORT=8888 \UNSLOTH_STUDIO_PORT=8000 \diff --git a/studio/backend/tests/test_project_workspace_location.py b/studio/backend/tests/test_project_workspace_location.pyindex 0833a3fc404..3a2da92b7a1 100644--- a/studio/backend/tests/test_project_workspace_location.py+++ b/studio/backend/tests/test_project_workspace_location.py@@ -10,6 +10,7 @@ Known Folder Move has repointed Documents at the synced copy."""import os+import refrom pathlib import Pathimport pytest@@ -19,6 +20,7 @@ from utils.paths.storage_roots import (_windows_documents_dir,documents_root,project_workspaces_root,+ shared_project_workspaces_root,)@@ -68,6 +70,25 @@ def test_the_projects_override_wins_outright(tmp_path, monkeypatch):assert project_workspaces_root() == tmp_path / "projects"[email protected]("dockerfile", ["Dockerfile.studio", "Dockerfile.studio-rocm"])+def test_the_studio_images_keep_project_folders_on_the_studio_volume(+ dockerfile, tmp_path, monkeypatch+):+ text = (Path(__file__).resolve().parents[3] / "docker" / dockerfile).read_text(encoding = "utf-8")+ block = text[text.index("ENV UNSLOTH_STUDIO_HOME=") :]+ image_env = dict(re.findall(r"(\w+)=(\S+)", block[: block.index("\n\n")]))+ for name in ("UNSLOTH_STUDIO_DOCUMENTS_HOME", "UNSLOTH_STUDIO_PROJECTS_HOME"):+ monkeypatch.delenv(name, raising = False)+ for name, value in image_env.items():+ monkeypatch.setenv(name, value)+ monkeypatch.setenv("HOME", str(tmp_path / "root"))++ assert project_workspaces_root().is_relative_to(image_env["UNSLOTH_STUDIO_HOME"])+ # The owner gets no OS confinement and its project root is a silent tool root, so it must not+ # contain the base the managed accounts' `Accounts/<id>/Projects` live under.+ assert not shared_project_workspaces_root().is_relative_to(project_workspaces_root())++def _probe_payload():from routes import chat_historyreturn chat_history.ChatProject(