# rasbt/LLMs\-from\-scratch

> Implement a ChatGPT\-like LLM in PyTorch from scratch, step by step

Canonical: https://starboard.codevetter.com/explore/rasbt/LLMs-from-scratch

[Back to Discover](https://starboard.codevetter.com/discover)

![rasbt](https://avatars.githubusercontent.com/u/5618407?v=4&s=40)

rasbt

# LLMs\-from\-scratch

[View on GitHub
](https://github.com/rasbt/LLMs-from-scratch)

Implement a ChatGPT\-like LLM in PyTorch from scratch, step by step

ai
artificial\-intelligence
attention\-mechanism
deep\-learning
finetuning
from\-scratch
generative\-ai
gpt
instruction\-tuning
language\-model
large\-language\-models
llm
machine\-learning
natural\-language\-processing
pretraining
python
pytorch
tokenizer
transformers


109k stars

Jupyter Notebook

Updated 18h ago

Created Jul 23, 2023

## Star history

\+12,755 stars
13\.3% growth


## Detected tools

[OpenAI](https://starboard.codevetter.com/tools/openai)
[Transformers](https://starboard.codevetter.com/tools/transformers)
[pytest](https://starboard.codevetter.com/tools/pytest)
[GitHub Actions](https://starboard.codevetter.com/tools/github-actions)


Tool detection is evidence\-based, not a full runtime audit\. Package manifests, lockfiles, and SBOMs are high\-confidence; README, topics, and AI metadata are lower\-confidence signals\. Repository language is metadata, not counted as a tool\. Accuracy varies by ecosystem, especially for C/C\+\+ and custom monorepos\.

- OpenAI  · 98% confidence · Sources: github\-sbom, github\-topic, pyproject\.toml · Detected Jul 9, 2026

- Transformers  · 98% confidence · Sources: github\-sbom, github\-topic, pyproject\.toml · Detected Jul 9, 2026

- pytest  · 98% confidence · Sources: github\-sbom, pyproject\.toml · Detected Jul 9, 2026

- GitHub Actions  · 88% confidence · Sources: \.github/workflows/basic\-tests\-latest\-python\.yml, \.github/workflows/basic\-tests\-linux\-uv\.yml, \.github/workflows/basic\-tests\-macos\-uv\.yml, \.github/workflows/basic\-tests\-old\-pytorch\.yml, \.github/workflows/basic\-tests\-pip\.yml, \.github/workflows/basic\-tests\-pixi\.yml, \.github/workflows/basic\-tests\-pytorch\-rc\.yml, \.github/workflows/basic\-tests\-windows\-uv\-pip\.yml, \.github/workflows/check\-links\.yml, \.github/workflows/check\-spelling\-errors\.yml, \.github/workflows/pep8\-linter\.yml, \.github/workflows/required\-checks\.yml · Detected Jul 9, 2026

## Similar projects

[![shareAI\-lab](https://avatars.githubusercontent.com/u/189210346?v=4&s=24)

shareAI\-lab/ learn\-claude\-code

Bash is all you need \-  A nano claude code–like 「agent harness」, built from 0 to 1

Python 81k 58%](https://starboard.codevetter.com/explore/shareAI-lab/learn-claude-code)[![openai](https://avatars.githubusercontent.com/u/14957082?v=4&s=24)

openai/ openai\-agents\-python

A lightweight, powerful framework for multi\-agent workflows

Python 31k 54%](https://starboard.codevetter.com/explore/openai/openai-agents-python)[![langchain\-ai](https://avatars.githubusercontent.com/u/126733545?v=4&s=24)

langchain\-ai/ deepagents

The batteries\-included agent harness\.

Python 32k 58%](https://starboard.codevetter.com/explore/langchain-ai/deepagents)[![VectifyAI](https://avatars.githubusercontent.com/u/133959746?v=4&s=24)

VectifyAI/ PageIndex

📑 PageIndex: Document Index for Vectorless, Reasoning\-based RAG

Python 41k 55%](https://starboard.codevetter.com/explore/VectifyAI/PageIndex)[![oobabooga](https://avatars.githubusercontent.com/u/112222186?v=4&s=24)

oobabooga/ textgen

Open\-source desktop app for local LLMs\. Text, vision, tool\-calling, OpenAI/Anthropic\-compatible API\. 100% private\.

Python 48k 61%](https://starboard.codevetter.com/explore/oobabooga/textgen)[![zeroclaw\-labs](https://avatars.githubusercontent.com/u/261820148?v=4&s=24)

zeroclaw\-labs/ zeroclaw

Fast, small, and fully autonomous AI personal assistant infrastructure, any OS, any platform — deploy anywhere, swap anything 🦀

Rust 34k 52%](https://starboard.codevetter.com/explore/zeroclaw-labs/zeroclaw)[![affaan\-m](https://avatars.githubusercontent.com/u/124439313?v=4&s=24)

affaan\-m/ ECC

The agent harness performance optimization system\. Skills, instincts, memory, security, and research\-first development for Claude Code, Codex, Opencode, Cursor and beyond\.

JavaScript 309k 51%](https://starboard.codevetter.com/explore/affaan-m/ECC)[![promptfoo](https://avatars.githubusercontent.com/u/137907881?v=4&s=24)

promptfoo/ promptfoo

Test your prompts, agents, and RAGs\. Red teaming/pentesting/vulnerability scanning for AI\. Compare performance of GPT, Claude, Gemini, DeepSeek, and more\. Simple declarative configs with command line and CI/CD integration\.  Used by OpenAI and Anthropic\.

TypeScript 28k 50%](https://starboard.codevetter.com/explore/promptfoo/promptfoo)
