[PR #4569] [GUI] Image-model downloads honour HF_ENDPOINT like setup and the MTP fetch #5093

Open
opened 2026-11-07 16:32:38 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/4569
Author: @Nyarlathoteppppp
Created: 10/29/2026
Status: 🔄 Open

Base: main ← Head: fix/4369-hf-endpoint-images


📝 Commits (1)

  • e1a0e69 image models: downloads honour HF_ENDPOINT like setup and the MTP fetch (#4369)

📊 Changes

2 files changed (+16 additions, -1 deletions)

View changed files

📝 apps/host/server/image-models.mjs (+1 -1)
📝 apps/host/tests/image-models.test.mjs (+15 -0)

📄 Description

Problem and result

apps/host/server/image-models.mjs builds the image-model downloadUrl with a literal https://huggingface.co, and the installer fetches that URL, so HF_ENDPOINT (honoured since #495 by setup.py hf_endpoint() and tools/mtp_fetch.py) does not reach image-model downloads.

After the change the download URL uses the same rule as hf_endpoint(): HF_ENDPOINT trimmed, trailing slashes removed, else https://huggingface.co. The pinned revision, size and hash checks are unchanged.

Fixes #4369. Focused fix, no scope change.

Approach

One expression in library()'s downloadUrl, read at call time so it follows the host's environment like the other paths. The human-facing sourceUrl (the model page link in the UI) stays on huggingface.co: a mirror does not necessarily serve model pages, and nothing is downloaded from it.

Validation

Passed:

  • node --test apps/host/tests/image-models.test.mjs: the new test (mirror with a trailing slash, surrounding spaces and several slashes, unset, blank, ///) fails on 46c152a and passes with the fix; 7/7 pass.
  • node --test apps/host/tests/model-directory.test.mjs apps/host/tests/image-models.test.mjs: 12/12 pass.
  • Environment: macOS 26 (Darwin 25.5) arm64, Apple M1 Pro, Node 26.0.0, base 46c152a.

Failed:
none observed.

Not run:
full host suite, Windows/Linux, a real download through a mirror.

Limits

none known.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Niko1221/Strata/pull/4569 **Author:** [@Nyarlathoteppppp](https://github.com/Nyarlathoteppppp) **Created:** 10/29/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/4369-hf-endpoint-images` --- ### 📝 Commits (1) - [`e1a0e69`](https://github.com/Niko1221/Strata/commit/e1a0e69630ba9c61894e883d95907a06caead3da) image models: downloads honour HF_ENDPOINT like setup and the MTP fetch (#4369) ### 📊 Changes **2 files changed** (+16 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `apps/host/server/image-models.mjs` (+1 -1) 📝 `apps/host/tests/image-models.test.mjs` (+15 -0) </details> ### 📄 Description ## Problem and result `apps/host/server/image-models.mjs` builds the image-model `downloadUrl` with a literal `https://huggingface.co`, and the installer fetches that URL, so `HF_ENDPOINT` (honoured since #495 by `setup.py` `hf_endpoint()` and `tools/mtp_fetch.py`) does not reach image-model downloads. After the change the download URL uses the same rule as `hf_endpoint()`: `HF_ENDPOINT` trimmed, trailing slashes removed, else `https://huggingface.co`. The pinned revision, size and hash checks are unchanged. ## Related discussion Fixes #4369. Focused fix, no scope change. ## Approach One expression in `library()`'s `downloadUrl`, read at call time so it follows the host's environment like the other paths. The human-facing `sourceUrl` (the model page link in the UI) stays on huggingface.co: a mirror does not necessarily serve model pages, and nothing is downloaded from it. ## Validation **Passed:** - `node --test apps/host/tests/image-models.test.mjs`: the new test (mirror with a trailing slash, surrounding spaces and several slashes, unset, blank, `///`) fails on `46c152a` and passes with the fix; 7/7 pass. - `node --test apps/host/tests/model-directory.test.mjs apps/host/tests/image-models.test.mjs`: 12/12 pass. - Environment: macOS 26 (Darwin 25.5) arm64, Apple M1 Pro, Node 26.0.0, base `46c152a`. **Failed:** none observed. **Not run:** full host suite, Windows/Linux, a real download through a mirror. ## Limits none known. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#5093
No description provided.