Skip to content
AI Engineering
The Tooling Landscape

Hugging Face: the hub for open AI

Hugging Face is where open models, datasets and demos live, plus the libraries to use them.

Chapter 12: The Tooling LandscapeLesson 4 of 4Level: CoreAbout 12 min
Words on this page (17)
Hugging Face
: A hub for sharing open models, datasets and demos, and the maker of widely used libraries.
git
: The standard tool for tracking changes to code.
repo
: Repository: a project folder tracked by git, usually hosted on GitHub.
LoRA
: A cheap fine-tuning method that freezes the model and learns small add-on matrices. QLoRA also stores the base in 4-bit.
inference
: Running a trained model to produce output, as opposed to training it.
embedding
: A list of numbers that represents the meaning of a piece of text or an image, so similar things sit close together.
speech recognition
: Turning spoken audio into text.
LLM
: Large language model: a neural network trained on huge amounts of text to predict the next token.
agent
: A model run in a loop that chooses its own tools and steps until the task is done.
MCP
: Model Context Protocol: a standard for plugging tools and data into AI apps.
reinforcement learning
: Learning by trial and error: take actions, get rewards, and favor what earned reward.
diffusion model
: An image generator trained to remove noise step by step. Generation starts from pure noise.
weights
: The learned numbers that define a trained model. A model whose weights are published is called open-weight.
tokenizer
: The program that splits text into tokens and maps each one to an integer id.
parameter
: One learned number inside a model. Modern models have billions of them. Training adjusts them.
quantization
: Storing weights with fewer bits (for example 4 instead of 16) to save memory at a small quality cost.
training
: Adjusting a model's parameters on data so its predictions improve.

What is there

is the place where open AI is shared. It has four main parts.

The Hub hosts well over a million models and many datasets. Each one is a with a model card that describes how it was trained, what it is bad at and what license it has.

Spaces host small demo apps, so you can try a model in your browser before downloading it.

Libraries do the work. Transformers loads and runs thousands of models in a few lines of code. PEFT fine-tunes cheaply with . TRL trains with rewards. Transformers.js runs models inside a web browser.

Providers and Endpoints run models for you if you do not want to host them.

How to use it

Filter the Hub by task (text generation, , ), by size and by license. Read the model card. Try the model in its Space. Then either download it and run it locally, or call it through a provider.

A worked example: reading a model card

You find a speech-to-text model. The card says: task, speech recognition. Size, 1.5 GB. Languages, 12. License, check whether commercial use is allowed. Known limits, weaker with heavy accents. Example code, ten lines. Five minutes with the card tells you whether it fits your project and saves you from expensive surprises.

Free learning

Hugging Face runs free hands-on courses on , , , deep and models. They all use the libraries above.

How a model gets from the Hub to your laptop

A model repository holds files, a config file describing the architecture and the files. When you load it, the library downloads these into a local cache folder (a saved copy on disk), builds the model from the config and fills it with the weights. The first run is slow. Later runs reuse the cache.

Will it fit? A memory check

Weights take memory equal to times bytes per parameter. Invented 7 billion parameter model at 16 bits (2 bytes each): 7 billion x 2 = 14 billion bytes, about 14 GB. to 4 bits (half a byte each), it is about 3.5 GB. Real use needs extra memory beyond the weights, so leave headroom.

A second example: a model that does not fit

A 70 billion parameter model needs about 140 GB at 16 bits and about 35 GB at 4 bits. A typical 16 GB laptop cannot hold either. Your options are a smaller model, an inference provider that hosts it, or a machine with more memory.

What goes wrong

An out-of-memory error: the model is larger than your memory. Compare file size on the Hub with your free memory.

A repository asks you to allow custom code when loading. That code runs on your machine, so read it first and trust only authors you can check. Prefer weights in the safetensors format, which stores numbers only and cannot run code on load. Older formats can.

The model works but answers poorly in your language or task. The model card lists its languages and limits. Test on your own examples.

The license forbids your use. Read it before you build on the model.

Try it yourself

Search the Hub for a small sentiment model. Read its card and write down task, size, license and one stated limit. Try it in its Space with three sentences, one sarcastic. Expect the plain ones to work and the sarcastic one to be the likeliest mistake.

Common mistake

Downloading a model without reading its license.

Check yourself

What does a model card tell you?

What does Transformers.js do?

You find a promising model but its license is unclear. What should you do?

Go deeper

  • Tool

    Hugging Face · Models, datasets and Spaces.

  • Course

    Hugging Face · Tokenizers, fine-tuning and the Transformers library.

  • Repo
    TransformersRepo★ 168k

    Hugging Face · The core library for open models.

  • Repo
    Transformers.jsRepo★ 16k

    Hugging Face · Run models in the browser.

  • Docs

    Hugging Face · Repositories, model cards and the Hub API.

  • Docs

    Hugging Face · Run models in a browser or Node.

  • Docs

    Hugging Face · Calling hosted models from Python.

Spotted a mistake or something unclear? Report it on GitHub.

On this page