Principles and Practices of Engineering Artificially Intelligent Systems
The open-source textbook that teaches you to build real-world AI systems β from edge devices to cloud deployment. Started as a Harvard University course (CS249r) 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.
"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. It's like everyone can write an app, but few know how to build the smartphone that runs it. 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. Richard Sutton's "The Bitter Lesson" taught us that general methods leveraging computation ultimately triumph over human-crafted approaches. The same principle applies here: the future belongs to those who can engineer the systems that unlock AI's computational potential. We're at an inflection point where we need an entirely new discipline - AI Engineering - focused not just on training models, but on the full systems stack that makes AI work in the real world. This book is my attempt to establish that foundation. We can't make this transformation happen overnight, but it has to start somewhere."
β Vijay
- π Read online β continuously updated version
- π Download PDF β for offline access
- π Explore the ecosystem β complete learning experience with labs & frameworks
- π Course materials & labs β hands-on learning resources
- π Instructor resources β teaching guides and materials
- π€ How to contribute β detailed guidelines
- β‘ Quick setup β get started in minutes
We go beyond training models β this book teaches you to understand and build the full stack of real-world ML systems.
Core Topics:
- ML system design & architecture β building scalable, maintainable systems
- Data pipelines & engineering β collection, labeling, and processing at scale
- Model optimization & deployment β from prototypes to production
- MLOps & monitoring β keeping systems running reliably
- Edge AI & resource constraints β deploying on mobile, embedded, and IoT devices
# View the book online
open https://mlsysbook.ai
# Clone and setup
git clone https://github.com/harvard-edge/cs249r_book.git
cd cs249r_book
make setup-hooks # Setup automated quality controls
make install # Install dependencies
# Daily development
make clean build # Clean and build
make preview # Start development server
We welcome contributions from students, educators, researchers, and practitioners worldwide.
- π Content: Suggest edits, improvements, or new examples
- π οΈ Tools: Enhance development scripts and automation
- π¨ Design: Improve figures, diagrams, and visual elements
- π Localization: Translate or adapt content for local needs
- π§ Infrastructure: Help with build systems and deployment
- Read: contribute.md for detailed guidelines
- Setup: Follow the development workflow above
- Explore: Check existing GitHub Issues
- Connect: Join GitHub Discussions
All contributions go through automated quality checks:
- β Pre-commit validation: Automatic cleanup and checks
- π Content review: Formatting and style validation
- π§ͺ Testing: Automated build and link verification
- π₯ Peer review: Community and maintainer feedback
Show this matters: If you find this valuable, please star this repository β β it signals to institutions and funding bodies that open AI education matters.
Fund the mission: Help us expand AI systems education globally. You can sponsor TinyML kits for students in developing countries, fund learning materials, support workshops, or sustain our open-source infrastructure.
From $15/month to sponsor a learner, to $250 for a hands-on workshop β every contribution democratizes AI systems education worldwide.
- π mlsysbook.org β main site and learning platform
- π₯ TinyTorch β educational ML framework
- πΈ Open Collective β support this initiative
- π§ GitHub Discussions β ask questions or share insights
- π± Community β join our global learning community
π οΈ Development Workflow & Technical Details
This project features a modern, automated development workflow with quality controls and organized tooling.
# Building
make build # Build HTML version
make build-pdf # Build PDF version
make preview # Start development server
# Quality Control
make clean # Clean build artifacts
make test # Run validation tests
make lint # Check for issues
make check # Project health check
# Get help
make help # Show all commands
- π§Ή Pre-commit hooks: Automatically clean build artifacts before commits
- π Linting: Check for formatting and content issues
- β Validation: Verify project structure and dependencies
- π Testing: Automated tests for content and scripts
- ποΈ Organized Structure: Professional script organization with clear categories
Our development tools are organized into logical categories:
tools/scripts/
βββ build/ # Build and development scripts
βββ content/ # Content management tools
βββ maintenance/ # System maintenance scripts
βββ testing/ # Test and validation scripts
βββ utilities/ # General utility scripts
βββ docs/ # Comprehensive documentation
Each category includes focused tools with clear naming and documentation. See tools/scripts/README.md
for details.
- π DEVELOPMENT.md β Comprehensive development guide
- π οΈ MAINTENANCE_GUIDE.md β Daily workflow and maintenance tasks
- π¨ BUILD.md β Detailed build instructions
- ποΈ tools/scripts/ β Development tools documentation
- π€ contribute.md β Contribution guidelines
- Quarto (latest version)
- Python 3.8+ with pip
- Git
# Clone the repository
git clone https://github.com/harvard-edge/cs249r_book.git
cd cs249r_book
# Setup development environment
make setup-hooks # Configure git hooks
make install # Install dependencies
# Build and preview (runs from book/ directory)
make clean build # Clean and build HTML
make preview # Start development server
# Full development setup
make clean-deep # Deep clean
make install # Install all dependencies
make build-all # Build all formats (HTML, PDF, EPUB)
# Continuous development
make preview # Auto-reload development server
make test # Run validation tests
make lint # Check content quality
See DEVELOPMENT.md for the complete development guide.
MLSysBook/
βββ book/ # Main book content (Quarto)
β βββ contents/ # Chapter content
β β βββ core/ # Core chapters
β β βββ labs/ # Hands-on labs
β β βββ frontmatter/ # Preface, acknowledgments
β β βββ parts/ # Book parts and sections
β βββ _quarto.yml # Book configuration
β βββ index.qmd # Main entry point
β βββ assets/ # Images, styles, media
βββ tools/ # Development automation
β βββ scripts/ # Organized development scripts
β β βββ build/ # Build and development tools
β β βββ content/ # Content management tools
β β βββ maintenance/ # System maintenance scripts
β β βββ testing/ # Test and validation scripts
β β βββ utilities/ # General utility scripts
β β βββ docs/ # Script documentation
β βββ dependencies/ # Package requirements
β βββ setup/ # Setup and configuration
βββ config/ # Build configuration
β βββ _extensions/ # Quarto extensions
β βββ lua/ # Lua scripts
β βββ tex/ # LaTeX templates
βββ assets/ # Global assets (covers, icons)
βββ DEVELOPMENT.md # Development guide
βββ MAINTENANCE_GUIDE.md # Daily workflow guide
βββ Makefile # Development commands
βββ README.md # This file
- π Modern Development Workflow: Automated builds, quality checks, and deployment
- ποΈ Organized Tooling: Professional script organization with comprehensive documentation
- π§ Easy Contribution: One-command setup with automated quality controls
- π Comprehensive Docs: Detailed guides for development, building, and contribution
- π Multi-format Output: HTML, PDF, and EPUB with consistent styling
- β‘ Fast Iteration: Live preview server with automatic reloading
- β Quality Assurance: Automated testing, linting, and validation
- π Clean Architecture: Well-organized project structure with clear separation of concerns
- π οΈ Professional Tooling: Category-based script organization for easy maintenance
π Project Information
@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},
note = {Available at: https://mlsysbook.org}
}
This work is licensed under a Creative Commons AttributionβNonCommercialβShareAlike 4.0 International License (CC BY-NC-SA 4.0)
You may share and adapt the material for non-commercial purposes, with appropriate credit and under the same license.