You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rework model storage directory management (for external storage) (#1765)
## Motivation
Replace confusing EXO_MODELS_DIR/EXO_MODELS_PATH with clearer
multi-directory support, enabling automatic download spillover across
volumes.
## Changes
- EXO_MODELS_DIRS: colon-separated writable dirs (default always
prepended, first with enough space wins)
- EXO_MODELS_READ_ONLY_DIRS: colon-separated read-only dirs (protected
from deletion)
- select_download_dir(): picks writable dir by free space
- resolve_existing_model(): unified lookup across all dirs
- is_read_only_model_dir(): path-based read-only detection instead of
hardcoded flag
- Updated coordinator, worker, model cards, tests
## Why It Works
Default dir always included so zero-config behavior is unchanged. Disk
space checked at download time for automatic spillover. Read-only status
derived from path, not hardcoded.
## Test Plan
### Manual Testing
- No env vars set → identical behavior
- EXO_MODELS_DIRS=/Volumes/SSD/models → downloads to external storage
- EXO_MODELS_READ_ONLY_DIRS=/mnt/nfs → models found, deletion blocked
### Automated Testing
- 4 new tests in test_xdg_paths.py (prepend, default-only, overlap,
empty read-only)
- Existing tests updated to patch new constants
Copy file name to clipboardExpand all lines: README.md
+8-4Lines changed: 8 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -295,8 +295,9 @@ exo supports several environment variables for configuration:
295
295
296
296
| Variable | Description | Default |
297
297
|----------|-------------|---------|
298
-
|`EXO_MODELS_PATH`| Colon-separated paths to search for pre-downloaded models (e.g., on NFS mounts or shared storage) | None |
299
-
|`EXO_MODELS_DIR`| Directory where exo downloads and stores models |`~/.local/share/exo/models` (Linux) or `~/.exo/models` (macOS) |
298
+
|`EXO_DEFAULT_MODELS_DIR`| Default directory for model downloads and caches. Always first in the writable dirs list. |`~/.local/share/exo/models` (Linux) or `~/.exo/models` (macOS) |
299
+
|`EXO_MODELS_DIRS`| Colon-separated additional writable directories for model downloads. Checked in order after the default; first with enough free space is used. | None |
300
+
|`EXO_MODELS_READ_ONLY_DIRS`| Colon-separated read-only directories to search for pre-downloaded models (e.g., NFS mounts, shared storage). Models here cannot be deleted. | None |
300
301
|`EXO_OFFLINE`| Run without internet connection (uses only local models) |`false`|
301
302
|`EXO_ENABLE_IMAGE_MODELS`| Enable image model support |`false`|
302
303
|`EXO_LIBP2P_NAMESPACE`| Custom namespace for cluster isolation | None |
@@ -306,8 +307,11 @@ exo supports several environment variables for configuration:
306
307
**Example usage:**
307
308
308
309
```bash
309
-
# Use pre-downloaded models from NFS mount
310
-
EXO_MODELS_PATH=/mnt/nfs/models:/opt/ai-models uv run exo
310
+
# Use pre-downloaded models from NFS mount (read-only)
311
+
EXO_MODELS_READ_ONLY_DIRS=/mnt/nfs/models:/opt/ai-models uv run exo
312
+
313
+
# Download models to an external SSD (falls back to default dir if full)
314
+
EXO_MODELS_DIRS=/Volumes/ExternalSSD/exo-models uv run exo
0 commit comments