wrenchpilot commited on
Commit
4ea6163
·
unverified ·
1 Parent(s): 85d25a9

feat: add Unsloth Studio configuration and docker-compose support

Browse files
Files changed (3) hide show
  1. .env.example +14 -0
  2. README.md +16 -0
  3. docker-compose.unsloth.yml +32 -0
.env.example CHANGED
@@ -50,6 +50,20 @@ LLAMA_SWAP_IMAGE="ghcr.io/mostlygeek/llama-swap:${LLAMA_SWAP_VERSION}"
50
  LLAMA_SWAP_PORT="8080"
51
  LLAMA_SWAP_API_KEY="${LLAMA_API_KEY}"
52
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
53
  # -----------------------------------------------------------------------------
54
  # Service lifecycle
55
  # -----------------------------------------------------------------------------
 
50
  LLAMA_SWAP_PORT="8080"
51
  LLAMA_SWAP_API_KEY="${LLAMA_API_KEY}"
52
 
53
+ # -----------------------------------------------------------------------------
54
+ # Unsloth Studio
55
+ # -----------------------------------------------------------------------------
56
+ UNSLOTH_IMAGE="unsloth/unsloth:latest"
57
+ UNSLOTH_CONTAINER_NAME="unsloth"
58
+ UNSLOTH_WORK_DIR="${MODELS_ROOT}/unsloth"
59
+ HF_CACHE_DIR="${MODELS_ROOT}/models"
60
+ UNSLOTH_BIND_ADDRESS="0.0.0.0"
61
+ UNSLOTH_STUDIO_HOST_PORT="8000"
62
+ UNSLOTH_JUPYTER_HOST_PORT="8888"
63
+ UNSLOTH_STUDIO_PASSWORD=""
64
+ JUPYTER_PASSWORD=""
65
+ UNSLOTH_STUDIO_BOOTSTRAP_TIMEOUT="3600"
66
+
67
  # -----------------------------------------------------------------------------
68
  # Service lifecycle
69
  # -----------------------------------------------------------------------------
README.md CHANGED
@@ -89,6 +89,22 @@ Files:
89
  | `docker-compose.yml` | GPU-enabled llama.cpp build service |
90
  | `build-llama.cpp.sh` | Pull source and run containerized build |
91
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
92
  The image includes `libssl-dev`, so llama.cpp can download Hugging Face models over HTTPS.
93
 
94
  ## Scripts
 
89
  | `docker-compose.yml` | GPU-enabled llama.cpp build service |
90
  | `build-llama.cpp.sh` | Pull source and run containerized build |
91
 
92
+ ### Unsloth Studio
93
+
94
+ `docker-compose.unsloth.yml` runs the official NVIDIA image with Unsloth Studio
95
+ and JupyterLab. Configure the `UNSLOTH_*` values in `.env`, set
96
+ `UNSLOTH_STUDIO_PASSWORD` and `JUPYTER_PASSWORD`, then start it with:
97
+
98
+ ```bash
99
+ docker compose -f docker-compose.unsloth.yml up -d
100
+ ```
101
+
102
+ Studio is available at `http://<server-host>:8000`; JupyterLab is available at
103
+ `http://<server-host>:8888`. The service persists the Hugging Face cache,
104
+ Studio data, Triton kernels, and files under `UNSLOTH_WORK_DIR`. The published
105
+ ports default to `0.0.0.0`; set `UNSLOTH_BIND_ADDRESS="127.0.0.1"` when using
106
+ SSH port forwarding instead of exposing the services to the LAN.
107
+
108
  The image includes `libssl-dev`, so llama.cpp can download Hugging Face models over HTTPS.
109
 
110
  ## Scripts
docker-compose.unsloth.yml ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ services:
2
+ unsloth:
3
+ image: ${UNSLOTH_IMAGE:-unsloth/unsloth:latest}
4
+ container_name: ${UNSLOTH_CONTAINER_NAME:-unsloth}
5
+ gpus: all
6
+ ipc: host
7
+ stop_grace_period: 150s
8
+ restart: unless-stopped
9
+ ulimits:
10
+ memlock:
11
+ soft: -1
12
+ hard: -1
13
+ stack:
14
+ soft: 67108864
15
+ hard: 67108864
16
+ ports:
17
+ - "${UNSLOTH_BIND_ADDRESS:-0.0.0.0}:${UNSLOTH_STUDIO_HOST_PORT:-8000}:8000"
18
+ - "${UNSLOTH_BIND_ADDRESS:-0.0.0.0}:${UNSLOTH_JUPYTER_HOST_PORT:-8888}:8888"
19
+ environment:
20
+ HF_TOKEN: ${HF_TOKEN:-}
21
+ JUPYTER_PASSWORD: ${JUPYTER_PASSWORD:-}
22
+ UNSLOTH_STUDIO_PASSWORD: ${UNSLOTH_STUDIO_PASSWORD:-}
23
+ UNSLOTH_STUDIO_BOOTSTRAP_TIMEOUT: ${UNSLOTH_STUDIO_BOOTSTRAP_TIMEOUT:-3600}
24
+ volumes:
25
+ - ${UNSLOTH_WORK_DIR:-./unsloth-work}:/workspace/host
26
+ - ${HF_CACHE_DIR:-./huggingface-cache}:/workspace/.cache/huggingface
27
+ - unsloth-studio:/opt/unsloth-studio
28
+ - unsloth-triton:/workspace/.cache/triton
29
+
30
+ volumes:
31
+ unsloth-studio:
32
+ unsloth-triton: