feat(services/hf): honor HF_HUB_DISABLE_XET to force http download mode#7819
Open
AlJohri wants to merge 1 commit into
Open
feat(services/hf): honor HF_HUB_DISABLE_XET to force http download mode#7819AlJohri wants to merge 1 commit into
AlJohri wants to merge 1 commit into
Conversation
huggingface_hub documents HF_HUB_DISABLE_XET to disable the hf-xet integration and fall back to the classic resolve-redirect HTTP download. The services-huggingface backend already defaults download_mode to Xet and honors HF_ENDPOINT/HF_HOME, but had no equivalent to HF_HUB_DISABLE_XET. Resolve download_mode via a new hf_download_mode(): an explicit .download_mode(...) config still wins; otherwise a set, non-empty HF_HUB_DISABLE_XET forces Http -- the same convention as the existing HF_HUB_DISABLE_IMPLICIT_TOKEN check; the default stays Xet. This lets downloads be forced through HF_ENDPOINT (e.g. a pull-through cache proxy) with no code change. Signed-off-by: Al Johri <al.johri@gmail.com>
erickguan
requested changes
Jun 25, 2026
erickguan
left a comment
Member
There was a problem hiding this comment.
Thanks! A documentation comment.
| self | ||
| } | ||
|
|
||
| /// Set the download mode. Either `xet` (default) or `http`. |
Member
There was a problem hiding this comment.
Could you document environment variable and resolution too? This is user documentation. We generate documentation for different language bindings.
And a http link to the environment variable is also helpful.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Honor
HF_HUB_DISABLE_XET(ahuggingface_hubenv var): when set non-empty andno explicit
download_modeis configured, forcehttpinstead of theXetdefault — matching the existing
HF_HUB_DISABLE_IMPLICIT_TOKENhandling.