back to home

huggingface / smol-course

A course on aligning smol models.

6,583 stars
2,296 forks
87 issues
Jupyter NotebookPythonMDX

AI Architecture Analysis

This repository is indexed by RepoMind. By analyzing huggingface/smol-course in our AI interface, you can instantly generate complete architecture diagrams, visualize control flows, and perform automated security audits across the entire codebase.

Our Agentic Context Augmented Generation (Agentic CAG) engine loads full source files into context, avoiding the fragmentation of traditional RAG systems. Ask questions about the architecture, dependencies, or specific features to see it in action.

Embed this Badge

Showcase RepoMind's analysis directly in your repository's README.

[![Analyzed by RepoMind](https://img.shields.io/badge/Analyzed%20by-RepoMind-4F46E5?style=for-the-badge)](https://repomind-ai.vercel.app/repo/huggingface/smol-course)
Preview:Analyzed by RepoMind

Repository Summary (README)

Preview

smolcourse image

a smol course

This is a practical course on aligning language models for your specific use case. It's a handy way to get started with aligning language models, because everything runs on most local machines. There are minimal GPU requirements and no paid services. The course is built around the SmolLM3 and SmolVLM2 models, but the skills you'll learn can be applied to larger models or other small LLMs/VLMs as well.

<div style="background: linear-gradient(to right, #e0f7fa, #e1bee7, orange); padding: 20px; border-radius: 5px; margin-bottom: 20px; color: purple;"> <h2>smol course v2 is live!</h2> <p>This course is open and peer reviewed. To get involved with the course <strong>open a pull request</strong> and submit your work for review. Here are the steps:</p> <ol> <li>Follow the <a href="https://huggingface.co/smol-course">Hugging Face Hub org</a></li> <li>Read the material, make changes, do the exercises, add your own examples.</li> <li>Submit a model to the leaderboard</li> <li>Climb the leaderboard</li> </ol> <p>This should help you learn and to build a community-driven course that is always improving.</p> </div> <a href="http://hf.co/join/discord"> <img src="https://img.shields.io/badge/Discord-7289DA?&logo=discord&logoColor=white"/> </a>

Future of this course

This course will soon be re-released on Hugging Face Learn! Stay tuned for updates.

Course Outline

This course provides a practical, hands-on approach to working with small language models, from initial training through to production deployment.

#TopicDescriptionReleased
1Instruction TuningSupervised fine-tuning, chat templates, instruction following
2EvaluationBenchmarks and custom domain evaluation
3Preference AlignmentAligning models to human preferences with algorithms like DPO.
4Vision Language ModelsAdapt and use multimodal models
5Reinforcement LearningOptimizing models with based on reinforcement policies.October 2025
6Synthetic DataGenerate synthetic datasets for custom domainsNovember 2025
7Award CeremonyShowcase projects and celebrateDecember 2025

Why Small Language Models?

While large language models have shown impressive capabilities, they often require significant computational resources and can be overkill for focused applications. Small language models offer several advantages for domain-specific applications:

  • Efficiency: Require significantly less computational resources to train and deploy
  • Customization: Easier to fine-tune and adapt to specific domains
  • Control: Better understanding and control of model behavior
  • Cost: Lower operational costs for training and inference
  • Privacy: Can be run locally without sending data to external APIs
  • Green Technology: Advocates efficient usage of resources with reduced carbon footprint
  • Easier Academic Research Development: Provides an easy starter for academic research with cutting-edge LLMs with less logistical constraints

Prerequisites

Before starting, ensure you have the following:

  • Basic understanding of machine learning and natural language processing.
  • Familiarity with Python, PyTorch, and the transformers library.
  • Access to a pre-trained language model and a labeled dataset.

v1 of the course

The first version of the course used GithHub markdown and Jupyter notebooks. You can find it in the v1 directory.