This repository is the runnable companion to the lecture notes at lectures.montek.dev.
It has two layers:
- theory and explanations in the lecture notes
- runnable notebooks, scripts, apps, and
picollm/in this repo
Use the lecture notes for the full explanation, then open the linked code from the relevant lesson.
Install the repo first:
uv syncThen use this workflow:
- Open the relevant lesson on
lectures.montek.dev. - Read the theory there first.
- Open the linked notebook or script from this repo.
- For the main from-scratch chatbot path, follow
picollm/accelerated/README.md.
If you want the fastest student runtime path for a published Hugging Face model or your own trained picoLLM checkpoints, start with:
For the main chatbot path, start with:
That path covers:
- tokenizer training
- base pretraining
- chat SFT
- evaluation and reporting
- CLI or web interaction at the end of the run
Use these directories by purpose:
notebooks/: live lecture walkthroughsscripts/: runnable demo scripts and small appsapps/: production-style frontend appscourse_tools/: tiny from-scratch runtime used by the smaller demospicollm/: serious model workflow for the final chatbot path
For the final lecture sequence:
- RUN_PICOLLM.md
- picollm/accelerated/README.md
- picollm/accelerated/speedrun.sh
- prompts/real_chatbot_workflow/base_vs_chat_sft_prompts.md
- apps/vercel_ai_sdk_chat/README.md
- apps/opentui_ai_sdk_chat/README.md
- Rasbt: concept-first step-by-step implementations and notebooks
- picoLLM accelerated: the main product-style training, evaluation, inference, and chat path in this repo
- This project draws heavily on Sebastian Raschka's
LLMs-from-scratch. - Thank you to Hugging Face for the open tooling and datasets ecosystem that make projects like this easier to teach and build.
If you want to cite the reference material behind this workflow, cite Raschka for the concept-first notebook lineage and this repo for the picoLLM product-track path:
cff-version: 1.2.0
message: "If you use this book or its accompanying code, please cite it as follows."
title: "Build A Large Language Model (From Scratch), Published by Manning, ISBN 978-1633437166"
abstract: "This book provides a comprehensive, step-by-step guide to implementing a ChatGPT-like large language model from scratch in PyTorch."
date-released: 2024-09-12
authors:
- family-names: "Raschka"
given-names: "Sebastian"
license: "Apache-2.0"
url: "https://www.manning.com/books/build-a-large-language-model-from-scratch"
repository-code: "https://github.com/rasbt/LLMs-from-scratch"
keywords:
- large language models
- natural language processing
- artificial intelligence
- PyTorch
- machine learning
- deep learningIf you want to cite this repo itself, use:
@misc{llm_from_scratch_and_deploy,
author = {Montek Kundan},
title = {LLM From Scratch and Deploy},
year = {2026},
publisher = {GitHub},
url = {https://github.com/Montekkundan/llm}
}MIT. See LICENSE.
