unsloth/studio/backend/utils
Daniel Han f4f69f16a6 studio: centralize cache directory for all downloads
Set HF_HOME, HF_HUB_CACHE, HF_XET_CACHE, UV_CACHE_DIR, and
VLLM_CACHE_ROOT to a unified location under ~/.unsloth/studio/cache/
on startup. This keeps all model downloads, datasets, and caches
in one place instead of scattered across ~/.cache/huggingface,
~/.cache/uv, etc.

Layout:
  ~/.unsloth/studio/cache/
    huggingface/       (HF_HOME)
      hub/             (HF_HUB_CACHE -- model/dataset downloads)
      xet/             (HF_XET_CACHE -- xet blob store)
    uv/                (UV_CACHE_DIR -- uv package cache)
    vllm/              (VLLM_CACHE_ROOT -- vllm compiled kernels)

Only sets variables that are not already in the environment, so
user overrides (e.g. HF_HOME=/data/models) are respected.

Cross-platform: uses Path.home() which resolves correctly on
Linux (~), macOS (~), and Windows (C:\Users\<user>).
2026-03-15 05:24:06 -07:00
..
datasets fix: prevent ai-assist model config RCE via untrusted Hugging Face repos (#4274) 2026-03-13 19:29:11 +04:00
hardware Final cleanup 2026-03-12 18:28:04 +00:00
inference Final cleanup 2026-03-12 18:28:04 +00:00
models fix: prevent ai-assist model config RCE via untrusted Hugging Face repos (#4274) 2026-03-13 19:29:11 +04:00
paths studio: centralize cache directory for all downloads 2026-03-15 05:24:06 -07:00
.gitkeep root studio folder 2026-02-02 09:13:49 +00:00
__init__.py Final cleanup 2026-03-12 18:28:04 +00:00
cache_cleanup.py Final cleanup 2026-03-12 18:28:04 +00:00
transformers_version.py Final cleanup 2026-03-12 18:28:04 +00:00
utils.py Final cleanup 2026-03-12 18:28:04 +00:00