Skip to content

feat(services/hf): add disable_config_load - #8390

Merged
kszucs merged 2 commits into
apache:mainfrom
kszucs:hf-disable-config-load
Oct 27, 2026
Merged

kszucs merged 2 commits into
apache:mainfrom
kszucs:hf-disable-config-load

Conversation

@kszucs

@kszucs kszucs commented Oct 8, 2026 •

Copy link
Copy Markdown
Member

Which issue does this PR close?

None.

Rationale for this change

Without an explicit token, the hf service uses the process's token (HF_TOKEN
or the hf auth login token file). A server that builds operators for its
users, such as ClickHouse's opendal() table function, would then send their
requests with its own Hugging Face identity. s3 has disable_config_load for
the same problem.

What changes are included in this PR?

disable_config_load stops the hf service from reading config from the
environment:

  • the token from HF_TOKEN, HF_TOKEN_PATH, or the token file under
    HF_HOME, $XDG_CACHE_HOME/huggingface or ~/.cache/huggingface;
  • the Hub endpoint from HF_ENDPOINT;
  • the download mode from HF_HUB_DISABLE_XET.

This matches s3, whose disable_config_load also skips AWS_ENDPOINT_URL.
The Xet client still reads its tuning variables (HF_XET_*) and locates its
cache from HF_XET_CACHE, HF_HOME or XDG_CACHE_HOME; these hold no
credentials. Binding configs are regenerated.

Are there any user-facing changes?

A new opt-in hf option, false by default. With it enabled, the endpoint
defaults to https://huggingface.co and the download mode to xet unless
endpoint and download_mode are set explicitly.

Breaking changes

AI Usage Statement

  • Harness: Claude Code (VS Code extension)
  • Model: Claude Opus 5.5 (claude-opus-5-5)
  • Effort: high
  • Role: Wrote the implementation, tests and docs under my direction.

@github-actions github-actions Bot added releases-note/feat The PR implements a new feature or has a title that begins with "feat" services/huggingface size:L This PR changes 100-499 lines, ignoring generated files. labels Oct 8, 2026
@kszucs
kszucs force-pushed the hf-disable-config-load branch 2 times, most recently from d4db042 to f547d49 Compare October 8, 2026 12:32
@github-actions github-actions Bot added services/hdfs size:M This PR changes 30-99 lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels Oct 8, 2026
@kszucs
kszucs force-pushed the hf-disable-config-load branch from f547d49 to acdc71b Compare October 8, 2026 13:30
@github-actions github-actions Bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Oct 8, 2026
Like s3's option of the same name, it stops the service from reading a token
from the environment, so a server embedding OpenDAL does not send its users'
requests with its own Hugging Face token.
@kszucs
kszucs force-pushed the hf-disable-config-load branch from acdc71b to 4af4f4f Compare October 27, 2026 14:23
…e_config_load

Match s3, whose disable_config_load also skips AWS_ENDPOINT_URL: HF_ENDPOINT
and HF_HUB_DISABLE_XET are no longer read when the option is set.

@kszucs kszucs left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@kszucs
kszucs merged commit 69f600b into apache:main Oct 27, 2026
380 of 381 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

releases-note/feat The PR implements a new feature or has a title that begins with "feat" services/hdfs services/huggingface size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants