Skip to content

harvard-edge/cs249r_book

Repository files navigation

Machine Learning Systems

Principles and Practices of Engineering Artificially Intelligent Systems

Build Last Commit

Website Ecosystem Citation

Funding License Powered by Netlify

📖 Read Online📄 Download PDF📓 Download EPUB🌐 Explore Ecosystem

📚 Hardcopy edition coming 2026 via MIT Press!


About This Book

The open-source textbook that teaches you to build real-world AI systems — from edge devices to cloud deployment. Originally developed as Harvard University's CS249r course by Prof. Vijay Janapa Reddi, now used by universities and students worldwide.

Our mission: Expand access to AI systems education worldwide — empowering learners, one chapter and one lab at a time.

Why This Book Exists

"This grew out of a concern that while students could train AI models, few understood how to build the systems that actually make them work. As AI becomes more capable and autonomous, the critical bottleneck won't be the algorithms - it will be the engineers who can build efficient, scalable, and sustainable systems that safely harness that intelligence."

— Vijay Janapa Reddi


What Makes This Book Special

This project isn’t just a book. It’s a living, evolving effort shaped by a growing community of learners, educators, and builders. Every pull request, note, and idea helps push the boundaries of what AI systems education can look like.

Whether you’re reading a chapter, building a lab, or contributing your first fix (to even a small typo), you’re part of a story that’s bigger than code. This is how we make AI systems' knowledge accessible to everyone.


Start Here

  1. Read Chapter 1 and the overview
  2. Skim the Benchmarking chapter to learn what to measure
  3. Pick a kit and run a lab
  4. Say hello in Introduce Yourself

• Benchmarking chapter: https://mlsysbook.ai/contents/core/benchmarking/benchmarking.html • Kits and lab setups: https://mlsysbook.ai/contents/labs/shared/kits.html • Introduce Yourself: https://github.com/harvard-edge/cs249r_book/discussions

📚 What You'll Learn

Go beyond training models — master the full stack of real-world ML systems.

Topic What You'll Build
System Design Scalable, maintainable ML architectures
Data Engineering Robust pipelines for collection, labeling, and processing
Model Deployment Production-ready systems from prototypes
MLOps & Monitoring Reliable, continuously operating systems
Edge AI Resource-efficient deployment on mobile, embedded, and IoT

⭐ Support This Work

Show Your Support

Star this repository to help us demonstrate the value of open AI education to funders and institutions.

Stars

Goal: 10,000 stars = $100,000 in additional education funding

⭐ Star Nowtakes 2 seconds!

Fund the Mission (New!)

We've graduated this project from Harvard to enable global access and expand AI systems education worldwide. Please help us support educators globally, especially in the Global South, by providing TinyML kits for students, funding workshops, and sustaining our open-source infrastructure.

Open Collective

From $15/month to sponsor a learner to $250 for workshops — every contribution democratizes AI education.


🌐 Community & Resources

Resource Description
📚 Main Site Complete learning platform
🔥 TinyTorch Educational ML framework
💬 Discussions Ask questions, share insights
👥 Community Join our global learning community

🎯 For Different Audiences

🎓 Students

👩‍🏫 Educators

🛠️ Contributors


🚀 Quick Start

For Readers

# Read online (continuously updated)
open https://mlsysbook.ai

# Download PDF for offline access
curl -O https://mlsysbook.ai/pdf

# Download EPUB for e-readers
curl -O https://mlsysbook.ai/epub

For Contributors

git clone https://github.com/harvard-edge/cs249r_book.git
cd cs249r_book

# Quick setup (recommended)
./binder setup                    # Setup environment and dependencies
./binder doctor                   # Check system health

# Fast development workflow
./binder preview intro            # Live preview with hot reload
./binder build intro              # Build specific chapter (HTML)
./binder html intro               # Build HTML for specific chapter
./binder pdf intro                # Build PDF for specific chapter
./binder epub intro               # Build EPUB for specific chapter

# Build complete book
./binder build                    # Build complete book (HTML)
./binder html                     # Build all chapters (HTML)
./binder pdf                      # Build complete book (PDF)
./binder epub                     # Build complete book (EPUB)

# Help and management
./binder help                     # See all commands
./binder list                     # List available chapters
./binder status                   # Show current status

🤝 Contributing

We welcome contributions from the global community! Here's how you can help:

Ways to Contribute

  • 📝 Content — Suggest edits, improvements, or new examples
  • 🛠️ Tools — Enhance development scripts and automation
  • 🎨 Design — Improve figures, diagrams, and visual elements
  • 🌍 Localization — Translate content for global accessibility
  • 🔧 Infrastructure — Help with build systems and deployment

If Something Confuses You

Open a short issue with the confusing sentence and a one-line suggestion. These reports help the most.

Quality Standards

All contributions benefit from automated quality assurance:

  • Pre-commit validation — Automatic cleanup and checks
  • 📋 Content review — Formatting and style validation
  • 🧪 Testing — Build and link verification
  • 👥 Peer review — Community feedback

Start Contributing →


🛠️ Development

Releases and Previews

The dev site is our preview build. The main site publishes on release.

Book Binder CLI (Recommended)

The Book Binder is our lightning-fast development CLI for streamlined building and iteration:

# Chapter development (fast iteration)
./binder preview intro                # Live preview with hot reload
./binder build intro                  # Build specific chapter (HTML)
./binder html intro                   # Build HTML for specific chapter
./binder pdf intro                    # Build PDF for specific chapter
./binder epub intro                   # Build EPUB for specific chapter

# Multiple chapters at once
./binder build intro,ml_systems       # Build multiple chapters (HTML)
./binder html intro,ops               # Build multiple chapters (HTML)

# Complete book building
./binder build                        # Build entire book (HTML)
./binder html                         # Build all chapters (HTML)
./binder pdf                          # Build complete PDF
./binder epub                         # Build complete EPUB

# Management
./binder clean                        # Clean artifacts
./binder switch pdf                   # Switch active config to PDF
./binder list                         # List available chapters
./binder status                       # Show current status
./binder doctor                       # Run health check
./binder setup                        # Setup environment
./binder hello                        # Welcome message
./binder about                        # Project information
./binder help                         # Show all commands

Development Commands

# Book Binder CLI (Recommended)
./binder setup                    # First-time setup
./binder build                    # Build complete HTML book
./binder html                     # Build all chapters (HTML)
./binder pdf                      # Build complete PDF book  
./binder epub                     # Build complete EPUB book
./binder preview intro            # Live preview chapter development
./binder build intro              # Build specific chapter
./binder doctor                   # Run health check
./binder clean                    # Clean build artifacts

# Traditional setup (if needed)
python3 -m venv .venv
source .venv/bin/activate
pip install -r tools/dependencies/requirements.txt
pre-commit install

Project Structure

MLSysBook/
├── binder                   # ⚡ Fast development CLI (recommended)
├── cli/                     # Modular CLI implementation
│   ├── commands/            # Command handlers (build, preview, clean, etc.)
│   ├── core/                # Core components (config, discovery)
│   ├── formats/             # Format-specific handling
│   ├── utils/               # CLI utilities
│   └── main.py              # CLI entry point
├── quarto/                  # Main book content (Quarto)
│   ├── contents/            # Chapter content
│   │   ├── core/            # Core chapters
│   │   ├── labs/            # Hands-on labs
│   │   ├── frontmatter/     # Preface, acknowledgments
│   │   ├── backmatter/      # References and resources
│   │   └── parts/           # Book parts and sections
│   ├── _extensions/         # Quarto extensions
│   ├── config/              # Build configurations
│   │   ├── _quarto-html.yml # Website build configuration
│   │   ├── _quarto-pdf.yml  # PDF build configuration
│   │   └── _quarto-epub.yml # EPUB build configuration
│   ├── data/                # Cross-reference and metadata files
│   ├── assets/              # Images, styles, media
│   ├── filters/             # Lua filters
│   ├── scripts/             # Build scripts
│   └── _quarto.yml          # Active config (symlink)
├── tools/                   # Development automation
│   ├── scripts/             # Organized development scripts
│   │   ├── content/         # Content management tools
│   │   ├── cross_refs/      # Cross-reference management
│   │   ├── glossary/        # Glossary management
│   │   ├── images/          # Image processing tools
│   │   ├── maintenance/     # System maintenance scripts
│   │   ├── testing/         # Test and validation scripts
│   │   └── utilities/       # General utility scripts
│   ├── dependencies/        # Package requirements  
│   └── setup/               # Setup and configuration
├── config/                  # Project configuration
│   ├── dev/                 # Development configurations
│   ├── linting/             # Code quality configurations
│   └── quarto/              # Quarto publishing settings
├── docs/                    # Documentation
│   ├── BINDER.md            # Binder CLI guide
│   ├── BUILD.md             # Build instructions
│   ├── DEVELOPMENT.md       # Development guide
│   ├── MAINTENANCE_GUIDE.md # Maintenance and troubleshooting
│   └── contribute.md        # Contribution guidelines
├── CHANGELOG.md             # Project changelog
├── CITATION.bib             # Citation information
├── pyproject.toml           # Python project configuration
└── README.md                # This file

Documentation

Publishing

Publishing is handled through GitHub Actions workflows for consistent, automated deployment:

# Build locally to test before publishing
./binder build        # Build HTML
./binder pdf          # Build PDF  
./binder epub         # Build EPUB

# Publishing happens via GitHub Actions
# Merge to main branch triggers automatic deployment
# See docs/PUBLISH_LIVE_WORKFLOW.md for details

Publishing Workflow:

  • Automated Deployment — GitHub Actions workflows handle all publishing
  • Quality Checks — Automated validation before deployment
  • Multiple Formats — HTML, PDF, and EPUB published simultaneously
  • Preview Deployments — Pull requests get automatic preview deployments
  • Branch Strategy — Develop on dev branch, merge to main for release

See Publishing Documentation for detailed instructions.

Getting Started

# First time setup
./binder setup

# Welcome and overview
./binder hello

# Check system health
./binder doctor

# List available chapters
./binder list

# Quick preview with hot reload
./binder preview intro

# Build a specific chapter
./binder build intro

📋 Citation & License

Citation

@inproceedings{reddi2024mlsysbook,
  title        = {MLSysBook.AI: Principles and Practices of Machine Learning Systems Engineering},
  author       = {Reddi, Vijay Janapa},
  booktitle    = {2024 International Conference on Hardware/Software Codesign and System Synthesis (CODES+ ISSS)},
  pages        = {41--42},
  year         = {2024},
  organization = {IEEE},
  url          = {https://mlsysbook.org}
}

License

This work is licensed under Creative Commons Attribution–NonCommercial–ShareAlike 4.0 International (CC BY-NC-SA 4.0). You may share and adapt the material for non-commercial purposes with appropriate credit.


🙏 Contributors

Thanks goes to these wonderful people who have contributed to making this resource better for everyone:

Vijay Janapa Reddi
Vijay Janapa Reddi

Zeljko Hrcek
Zeljko Hrcek

Marcelo Rovai
Marcelo Rovai

Jason Jabbour
Jason Jabbour

Ikechukwu Uchendu
Ikechukwu Uchendu

Kai Kleinbard
Kai Kleinbard

Naeem Khoshnevis
Naeem Khoshnevis

Sara Khosravi
Sara Khosravi

Jeffrey Ma
Jeffrey Ma

Douwe den Blanken
Douwe den Blanken

shanzehbatool
shanzehbatool

Elias
Elias

Jared Ping
Jared Ping

Itai Shapira
Itai Shapira

Maximilian Lam
Maximilian Lam

Jayson Lin
Jayson Lin

Sophia Cho
Sophia Cho

Andrea
Andrea

Alex Rodriguez
Alex Rodriguez

Korneel Van den Berghe
Korneel Van den Berghe

Colby Banbury
Colby Banbury

Zishen Wan
Zishen Wan

Mark Mazumder
Mark Mazumder

Divya Amirtharaj
Divya Amirtharaj

Srivatsan Krishnan
Srivatsan Krishnan

Abdulrahman Mahmoud
Abdulrahman Mahmoud

marin-llobet
marin-llobet

Aghyad Deeb
Aghyad Deeb

Haoran Qiu
Haoran Qiu

ELSuitorHarvard
ELSuitorHarvard

Aditi Raju
Aditi Raju

Jared Ni
Jared Ni

oishib
oishib

Thuong Duong
Thuong Duong

Emil Njor
Emil Njor

Michael Schnebly
Michael Schnebly

Yu-Shun Hsiao
Yu-Shun Hsiao

Jae-Won Chung
Jae-Won Chung

Henry Bae
Henry Bae

Andrew Bass
Andrew Bass

Marco Zennaro
Marco Zennaro

Shvetank Prakash
Shvetank Prakash

Matthew Stewart
Matthew Stewart

Emeka Ezike
Emeka Ezike

Pong Trairatvorakul
Pong Trairatvorakul

Arya Tschand
Arya Tschand

Eura Nofshin
Eura Nofshin

Eimhin Laverty
Eimhin Laverty

Jennifer Zhou
Jennifer Zhou

Alex Oesterling
Alex Oesterling

Bruno Scaglione
Bruno Scaglione

Allen-Kuang
Allen-Kuang

Fin Amin
Fin Amin

gnodipac886
gnodipac886

Fatima Shah
Fatima Shah

The Random DIY
The Random DIY

TheHiddenLayer
TheHiddenLayer

Gauri Jain
Gauri Jain

Sercan Aygün
Sercan Aygün

Tauno Erik
Tauno Erik

अरनव शुक्ला | Arnav Shukla
अरनव शुक्ला | Arnav Shukla

abigailswallow
abigailswallow

Abenezer Angamo
Abenezer Angamo

Baldassarre Cesarano
Baldassarre Cesarano

Yang Zhou
Yang Zhou

yanjingl
yanjingl

Jessica Quaye
Jessica Quaye

Jason Yik
Jason Yik

happyappledog
happyappledog

Aritra Ghosh
Aritra Ghosh

Cursor Agent
Cursor Agent

Bilge Acun
Bilge Acun

Andy Cheng
Andy Cheng

Emmanuel Rassou
Emmanuel Rassou

Vijay Edupuganti
Vijay Edupuganti

Sam Wilcock
Sam Wilcock

Shreya Johri
Shreya Johri

Sonia Murthy
Sonia Murthy

Costin-Andrei Oncescu
Costin-Andrei Oncescu

formlsysbookissue
formlsysbookissue

Annie Laurie Cook
Annie Laurie Cook

Jothi Ramaswamy
Jothi Ramaswamy

Batur Arslan
Batur Arslan

Curren Iyer
Curren Iyer

Fatima Shah
Fatima Shah

Edward Jin
Edward Jin

a-saraf
a-saraf

songhan
songhan

jvijay
jvijay

Zishen
Zishen


Made with ❤️ for AI learners worldwide

Our goal is to educate 1 million AI systems engineers for the future at the edge of AI.