Voltar ao ranking

skyzh/tiny-llm

Pythonskyzh.github.io/tiny-llm/

A course of learning LLM inference serving on Apple Silicon for systems engineers: build a tiny vLLM + Qwen.

courselarge-language-modelllmpythonqwenqwen2servingvllm
Crescimento de estrelas
Estrelas
4.4k
Forks
347
Crescimento semanal
Issues
7
3k4k
abr. de 2025set. de 2025fev. de 2026jul. de 2026
ArtefatosPyPIpip install tiny-llm
README

tiny-llm - LLM Serving in a Week

CI (main)

A course on LLM serving using MLX for system engineers. The codebase is solely (almost!) based on MLX array/matrix APIs without any high-level neural network APIs, so that we can build the model serving infrastructure from scratch and dig into the optimizations.

The goal is to learn the techniques behind efficiently serving a large language model (e.g., Qwen3 models).

In week 1, you will implement the necessary components in Python (only Python!) to use the Qwen3 model to generate responses (e.g., attention, RoPE, etc). In week 2, A Step Closer to vLLM, you will add a KV cache first, then integrate and measure one course-owned Metal optimization at a time until the model reaches about 70% of MLX's performance. In week 3, Build a Mini vLLM, you will turn that fast model into a serving engine with continuous batching, optimized prefill, FlashAttention experiments, and paged attention. In week 4, you will use the engine to build applications such as coding agents and RAG.

Why MLX: nowadays it's easier to get a macOS-based local development environment than setting up an NVIDIA GPU.

Why Qwen3: it keeps the dense decoder architecture small enough for a local MLX course while adding modern details such as QK norm and bfloat16 weights. The official MLX 4-bit model files also make the setup predictable on Apple Silicon.

Book

The tiny-llm book is available at https://skyzh.github.io/tiny-llm/. You can follow the guide and start building.

Community

You may join skyzh's Discord server and study with the tiny-llm community.

Join skyzh's Discord Server

Roadmap

Chapters substantially revised in this PR are marked as work in progress even when they build on original course material. Unchanged chapters retain their existing status, and all Week 4 application material remains work in progress.

Week + Chapter Topic Code Test Doc
1.1 Attention
1.2 RoPE
1.3 Grouped Query Attention
1.4 RMSNorm and MLP
1.5 Load the Model
1.6 Generate Responses (aka Decoding)
1.7 Sampling
2.1 KV Cache 🚧
2.2 Benchmarking and the MLX Baseline 🚧 🚧 🚧
2.3 Quantized Matvec 🚧
2.4 Decode Attention 🚧 🚧 🚧
2.5 Fast Model Kernels 🚧 🚧 🚧
3.1 Continuous Batching 🚧
3.2 Flash Attention for Prefill 🚧
3.3 Chunked Prefill 🚧
3.4 Paged KV Cache 🚧
3.5 Paged Attention 🚧
3.6 (optional) MoE (Mixture of Experts)
3.7 (optional) Performance Lab 🚧 🚧 🚧
3.8 (optional) Speculative Decoding 🚧 🚧 🚧
4.1 CLI Coding Agent 🚧 🚧 🚧
4.2 RAG Pipeline 🚧 🚧 🚧
4.3 Tool Calling and Agent Serving 🚧 🚧 🚧

Other topics not covered: quantized/compressed KV cache, prefix/prompt cache, fine-tuning, and long-context techniques.

Star History

Star History Chart

Repositórios relacionados
mlabonne/llm-course

Course to get into Large Language Models (LLMs) with roadmaps and Colab notebooks.

Apache License 2.0coursellm
mlabonne.github.io/blog/
81.2k9.5k
DataTalksClub/data-engineering-zoomcamp

Data Engineering Zoomcamp is a free 9-week course on building production-ready data pipelines. The next cohort starts in January 2026. Join the course here 👇🏼

Jupyter Notebookdata-engineeringkafka
airtable.com/appzbS8Pkg9PL254a/shr6oVXeQvSI5HuWD
43.9k8.6k
rohitg00/ai-engineering-from-scratch

Learn it. Build it. Ship it for others.

PythonPyPIMIT Licenseagentsai
aiengineeringfromscratch.com
42.4k7.1k
PKUanonym/REKCARC-TSC-UHT

清华大学计算机系课程攻略 Guidance for courses in Department of Computer Science and Technology, Tsinghua University

HTMLCreative Commons Attribution Share Alike 4.0 Internationalcoursecourse-project
rekcarc-tsc-uht.readthedocs.io
37.3k7.8k
google/comprehensive-rust

This is the Rust course used by the Android team at Google. It provides you the material to quickly teach Rust.

Rustcrates.ioApache License 2.0rustcourse
google.github.io/comprehensive-rust/
33.3k2k
sunface/rust-course

什么?你敢放心的把后背交给 AI? 我赌你不敢,那就来学学 AI 时代最酷、最安全、最快的语言吧。本书拥有全面且深入的讲解、生动贴切的示例、德芙般丝滑的内容,这可能是目前最用心的 Rust 中文学习教程 / Book

Rustcrates.iorust-langrust
course.rs
30.7k2.6k
huggingface/agents-course

This repository contains the Hugging Face Agents Course.

MDXApache License 2.0agentic-aiagents
30.3k2.2k
inancgumus/learngo

❤️ 1000+ Hand-Crafted Go Examples, Exercises, and Quizzes. 🚀 Learn Go by fixing 1000+ tiny programs.

GoGo ModulesOthergolanggo
twitter.com/inancgumus
20.1k2.7k
datawhalechina/easy-vibe

💻 vibe coding 2026 | Your First Modern Coding course beginners to master step by step.

JavaScriptnpmaicourse
datawhalechina.github.io/easy-vibe/
18.4k1.8k
USTC-Resource/USTC-Course

:heart:中国科学技术大学课程资源

C++ustccomputer-science
ustc-resource.github.io/USTC-Course
16.2k3.5k
federico-busato/Modern-CPP-Programming

Modern C++ Programming Course (C++03/11/14/17/20/23/26)

HTMLCreative Commons Attribution Share Alike 4.0 Internationalcppcpp11
federico-busato.github.io/Modern-CPP-Programming/
15.9k1.1k
nswbmw/N-blog

《一起学 Node.js》

JavaScriptnpmtutorialnodejs
15.4k4.5k