Describe the bug
HF_HUB_ENABLE_HF_TRANSFER=1 is a silent no-op on the upload code path in huggingface_hub ≥ 1.x — hf_transfer was fully removed in favor of hf-xet. The deprecation warning that exists in constants.py only fires when the user also sets HF_XET_HIGH_PERFORMANCE=1, which doesn't match the actual user journey: most affected users only set the legacy flag (because that's what every older tutorial / Stack Overflow answer / older HF doc still recommends), and so they never see the warning. They assume the flag is doing something, see no speedup, and end up on the forum thinking Xet is broken.
The relevant code in src/huggingface_hub/constants.py:
# hf_transfer is not used anymore. Let's warn user is case they set the env variable
if _is_true(os.environ.get("HF_HUB_ENABLE_HF_TRANSFER")) and not HF_XET_HIGH_PERFORMANCE:
"The `HF_HUB_ENABLE_HF_TRANSFER` environment variable is deprecated as 'hf_transfer' is not used anymore. "
Two issues:
- The string literal is constructed but never logged or warned — it's effectively dead code.
- Even if it were logged, the condition
not HF_XET_HIGH_PERFORMANCE makes it skip the most common user case (users who only know the old flag).
Suggested fix:
- Always warn when
HF_HUB_ENABLE_HF_TRANSFER is set, regardless of whether HF_XET_HIGH_PERFORMANCE is set. Use warnings.warn(...) or logger.warning(...) so the message is actually surfaced at module import or upload start.
- Update the basic
hf upload quickstart in docs/source/en/guides/upload.md to mention HF_XET_HIGH_PERFORMANCE=1 as the recommended performance flag — currently it's only mentioned in the "Upload a large folder → Tips and tricks" sub-section, which most users don't reach.
- Mention the migration explicitly in the v1.0 release notes / migration guide for users with
HF_HUB_ENABLE_HF_TRANSFER=1 set in their existing env / shell profiles.
Why this matters: Users hitting slow uploads are currently being told to set HF_HUB_DISABLE_XET=1 as a workaround (e.g., the active forum thread linked below), which falls back to single-stream LFS at ~3 Mbps. Most of them would prefer HF_XET_HIGH_PERFORMANCE=1, but nothing in their tooling tells them that flag exists. A one-line warning would close that gap.
Related:
Reproduction
# In a shell with the legacy flag set:
HF_HUB_ENABLE_HF_TRANSFER=1 hf upload <namespace>/<repo> ./large_file.safetensors
Expected: a deprecation warning at upload start telling the user the flag is no longer effective and pointing them to HF_XET_HIGH_PERFORMANCE.
Actual: silence. Throughput identical to running with no flag set. Confirmed via TCP destination inspection (ss -tnp shows GCS endpoints 34.107.x.x / 34.149.x.x, indicating the Xet path is in use regardless of the legacy flag).
Logs
System info
- `huggingface_hub` version: 1.14.0
- `hf-xet` version: 1.5.0
- Python version: 3.12
- OS: Linux aarch64 (NVIDIA Jetson Thor AGX)
- Token authenticated: Yes
- Run as: standard user (non-root)
Describe the bug
HF_HUB_ENABLE_HF_TRANSFER=1is a silent no-op on the upload code path inhuggingface_hub≥ 1.x —hf_transferwas fully removed in favor ofhf-xet. The deprecation warning that exists inconstants.pyonly fires when the user also setsHF_XET_HIGH_PERFORMANCE=1, which doesn't match the actual user journey: most affected users only set the legacy flag (because that's what every older tutorial / Stack Overflow answer / older HF doc still recommends), and so they never see the warning. They assume the flag is doing something, see no speedup, and end up on the forum thinking Xet is broken.The relevant code in
src/huggingface_hub/constants.py:Two issues:
not HF_XET_HIGH_PERFORMANCEmakes it skip the most common user case (users who only know the old flag).Suggested fix:
HF_HUB_ENABLE_HF_TRANSFERis set, regardless of whetherHF_XET_HIGH_PERFORMANCEis set. Usewarnings.warn(...)orlogger.warning(...)so the message is actually surfaced at module import or upload start.hf uploadquickstart indocs/source/en/guides/upload.mdto mentionHF_XET_HIGH_PERFORMANCE=1as the recommended performance flag — currently it's only mentioned in the "Upload a large folder → Tips and tricks" sub-section, which most users don't reach.HF_HUB_ENABLE_HF_TRANSFER=1set in their existing env / shell profiles.Why this matters: Users hitting slow uploads are currently being told to set
HF_HUB_DISABLE_XET=1as a workaround (e.g., the active forum thread linked below), which falls back to single-stream LFS at ~3 Mbps. Most of them would preferHF_XET_HIGH_PERFORMANCE=1, but nothing in their tooling tells them that flag exists. A one-line warning would close that gap.Related:
Reproduction
Expected: a deprecation warning at upload start telling the user the flag is no longer effective and pointing them to
HF_XET_HIGH_PERFORMANCE.Actual: silence. Throughput identical to running with no flag set. Confirmed via TCP destination inspection (
ss -tnpshows GCS endpoints34.107.x.x/34.149.x.x, indicating the Xet path is in use regardless of the legacy flag).Logs
System info