Skip to content

LearnCourses

Hugging Face

Hugging Face LLM Course

Work with transformer models, datasets and tokenizers on the Hugging Face Hub, for developers with good Python.

Taught by Abubakar Abid, Ben Burtenshaw and 2 more at Hugging FaceFreeCertificateVerified

From Setup to Build Reasoning Models
13 chapters
Open-source Python framework for ML demo UIs
Gradio
Before you startGood knowledge of Python; best taken after an intro deep learning course; no PyTorch or TensorFlow needed.
Intermediate level
Each chapter is planned as one week at 6 to 8 hours
Self-paced
Hugging Face LLM CourseFreeOpen the course

What you’ll learn

  • Learn how Transformer models and LLMs work, and when to use encoder, decoder or encoder-decoder models.
  • Use pretrained models from the Hugging Face Hub, fine-tune them on a dataset and share the results.
  • Use the Datasets and Tokenizers libraries and solve classic NLP tasks.
  • Build and share demos of your models with Gradio, and curate datasets with Argilla.
  • Fine-tune LLMs with supervised fine-tuning and LoRA, and build reasoning models with GRPO.

Skills you’ll gain

PythonFine-tuningLLMsTokenizersDeep Learning

Tools you'll learn

Details to know

  • Certificate of completionFree, for chapter 1 only
  • Assessments10 quizzes and 2 exercises
  • Taught in English8 languages available
  • VerifiedOct 2026

Lessons

Each chapter is planned as one week at 6 to 8 hours

A free Hugging Face course on large language models and language processing, built around its open-source libraries: Transformers, Datasets, Tokenizers and Accelerate, plus the Hugging Face Hub. It runs from how Transformer models work to fine-tuning LLMs and training reasoning models.

Each section links its code to Google Colab or Amazon SageMaker Studio Lab, and most chapters end with a quiz. The page plans each chapter as a week of work at 6 to 8 hours, though you can take as long as you need.

Here is what the chapters cover:

  • Setup, Transformer models: Set up Colab or a Python environment, then see what Transformers do and how they are built.
  • Using Transformers: Load models and tokenizers yourself and turn raw text into predictions, in batches.
  • Fine-tuning a pretrained model: Prepare a dataset and fine-tune BERT with the Trainer API and with your own training loop.
  • Sharing models and tokenizers: Use pretrained models from the Hub, upload your own and write a model card.
  • The Datasets library, The Tokenizers library: Load and reshape large datasets, build semantic search, and train tokenizers with BPE, WordPiece or Unigram.
  • Classical NLP tasks, How to ask for help: Train models for tagging, translation, summarization and question answering, then learn to debug and report issues.
  • Building and sharing demos, Curate high-quality datasets: Build Gradio demos for your models and label data in Argilla.
  • Fine-tune Large Language Models, Build Reasoning Models: Fine-tune LLMs with chat templates, SFT and LoRA, then train a reasoning model with GRPO.

Applied learning project

You learn by running the code yourself, and the later chapters add exams and longer exercises.

  • Code for every section: Open each section's notebook in Google Colab or Amazon SageMaker Studio Lab and run it as you read.
  • Quizzes and exams: Answer end-of-chapter quizzes, sit the chapter 1 certification exam and take chapter 11's multiple-choice and code quizzes.
  • Your own fine-tuned model: After chapter 4, fine-tune a model on a text classification problem you pick and upload it to the Hub.
  • GRPO exercises: Fine-tune a model with GRPO in TRL, then repeat it with Unsloth in Colab.

By the end you can fine-tune, share and demo Transformer models, and adapt LLMs with SFT, LoRA and GRPO.

SetupChapter 1 • 1 lessonChapter details

What you’ll learn

  • Set up a Google Colab notebook or a Python virtual environment for the course code.
  • Install the Transformers library and create a Hugging Face account.

Lesson

  1. 1.1Introduction
Transformer modelsChapter 2 • 11 lessonsChapter details

What you’ll learn

  • Use the pipeline() function for tasks like classification, generation, translation and summarization.
  • Learn how attention and transfer learning work inside Transformer models.
  • Choose between encoder, decoder and encoder-decoder models for a given task.
  • Look at how LLMs generate text at inference time and where bias and limits show up.

Lessons

  1. 2.1Introduction
  2. 2.2Natural Language Processing and Large Language Models
  3. 2.3Transformers, what can they do?
  4. 2.4How do Transformers work?
  5. 2.5How Transformers solve tasks
  6. 2.6Transformer Architectures
  7. 2.7Quick quiz
  8. 2.8Inference with LLMs
  9. 2.9Bias and limitations
  10. 2.10Summary
  11. 2.11Certification exam
Using TransformersChapter 3 • 9 lessonsChapter details

What you’ll learn

  • Rebuild the pipeline() function by hand with a tokenizer and a model.
  • Load and save models, and turn text into input IDs and back again.
  • Batch several sentences together with padding and attention masks.
  • Compare TGI, vLLM and llama.cpp for serving LLMs in production.

Lessons

  1. 3.1Introduction
  2. 3.2Behind the pipeline
  3. 3.3Models
  4. 3.4Tokenizers
  5. 3.5Handling multiple sequences
  6. 3.6Putting it all together
  7. 3.7Basic usage completed!
  8. 3.8Optimized Inference Deployment
  9. 3.9End-of-chapter quiz
Fine-tuning a pretrained modelChapter 4 • 7 lessonsChapter details

What you’ll learn

  • Load a dataset from the Hub and prepare it with dynamic padding and data collators.
  • Fine-tune a BERT model for text classification with the Trainer API.
  • Write your own PyTorch training loop and spread it across several GPUs with Accelerate.
  • Read learning curves to spot problems during training.

Lessons

  1. 4.1Introduction
  2. 4.2Processing the data
  3. 4.3Fine-tuning a model with the Trainer API
  4. 4.4A full training loop
  5. 4.5Understanding Learning Curves
  6. 4.6Fine-tuning, Check!
  7. 4.7End-of-chapter quiz
Sharing models and tokenizersChapter 5 • 6 lessonsChapter details

What you’ll learn

  • Find and load pretrained models from the Hugging Face Hub.
  • Upload your own models and tokenizers to the Hub.
  • Write a model card covering intended uses, limits, bias and training data.

Lessons

  1. 5.1The Hugging Face Hub
  2. 5.2Using pretrained models
  3. 5.3Sharing pretrained models
  4. 5.4Building a model card
  5. 5.5Part 1 completed!
  6. 5.6End-of-chapter quiz
The Datasets libraryChapter 6 • 8 lessonsChapter details

What you’ll learn

  • Load datasets from your laptop or a remote server, not just the Hub.
  • Clean and reshape data with map() and filter(), and switch to Pandas when it helps.
  • Handle datasets too big for memory, then build and share one of your own.
  • Build a semantic search engine with embeddings and FAISS.

Lessons

  1. 6.1Introduction
  2. 6.2What if my dataset isn't on the Hub?
  3. 6.3Time to slice and dice
  4. 6.4Big data? Datasets to the rescue!
  5. 6.5Creating your own dataset
  6. 6.6Semantic search with FAISS
  7. 6.7Datasets, check!
  8. 6.8End-of-chapter quiz
The Tokenizers libraryChapter 7 • 11 lessonsChapter details

What you’ll learn

  • Train a new tokenizer on your own text, using an existing one as a template.
  • Use offsets in fast tokenizers to map tokens back to the original text.
  • Compare BPE, WordPiece and Unigram, then build a tokenizer piece by piece.

Lessons

  1. 7.1Introduction
  2. 7.2Training a new tokenizer from an old one
  3. 7.3Fast tokenizers' special powers
  4. 7.4Fast tokenizers in the QA pipeline
  5. 7.5Normalization and pre-tokenization
  6. 7.6Byte-Pair Encoding tokenization
  7. 7.7WordPiece tokenization
  8. 7.8Unigram tokenization
  9. 7.9Building a tokenizer, block by block
  10. 7.10Tokenizers, check!
  11. 7.11End-of-chapter quiz
Classical NLP tasksChapter 8 • 9 lessonsChapter details

What you’ll learn

  • Train models for token classification, translation, summarization and question answering.
  • Fine-tune a masked language model and train a causal language model from scratch.
  • Learn what metrics like ROUGE and BLEU can and cannot tell you.

Lessons

  1. 8.1Introduction
  2. 8.2Token classification
  3. 8.3Fine-tuning a masked language model
  4. 8.4Translation
  5. 8.5Summarization
  6. 8.6Training a causal language model from scratch
  7. 8.7Question answering
  8. 8.8Mastering LLMs
  9. 8.9End-of-chapter quiz
How to ask for helpChapter 9 • 7 lessonsChapter details

What you’ll learn

  • Read error messages and track down the cause when your code fails.
  • Debug a training pipeline step by step.
  • Ask clear questions on the forums and write useful bug reports.

Lessons

  1. 9.1Introduction
  2. 9.2What to do when you get an error
  3. 9.3Asking for help on the forums
  4. 9.4Debugging the training pipeline
  5. 9.5How to write a good issue
  6. 9.6Part 2 completed!
  7. 9.7End-of-chapter quiz
Building and sharing demosChapter 10 • 9 lessonsChapter details

What you’ll learn

  • Build a web demo for a model in a few lines of Python with Gradio.
  • Share demos through temporary links or host them on Hugging Face Spaces.
  • Add state and authentication, and control the layout with Gradio Blocks.

Lessons

  1. 10.1Introduction to Gradio
  2. 10.2Building your first demo
  3. 10.3Understanding the Interface class
  4. 10.4Sharing demos with others
  5. 10.5Integrations with the Hugging Face Hub
  6. 10.6Advanced Interface features
  7. 10.7Introduction to Blocks
  8. 10.8Gradio, check!
  9. 10.9End-of-chapter quiz
Curate high-quality datasetsChapter 11 • 7 lessonsChapter details

What you’ll learn

  • Set up an Argilla instance and load a dataset for a common NLP task.
  • Label and review data in the Argilla interface to raise its quality.
  • Export the annotated dataset and share it on the Hub.

Lessons

  1. 11.1Introduction to Argilla
  2. 11.2Set up your Argilla instance
  3. 11.3Load your dataset to Argilla
  4. 11.4Annotate your dataset
  5. 11.5Use your annotated dataset
  6. 11.6Argilla, check!
  7. 11.7End-of-chapter quiz
Fine-tune Large Language ModelsChapter 12 • 7 lessonsChapter details

What you’ll learn

  • Format conversations with chat templates, system prompts and roles.
  • Run supervised fine-tuning with SFTTrainer from TRL.
  • Cut memory needs with LoRA, then measure the results with evaluation.
  • Take the chapter exam, with a multiple-choice quiz and a code quiz.

Lessons

  1. 12.1Introduction
  2. 12.2Chat Templates
  3. 12.3Fine-Tuning with SFTTrainer
  4. 12.4LoRA (Low-Rank Adaptation)
  5. 12.5Evaluation
  6. 12.6Conclusion
  7. 12.7Exam Time!
Build Reasoning ModelsChapter 13 • 7 lessonsChapter details

What you’ll learn

  • Learn how reinforcement learning is used to train LLMs to reason.
  • Walk through the DeepSeek R1 paper and the GRPO method behind it.
  • Train a model with GRPO in TRL, then again with Unsloth.

Lessons

  1. 13.1Introduction
  2. 13.2Reinforcement Learning on LLMs
  3. 13.3The Aha Moment in the DeepSeek R1 Paper
  4. 13.4Advanced Understanding of GRPO in DeepSeekMath
  5. 13.5Implementing GRPO in TRL
  6. 13.6Practical Exercise to Fine-tune a model with GRPO
  7. 13.7Practical Exercise with Unsloth
Earn a certificateNo extra cost: a certificate for chapter 1 from its certification exam; the course FAQ says there is no certificate for the whole course.

FAQs

Is Hugging Face LLM Course free?

Yes. The course is free.

Open the course

Do I get a certificate?

Yes. No extra cost: a certificate for chapter 1 from its certification exam; the course FAQ says there is no certificate for the whole course.

What do I need before I start?

Good knowledge of Python; best taken after an intro deep learning course; no PyTorch or TensorFlow needed.

How long is it?

Each chapter is planned as one week at 6 to 8 hours; you take it at your own pace.

See the lessons

Which tools does it teach?

Gradio: Open-source Python framework for ML demo UIs.

See the tools

Who makes it?

Taught by Abubakar Abid, Ben Burtenshaw, Matthew Carrigan and Lysandre Debut at Hugging Face. Recaply lists 2 courses from Hugging Face.

See Hugging Face's courses

More courses

See all
Freeon huggingface.coOpen the course