Skip to content

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.

CI: share the gemma-3-270m-it model cache across Linux, macOS and Windows (#8068)

Daniel Han292c479150db
diff --git a/.github/workflows/local-agent-guides-ci.yml b/.github/workflows/local-agent-guides-ci.yml
index 444c932f90a..90f2f65ed1b 100644
--- a/.github/workflows/local-agent-guides-ci.yml
+++ b/.github/workflows/local-agent-guides-ci.yml
@@ -718,13 +718,17 @@ jobs:
python-version: '3.12'
cache: 'pip'
+ # Cross-OS shared entry. The tree under `hf-cache` is byte-identical on
+ # Linux, macOS and Windows, so the key carries no `runner.os`, and
+ # enableCrossOsArchive lets Windows (which tars with --force-local) join it.
- name: Restore HF_HOME for ${{ env.GGUF_REPO }}
id: cache-hf
uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
continue-on-error: true
with:
path: hf-cache
- key: ${{ runner.os }}-hf-${{ env.GGUF_REPO }}-${{ env.GGUF_VARIANT }}-v2
+ key: hf-${{ env.GGUF_REPO }}-${{ env.GGUF_VARIANT }}-v3
+ enableCrossOsArchive: true
- name: Prime HF_HOME with the GGUF
id: prime-hf
@@ -738,11 +742,12 @@ jobs:
bash .github/scripts/hf-download-with-retry.sh "$GGUF_REPO" "$GGUF_FILE"
- name: Save HF_HOME for ${{ env.GGUF_REPO }}
- if: always() && github.ref == 'refs/heads/main' && steps.prime-hf.outcome == 'success'
+ if: always() && github.ref == 'refs/heads/main' && steps.prime-hf.outcome == 'success' && hashFiles('hf-cache/**/*.gguf') != ''
uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: hf-cache
- key: ${{ runner.os }}-hf-${{ env.GGUF_REPO }}-${{ env.GGUF_VARIANT }}-v2
+ key: hf-${{ env.GGUF_REPO }}-${{ env.GGUF_VARIANT }}-v3
+ enableCrossOsArchive: true
- name: Install Unsloth (--local, --no-torch)
uses: ./.github/actions/install-unsloth-local
diff --git a/.github/workflows/studio-api-smoke.yml b/.github/workflows/studio-api-smoke.yml
index 1e02bb6b5c7..df9f3807a7b 100644
--- a/.github/workflows/studio-api-smoke.yml
+++ b/.github/workflows/studio-api-smoke.yml
@@ -75,15 +75,19 @@ jobs:
python-version: '3.12'
cache: 'pip'
+ # Cross-OS shared entry. The tree under `hf-cache` is byte-identical on
+ # Linux, macOS and Windows, so the key carries no `runner.os`, and
+ # enableCrossOsArchive lets Windows (which tars with --force-local) join it.
- name: Restore HF_HOME for ${{ env.GGUF_REPO }}
id: cache-hf
uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
continue-on-error: true
with:
path: hf-cache
- # Same key as studio-ui-smoke.yml so the two jobs share a
- # single GGUF download across CI.
- key: ${{ runner.os }}-hf-${{ env.GGUF_REPO }}-${{ env.GGUF_VARIANT }}-v2
+ # Shared by every gemma-3-270m-it job in CI (Linux, macOS and
+ # Windows alike) so the model is downloaded once, not once per OS.
+ key: hf-${{ env.GGUF_REPO }}-${{ env.GGUF_VARIANT }}-v3
+ enableCrossOsArchive: true
- name: Prime HF_HOME with the GGUF
id: prime-hf
@@ -108,11 +112,12 @@ jobs:
# same 4.6GB model held four times on four different PR refs and no copy
# on main at all. That is the thrash loop: PR misses -> downloads ->
# saves its own copy -> evicts main's -> next PR misses.
- if: always() && github.ref == 'refs/heads/main' && steps.prime-hf.outcome == 'success'
+ if: always() && github.ref == 'refs/heads/main' && steps.prime-hf.outcome == 'success' && hashFiles('hf-cache/**/*.gguf') != ''
uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: hf-cache
- key: ${{ runner.os }}-hf-${{ env.GGUF_REPO }}-${{ env.GGUF_VARIANT }}-v2
+ key: hf-${{ env.GGUF_REPO }}-${{ env.GGUF_VARIANT }}-v3
+ enableCrossOsArchive: true
- name: Install Unsloth (--local, --no-torch)
uses: ./.github/actions/install-unsloth-local
diff --git a/.github/workflows/studio-inference-smoke.yml b/.github/workflows/studio-inference-smoke.yml
index 511259aeb17..e0773acd68c 100644
--- a/.github/workflows/studio-inference-smoke.yml
+++ b/.github/workflows/studio-inference-smoke.yml
@@ -91,13 +91,17 @@ jobs:
python-version: '3.12'
cache: 'pip'
+ # Cross-OS shared entry. The tree under `hf-cache` is byte-identical on
+ # Linux, macOS and Windows, so the key carries no `runner.os`, and
+ # enableCrossOsArchive lets Windows (which tars with --force-local) join it.
- name: Restore HF_HOME for ${{ env.GGUF_REPO }}
id: cache-hf
uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
continue-on-error: true
with:
path: hf-cache
- key: ${{ runner.os }}-hf-${{ env.GGUF_REPO }}-${{ env.GGUF_VARIANT }}-v2
+ key: hf-${{ env.GGUF_REPO }}-${{ env.GGUF_VARIANT }}-v3
+ enableCrossOsArchive: true
- name: Prime HF_HOME with the GGUF
id: prime-hf
@@ -122,11 +126,12 @@ jobs:
# same 4.6GB model held four times on four different PR refs and no copy
# on main at all. That is the thrash loop: PR misses -> downloads ->
# saves its own copy -> evicts main's -> next PR misses.
- if: always() && github.ref == 'refs/heads/main' && steps.prime-hf.outcome == 'success'
+ if: always() && github.ref == 'refs/heads/main' && steps.prime-hf.outcome == 'success' && hashFiles('hf-cache/**/*.gguf') != ''
uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: hf-cache
- key: ${{ runner.os }}-hf-${{ env.GGUF_REPO }}-${{ env.GGUF_VARIANT }}-v2
+ key: hf-${{ env.GGUF_REPO }}-${{ env.GGUF_VARIANT }}-v3
+ enableCrossOsArchive: true
- name: Install Unsloth (--local, --no-torch)
uses: ./.github/actions/install-unsloth-local
diff --git a/.github/workflows/studio-mac-inference-smoke.yml b/.github/workflows/studio-mac-inference-smoke.yml
index 568b7fd9ec3..0a09892f0a7 100644
--- a/.github/workflows/studio-mac-inference-smoke.yml
+++ b/.github/workflows/studio-mac-inference-smoke.yml
@@ -155,6 +155,9 @@ jobs:
echo "GGUF_FILE=gemma-3-270m-it-UD-Q4_K_XL.gguf" >> "$GITHUB_ENV"
echo "STUDIO_PORT=18888" >> "$GITHUB_ENV"
+ # Cross-OS shared entry. The tree under `hf-cache` is byte-identical on
+ # Linux, macOS and Windows, so the key carries no `runner.os`, and
+ # enableCrossOsArchive lets Windows (which tars with --force-local) join it.
- name: Restore HF_HOME for unsloth/gemma-3-270m-it-GGUF
id: cache-hf
uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
@@ -162,7 +165,8 @@ jobs:
timeout-minutes: 15
with:
path: hf-cache
- key: ${{ runner.os }}-hf-unsloth/gemma-3-270m-it-GGUF-UD-Q4_K_XL-v2
+ key: hf-unsloth/gemma-3-270m-it-GGUF-UD-Q4_K_XL-v3
+ enableCrossOsArchive: true
- name: Prime HF_HOME with the GGUF
id: prime-hf
@@ -195,7 +199,8 @@ jobs:
timeout-minutes: 15
with:
path: hf-cache
- key: ${{ runner.os }}-hf-unsloth/gemma-3-270m-it-GGUF-UD-Q4_K_XL-v2
+ key: hf-unsloth/gemma-3-270m-it-GGUF-UD-Q4_K_XL-v3
+ enableCrossOsArchive: true
- name: Install OpenAI + Anthropic Python SDKs
timeout-minutes: 5
run: pip install 'openai>=1.50' 'anthropic>=0.40'
diff --git a/.github/workflows/studio-mac-ui-smoke.yml b/.github/workflows/studio-mac-ui-smoke.yml
index fabefca4eb5..b59c512f5e2 100644
--- a/.github/workflows/studio-mac-ui-smoke.yml
+++ b/.github/workflows/studio-mac-ui-smoke.yml
@@ -88,13 +88,17 @@ jobs:
python-version: '3.12'
cache: 'pip'
+ # Cross-OS shared entry. The tree under `hf-cache` is byte-identical on
+ # Linux, macOS and Windows, so the key carries no `runner.os`, and
+ # enableCrossOsArchive lets Windows (which tars with --force-local) join it.
- name: Restore HF_HOME for ${{ env.GGUF_REPO }}
id: cache-hf
uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
continue-on-error: true
with:
path: hf-cache
- key: ${{ runner.os }}-hf-${{ env.GGUF_REPO }}-${{ env.GGUF_VARIANT }}-v2
+ key: hf-${{ env.GGUF_REPO }}-${{ env.GGUF_VARIANT }}-v3
+ enableCrossOsArchive: true
- name: Prime HF_HOME with the GGUF
id: prime-hf
@@ -127,11 +131,12 @@ jobs:
# same 4.6GB model held four times on four different PR refs and no copy
# on main at all. That is the thrash loop: PR misses -> downloads ->
# saves its own copy -> evicts main's -> next PR misses.
- if: always() && github.ref == 'refs/heads/main' && steps.prime-hf.outcome == 'success'
+ if: always() && github.ref == 'refs/heads/main' && steps.prime-hf.outcome == 'success' && hashFiles('hf-cache/**/*.gguf') != ''
uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: hf-cache
- key: ${{ runner.os }}-hf-${{ env.GGUF_REPO }}-${{ env.GGUF_VARIANT }}-v2
+ key: hf-${{ env.GGUF_REPO }}-${{ env.GGUF_VARIANT }}-v3
+ enableCrossOsArchive: true
- name: Install Unsloth (--local, --no-torch)
id: install_unsloth
diff --git a/.github/workflows/studio-ui-smoke.yml b/.github/workflows/studio-ui-smoke.yml
index 34949db7696..abd38c26048 100644
--- a/.github/workflows/studio-ui-smoke.yml
+++ b/.github/workflows/studio-ui-smoke.yml
@@ -87,13 +87,17 @@ jobs:
python -m pip install --quiet 'pytest>=8'
python -m pytest tests/studio/test_stt_model_search_locator_contract.py -q
+ # Cross-OS shared entry. The tree under `hf-cache` is byte-identical on
+ # Linux, macOS and Windows, so the key carries no `runner.os`, and
+ # enableCrossOsArchive lets Windows (which tars with --force-local) join it.
- name: Restore HF_HOME for ${{ env.GGUF_REPO }}
id: cache-hf
uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
continue-on-error: true
with:
path: hf-cache
- key: ${{ runner.os }}-hf-${{ env.GGUF_REPO }}-${{ env.GGUF_VARIANT }}-v2
+ key: hf-${{ env.GGUF_REPO }}-${{ env.GGUF_VARIANT }}-v3
+ enableCrossOsArchive: true
- name: Prime HF_HOME with the GGUF
id: prime-hf
@@ -118,11 +122,12 @@ jobs:
# same 4.6GB model held four times on four different PR refs and no copy
# on main at all. That is the thrash loop: PR misses -> downloads ->
# saves its own copy -> evicts main's -> next PR misses.
- if: always() && github.ref == 'refs/heads/main' && steps.prime-hf.outcome == 'success'
+ if: always() && github.ref == 'refs/heads/main' && steps.prime-hf.outcome == 'success' && hashFiles('hf-cache/**/*.gguf') != ''
uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: hf-cache
- key: ${{ runner.os }}-hf-${{ env.GGUF_REPO }}-${{ env.GGUF_VARIANT }}-v2
+ key: hf-${{ env.GGUF_REPO }}-${{ env.GGUF_VARIANT }}-v3
+ enableCrossOsArchive: true
- name: Install Unsloth (--local, --no-torch)
uses: ./.github/actions/install-unsloth-local
diff --git a/.github/workflows/studio-windows-api-smoke.yml b/.github/workflows/studio-windows-api-smoke.yml
index b5865c38efd..665e018103e 100644
--- a/.github/workflows/studio-windows-api-smoke.yml
+++ b/.github/workflows/studio-windows-api-smoke.yml
@@ -67,13 +67,17 @@ jobs:
with:
python-version: '3.12'
+ # Cross-OS shared entry. The tree under `hf-cache` is byte-identical on
+ # Linux, macOS and Windows, so the key carries no `runner.os`, and
+ # enableCrossOsArchive lets Windows (which tars with --force-local) join it.
- name: Restore HF_HOME for ${{ env.GGUF_REPO }}
id: cache-hf
uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
continue-on-error: true
with:
path: hf-cache
- key: ${{ runner.os }}-hf-${{ env.GGUF_REPO }}-${{ env.GGUF_VARIANT }}-v2
+ key: hf-${{ env.GGUF_REPO }}-${{ env.GGUF_VARIANT }}-v3
+ enableCrossOsArchive: true
- name: Prime HF_HOME with the GGUF
id: prime-hf
@@ -98,11 +102,12 @@ jobs:
# same 4.6GB model held four times on four different PR refs and no copy
# on main at all. That is the thrash loop: PR misses -> downloads ->
# saves its own copy -> evicts main's -> next PR misses.
- if: always() && github.ref == 'refs/heads/main' && steps.prime-hf.outcome == 'success'
+ if: always() && github.ref == 'refs/heads/main' && steps.prime-hf.outcome == 'success' && hashFiles('hf-cache/**/*.gguf') != ''
uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: hf-cache
- key: ${{ runner.os }}-hf-${{ env.GGUF_REPO }}-${{ env.GGUF_VARIANT }}-v2
+ key: hf-${{ env.GGUF_REPO }}-${{ env.GGUF_VARIANT }}-v3
+ enableCrossOsArchive: true
- name: Pre-install Windows tweaks (npm 11 + Defender exclusions)
shell: pwsh
diff --git a/.github/workflows/studio-windows-inference-smoke.yml b/.github/workflows/studio-windows-inference-smoke.yml
index 15e13ba350b..97a6d4f103c 100644
--- a/.github/workflows/studio-windows-inference-smoke.yml
+++ b/.github/workflows/studio-windows-inference-smoke.yml
@@ -277,6 +277,9 @@ jobs:
# populates the cache key on a real miss only; cache keys are
# immutable, so a corrupted cached entry persists until the -v1
# suffix below is bumped.
+ # Cross-OS shared entry. The tree under `hf-cache` is byte-identical on
+ # Linux, macOS and Windows, so the key carries no `runner.os`, and
+ # enableCrossOsArchive lets Windows (which tars with --force-local) join it.
- name: Restore HF_HOME cache for unsloth/gemma-3-270m-it-GGUF
id: cache-hf
timeout-minutes: 15
@@ -284,7 +287,8 @@ jobs:
continue-on-error: true
with:
path: hf-cache
- key: ${{ runner.os }}-hf-unsloth/gemma-3-270m-it-GGUF-UD-Q4_K_XL-v2
+ key: hf-unsloth/gemma-3-270m-it-GGUF-UD-Q4_K_XL-v3
+ enableCrossOsArchive: true
- name: Prime HF_HOME with the GGUF
id: prime-hf
@@ -316,11 +320,12 @@ jobs:
# same 4.6GB model held four times on four different PR refs and no copy
# on main at all. That is the thrash loop: PR misses -> downloads ->
# saves its own copy -> evicts main's -> next PR misses.
- if: always() && github.ref == 'refs/heads/main' && steps.prime-hf.outcome == 'success'
+ if: always() && github.ref == 'refs/heads/main' && steps.prime-hf.outcome == 'success' && hashFiles('hf-cache/**/*.gguf') != ''
uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: hf-cache
- key: ${{ runner.os }}-hf-unsloth/gemma-3-270m-it-GGUF-UD-Q4_K_XL-v2
+ key: hf-unsloth/gemma-3-270m-it-GGUF-UD-Q4_K_XL-v3
+ enableCrossOsArchive: true
- name: Reset auth + boot Unsloth (API-only)
timeout-minutes: 2
@@ -1428,13 +1433,17 @@ jobs:
with:
python-version: '3.12'
+ # Cross-OS shared entry. The tree under `hf-cache` is byte-identical on
+ # Linux, macOS and Windows, so the key carries no `runner.os`, and
+ # enableCrossOsArchive lets Windows (which tars with --force-local) join it.
- name: Restore HF_HOME for ${{ env.GGUF_REPO }}
id: cache-hf
uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
continue-on-error: true
with:
path: hf-cache
- key: ${{ runner.os }}-hf-${{ env.GGUF_REPO }}-${{ env.GGUF_VARIANT }}-v2
+ key: hf-${{ env.GGUF_REPO }}-${{ env.GGUF_VARIANT }}-v3
+ enableCrossOsArchive: true
- name: Prime HF_HOME with the GGUF
id: prime-hf
@@ -1449,11 +1458,12 @@ jobs:
bash .github/scripts/hf-download-with-retry.sh ggml-org/models tinyllamas/stories260K.gguf
- name: Save HF_HOME for ${{ env.GGUF_REPO }}
- if: always() && github.ref == 'refs/heads/main' && steps.prime-hf.outcome == 'success'
+ if: always() && github.ref == 'refs/heads/main' && steps.prime-hf.outcome == 'success' && hashFiles('hf-cache/**/*.gguf') != ''
uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: hf-cache
- key: ${{ runner.os }}-hf-${{ env.GGUF_REPO }}-${{ env.GGUF_VARIANT }}-v2
+ key: hf-${{ env.GGUF_REPO }}-${{ env.GGUF_VARIANT }}-v3
+ enableCrossOsArchive: true
- name: Pre-install Windows tweaks (npm 11 + Defender exclusions)
shell: pwsh
diff --git a/.github/workflows/studio-windows-ui-smoke.yml b/.github/workflows/studio-windows-ui-smoke.yml
index 584763eaed4..b87e078fae0 100644
--- a/.github/workflows/studio-windows-ui-smoke.yml
+++ b/.github/workflows/studio-windows-ui-smoke.yml
@@ -83,13 +83,17 @@ jobs:
# then fatal-errors with "Cache folder path is retrieved
# for pip but doesn't exist on disk".
+ # Cross-OS shared entry. The tree under `hf-cache` is byte-identical on
+ # Linux, macOS and Windows, so the key carries no `runner.os`, and
+ # enableCrossOsArchive lets Windows (which tars with --force-local) join it.
- name: Restore HF_HOME for ${{ env.GGUF_REPO }}
id: cache-hf
uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
continue-on-error: true
with:
path: hf-cache
- key: ${{ runner.os }}-hf-${{ env.GGUF_REPO }}-${{ env.GGUF_VARIANT }}-v2
+ key: hf-${{ env.GGUF_REPO }}-${{ env.GGUF_VARIANT }}-v3
+ enableCrossOsArchive: true
- name: Prime HF_HOME with the GGUF
id: prime-hf
@@ -114,11 +118,12 @@ jobs:
# same 4.6GB model held four times on four different PR refs and no copy
# on main at all. That is the thrash loop: PR misses -> downloads ->
# saves its own copy -> evicts main's -> next PR misses.
- if: always() && github.ref == 'refs/heads/main' && steps.prime-hf.outcome == 'success'
+ if: always() && github.ref == 'refs/heads/main' && steps.prime-hf.outcome == 'success' && hashFiles('hf-cache/**/*.gguf') != ''
uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: hf-cache
- key: ${{ runner.os }}-hf-${{ env.GGUF_REPO }}-${{ env.GGUF_VARIANT }}-v2
+ key: hf-${{ env.GGUF_REPO }}-${{ env.GGUF_VARIANT }}-v3
+ enableCrossOsArchive: true
- name: Pre-install Windows tweaks (npm 11 + Defender exclusions)
shell: pwsh