The Hub is a web platform for hosting and discovering machine learning models, datasets, and interactive applications, backed by open-source Python libraries like `transformers` and `datasets`. Learn to navigate repositories, understand metadata and model cards, create Spaces, and collaborate with the ML community.
Hugging Face is an AI company and open-source community that has built one of the most widely used ecosystems for machine learning (ML). At its centre is the Hugging Face Hub — a web-based platform where researchers, engineers, and hobbyists can host, discover, and share three core types of ML artifacts: models, datasets, and Spaces (interactive applications). Think of it as a GitHub for machine learning, but purpose-built for the unique needs of the field: storing large binary files, running model inference, previewing datasets, and launching live demos.
Beyond the Hub itself, Hugging Face maintains a suite of open-source Python libraries — most notably transformers, datasets, tokenizers, diffusers, and huggingface_hub — that make it straightforward to download and use artifacts from the Hub in your own code. The platform and the libraries reinforce each other: artifacts on the Hub are designed to be consumed directly by the libraries, and the libraries make it trivial to push your own work back to the Hub.
Training large ML models from scratch is expensive and time-consuming. A researcher who has already trained a state-of-the-art language model should be able to share it so that others can reuse it rather than rediscovering the same result independently. Hugging Face solves a concrete logistical problem: how do you store a 10 GB model file, version it, document it, and let anyone download or run it with a single line of code?
Before platforms like the Hub, sharing models meant uploading weight files to personal servers or Google Drive links buried in README files — fragile, undiscoverable, and impossible to version. The Hub gives every artifact a persistent URL, a structured metadata card, version control via Git and Git LFS (Large File Storage), and an optional browser-based inference widget so you can try the model without writing any code.
The three core artifact types hosted on the Hugging Face Hub, each with its own storage, metadata, and browsing interface.
A model repository on the Hub stores the weight files, configuration files, and tokenizer files needed to load a trained neural network. Each repository is a Git repository under the hood, with large binary files managed via Git LFS. Every model should have a model card — a README.md file that documents what the model does, how it was trained, its intended uses, limitations, and evaluation results. Model cards are the primary mechanism for transparency and reproducibility.
Models on the Hub span nearly every ML task: text classification, translation, image generation, speech recognition, code generation, and more. You can filter by task, framework (PyTorch, TensorFlow, JAX), language, and licence.
A dataset repository stores raw data files (CSV, Parquet, JSON, audio, image archives, etc.) along with a dataset card that describes the data's provenance, structure, intended uses, and any known biases. The Hub's built-in dataset viewer lets you browse rows of tabular data or preview images and audio directly in the browser — no download required.
The datasets Python library can stream or download any Hub dataset in a single function call:
from datasets import load_dataset
ds = load_dataset("imdb")
Spaces are hosted web applications that typically demonstrate a model or dataset. They run on Hugging Face's infrastructure and are built with frameworks like Gradio or Streamlit. A Space lets a researcher ship an interactive demo of their model without managing servers. Users can fork a Space, modify it, and redeploy it — making Spaces a collaborative playground for applied ML.
The Hub is the distribution layer; the libraries are the consumption layer. The key libraries are:
| Library | Purpose |
|---|---|
transformers | Load and run pre-trained models for NLP, vision, audio, and multimodal tasks |
datasets | Download, stream, and process datasets from the Hub |
tokenizers | Fast, Rust-backed tokenization used by transformers |
diffusers | Diffusion models for image and audio generation |
huggingface_hub | Python client for interacting with the Hub API (uploading, downloading, searching) |
These libraries follow a consistent design principle: a repository ID of the form username/repository-name is all you need to identify and load any artifact. For example:
from transformers import pipeline
classifier = pipeline("sentiment-analysis", model="distilbert-base-uncased-finetuned-sst-2-english")
This single call downloads the model weights, configuration, and tokenizer from the Hub, caches them locally, and returns a ready-to-use inference object.
The Hub supports both personal accounts and organisations — shared namespaces where teams can collaborate on repositories. Repositories can be public (free, open to anyone), private (visible only to authorised users), or gated (publicly visible but requiring a request to access, commonly used for datasets with legal constraints or powerful models requiring an agreement).
The community layer includes likes, comments on model/dataset cards, and a Discussions tab on every repository — a lightweight issue tracker where users can report bugs, ask questions, or propose changes. This social layer is what makes the Hub feel like a community rather than just a file server.
A typical workflow on the Hub looks like this:
transformers, datasets, etc.).This cycle — discover, reuse, improve, share — is the core loop that Hugging Face is designed to accelerate. The platform lowers the barrier to entry for newcomers (pre-trained models are immediately usable) while giving experts a structured way to share their contributions with the broader community.
This course focuses on the Hub itself — how repositories are structured, how metadata works, how to navigate and use models and datasets, how Spaces function, and how the Hub's access-control and collaboration features work. The individual libraries (transformers, datasets, etc.) are introduced where they illuminate how Hub artifacts are consumed, but their internal mechanics are treated as separate topics.