Skip to content

feat(services/hf): add download_mode option and require explicit repo_type#7625

Open
kszucs wants to merge 3 commits into
apache:mainfrom
kszucs:resolve
Open

feat(services/hf): add download_mode option and require explicit repo_type#7625
kszucs wants to merge 3 commits into
apache:mainfrom
kszucs:resolve

Conversation

@kszucs
Copy link
Copy Markdown
Member

@kszucs kszucs commented May 27, 2026

Summary

  • Add download_mode config option (xet | http) to the HuggingFace service. In xet mode (default) the resolve endpoint is called with Accept: application/vnd.xet-fileinfo+json and files are streamed via the XET SDK. In http mode the server's 302 redirect is followed and bytes are streamed directly without any XET SDK involvement.
  • Move HfRepoType from uri.rs to config.rs alongside the new HfDownloadMode enum.
  • Make repo_type explicit — HfRepoType no longer implements Default, HfConfig.repo_type is Option<HfRepoType>, and both from_uri() and build() return ConfigInvalid if it is not set.
  • Consolidate path_resolve / path_resolve_http into a single resolve(path, range, mode) method on HfCore.
  • Refactor parse_error to take (parts, body) directly instead of a full Response<Buffer>.

@kszucs kszucs requested a review from Xuanwo as a code owner May 27, 2026 15:08
@dosubot dosubot Bot added size:L This PR changes 100-499 lines, ignoring generated files. releases-note/feat The PR implements a new feature or has a title that begins with "feat" labels May 27, 2026
@dosubot dosubot Bot added size:XL This PR changes 500-999 lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels May 27, 2026
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" size:XL This PR changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant