Hugging Face getting started: five links to a first answer

By Christophe Paka · Facts checked on 7 November 2026

"I've been through probably 10 youtube tutorials ... and nothing works," a reader wrote on r/LocalLLM. Each video showed a piece, filmed on a computer where the other pieces already worked.

So the error you hit came from a step the video never showed, about a thing you had no name for.

Hugging Face getting started is a chain of five links: account, access token, install, pipeline, output. The figure below gives each link a check you can see, so a failure points at the link that caused it. This chain runs a model from your own Python code. To only chat with a model, Ollama or LM Studio need none of it.

Five links in order, account, token, install, pipeline() and output, each with a check: your avatar on the site, a token starting with hf_, a working import, progress bars then new text, and a second run with no download.
Figure 3.1: Five links, one order. When something breaks, name the link it broke on.
Use this diagram on your site

Free to share in your blog post, docs, course or slides, as long as the credit link stays. Paste the code below where the figure should go.

How to read this figure

  1. Link 1, the account. Create a free account on huggingface.co. It asks for an email address, never a card. The check is your picture at the top right of the site.

  2. Link 2, the access token. An access token is a long secret string that lets a program use your account without your password. Make one with the role Read on the tokens settings page. The check is a token that starts with hf_. Copy it at once, because the site shows it only once.

  3. Link 3, the install. Open a terminal: the text window where you type commands (Terminal on a Mac, PowerShell on Windows). Make a virtual environment, a private folder of Python packages for one project. Then pip, Python's installer, adds torch (PyTorch, the engine that does a model's math), then transformers. The check is import transformers working in the same window.

  4. Link 4, the pipeline. A pipeline is one Transformers function: name a task, name a model, get an answer. Four lines of Python run it, shown in the Try this below and in the pipeline box opened. Log in first with hf auth login. The check is progress bars while the model downloads, then a paragraph of new text.

  5. Link 5, the output. Run the same script again. The check is an answer in seconds with no download, because the first run saved the files in the cache folder on your disk.

  6. Read the band at the bottom. When something breaks, look at the last check that passed. The broken link is the next one. That is the whole debugging method, and it works for every tool you add later.

Key takeaways

  • Walk the five links in order and check each one before you move to the next.
  • Start every new tool with a small model that needs no approval, such as HuggingFaceTB/SmolLM2-360M-Instruct.
  • Give each machine its own read access token, and keep tokens out of code and screenshots.

Try this: walk the chain on your laptop

You need a laptop with Python, a terminal, about 2 GB of free disk space and about 30 minutes. No graphics card and no payment card.

  1. Make a clean environment with python3 -m venv hf-lab, then source hf-lab/bin/activate. Your prompt line now starts with (hf-lab).
  2. Install the engine, then the library: pip install torch, then pip install -U transformers.
  3. Log in with hf auth login, then check with hf auth whoami. It prints your user name.
  4. Save these four lines as first.py, in the folder your terminal is in: from transformers import pipeline then generator = pipeline("text-generation", model="HuggingFaceTB/SmolLM2-360M-Instruct") then result = generator("Reply to this customer politely: I was charged twice for my order.", max_new_tokens=60) then print(result[0]["generated_text"]).
  5. Run python first.py, then run it a second time.

Expected result: The first run downloads about 724 MB, then prints your prompt with new text after it. The second run answers far sooner, with no download. The words differ on every run; any reply means the chain works.

Questions readers ask

Why do I get a 401 error on some Hugging Face models but not others?

The model is gated: its maker approves each user. An access token alone never gets you past the approval form. Open the model's page, look for the access form and ask for access. Start with a model that needs no approval, so you know the chain works first.

Do I need a GPU to run my first Hugging Face model?

No. The small model in this chain runs on the ordinary processor of any recent laptop, and the account is free with no card. You need about 2 GB of free disk space: about 724 MB for the model, the rest for the software.

Why does the old Hugging Face command say command not found?

Older tutorials use huggingface-cli, but a major release of huggingface_hub removed it. Type hf instead: hf auth login, hf download and the rest. Your setup is fine; the tutorial is out of date.

Sources: Transformers quicktour (Hugging Face); User access tokens (Hugging Face); hf CLI reference (Hugging Face).

This figure is from Hugging Face Made Crystal Clear, chapter 3.

The chapter builds the idea step by step, with recipes you can follow, a Try it to check yourself, and every source.

Get the book

All diagrams