Web Asset House Guides
Local AI

How to Download AI Models from Hugging Face (hf CLI, Ollama and Gated Models)

By Web Asset House Studio ·

Note: Some future links on this site may be affiliate links. We never claim hands-on testing; guides are researched from the public sources listed in each article.

How we wrote this: A summary of Hugging Face's official documentation for the hf CLI, downloading, the cache, gated models and Ollama (linked below), checked October 28, 2026. Check the docs for the version you install.

Hugging Face hosts most of the open-weight models people run at home. You can browse in a web browser, but for multi-gigabyte files the official command-line tool makes it easier to pick exactly the files you need, preview the size first and clean up afterward.

Install the hf CLI

The hf command comes with the huggingface_hub Python package. The CLI guide lists several ways to get it:

pip install -U "huggingface_hub"

Or, without installing anything permanently, run it through uvx (part of the uv tool): uvx hf download .... Homebrew is also supported. Run hf --help to see every command.

Download a whole model

hf download HuggingFaceH4/zephyr-7b-beta

By default, files go into a shared cache and the command prints where they ended up. The cache guide says the default location is ~/.cache/huggingface/hub. You can move it with the HF_HOME or HF_HUB_CACHE environment variable, which helps if your system drive is small.

Download only what you need

Many repositories hold several versions of the same model. Downloading everything can waste tens of gigabytes. The CLI gives you three ways to be selective:

Download into a normal folder

If a tool such as llama.cpp or LM Studio expects files in a specific folder, use --local-dir:

hf download adept/fuyu-8b model-00001-of-00002.safetensors --local-dir fuyu

The docs say this creates a small .cache/huggingface/ folder inside that directory with metadata, so a later run only fetches files that changed. Our llama.cpp guide shows how to load a GGUF from disk.

Shortcut: run a Hugging Face GGUF straight from Ollama

If you use Ollama, you may not need the CLI at all. Hugging Face's Ollama page explains that any public GGUF repository can be run directly:

ollama run hf.co/{username}/{repository}

The docs say Ollama picks the Q4_K_M quantization when the repository has one, and otherwise a reasonable alternative. Add a tag to choose another, in the form hf.co/{username}/{repository}:{quantization}. New to Ollama? Start with our Ollama beginner walkthrough.

Gated models: request access first

Some model authors turn on access requests. Hugging Face calls these gated models. To use one:

  1. Sign in to a Hugging Face account in your browser. The docs say requests can only be made there.
  2. Open the model page and submit the request. This shares your username and email address with the authors, unless they opted out of collecting it, plus any extra fields they ask for.
  3. Wait for approval, which may be automatic or manual.
  4. Sign the CLI in with hf auth login, which stores an access token on your computer. Treat that token like a password.

Gating is separate from the license. Read the model's license before you use it for work. Our guide to open-weight model licenses covers the common ones.

Keep the cache under control

Model files add up fast. The cache guide covers these commands:

Sources

← All Local AI guides · All guides