hfcache: Just cache what you want, and get the path
Each time I pull down a model or dataset from HuggingFace - there is a repeat list of tasks. Get it cached locally and then get the exact snapshot path. I need the snapshot path because this is what I pin in vllm serve commands and in from_pretrained(). This is a personal project built on personal time with personal resources.
The stock tooling that HuggingFace supplies makes this annoying. When downloading datasets via the official hf download I have to add --repo-type dataset despite this being detectable programatically, and it re-checks the network for repos you've already pinned, and the cache location resolves through silent machinery behind the scnes that will happily dump 50GB onto the wrong disk.
So that's why hfcache was built.
https://github.com/wayneworkman/hfcache
You just paste a repo ID or a browser URL onto the command as an argument, and it auto-detects if what you want is a model or dataset, it warns you if your cache location isn't configured, and it checks to see if the location that would be used has enough disk space or not. Finally, when the download is done, hfcache prints the snapshot path that you need as the last line of stdout, allowing you to copy/paste that path without digging into your filesystem to find it and without running additional commands.
hfcache also has a path command that allows serving an exact snapshot via vllm easier.
This method is better because it doesn't need internet access the way vllm serve Qwen/Qwen3.6-27B does. If you just put in the model ID into many of these tools such as vLLM, that goes across the internet to get resolved by huggingface_hub's resolution, which attempts to hit HuggingFace on startup even for a fully cached model, so HF sees your IP, the repo ID, and the timestamp every time the server restarts (unless you use yet another non-default option HF_HUB_OFFLINE=1). So, you can sidestep all that by simply running vLLM and others like this:
pip install hfcache
hfcache Qwen/Qwen3.6-27B
vllm serve $(hfcache path Qwen/Qwen3.6-27B) --served-model-name Qwen/Qwen3.6-27B
hfcache does not require any config file, there is no second cache. hfcache reads the same env vars that huggingface_hub reads with the same precedence and the same layout - everything it downloads is instantly visible to transformers, vllm and the hf cli.
Bug reports and contributions are welcome, submit those to the github repo's issues area.