Skip to main content

Module hf_pull

Module hf_pull 

Source
Expand description

Hugging Face Hub download helper.

This used to shell out to the hf CLI, which meant a Rust engine could not fetch its own weights without a Python install and pip install huggingface_hub. The transport is native now: see [crate::hub], which resolves IPv4 first, reads HF_TOKEN, honours HF_ENDPOINT, and asks for a byte range so an interrupted download resumes rather than starting from zero.

hf is still used when it is on PATH and the native path is not compiled in, so an existing setup keeps working.

Functionsยง

looks_like_hf_repo
True when path looks like a Hub repo id rather than a local file.
pull_hf_gguf
Download repo and return a local .gguf path.
resolve_model_path
If model is a Hub repo id, download and return the local GGUF path.