enescang
microgpt-visualizer
TypeScript

Interactive visualization of a minimal GPT implementation with autograd engine.

Last updated May 31, 2026
97
Stars
13
Forks
0
Issues
0
Stars/day
Attention Score
71
Language breakdown
TypeScript 86.7%
CSS 12.3%
HTML 0.5%
JavaScript 0.5%
โ–ธ Files click to expand
README

MicroGPT Visualizer

An interactive web application for visualizing and understanding how GPT (Generative Pre-trained Transformer) models work from the ground up. Built with React and TypeScript, featuring a custom autograd engine for educational purposes.

Features

  • Tokenizer Visualization - See how text is broken down into tokens
  • Embeddings Explorer - Visualize how tokens are converted to vector representations
  • Forward Pass Breakdown - Step through the transformer's forward propagation
  • Training Process - Watch the model learn in real-time with loss charts and heatmaps
  • Inference Mode - Generate text and see predictions as they happen
  • Custom Autograd Engine - Built-in automatic differentiation for transparency

Getting Started

Prerequisites

  • Node.js 18+
  • pnpm (recommended) or npm

Installation

# Clone the repository
git clone https://github.com/enescang/microgpt-visualizer.git
cd microgpt-visualizer

Install dependencies

pnpm install

Start the development server

pnpm dev

The application will be available at http://localhost:5173

Available Scripts

  • pnpm dev - Start development server with hot reload
  • pnpm build - Build for production
  • pnpm preview - Preview production build locally
  • pnpm lint - Run ESLint

Project Structure

src/
โ”œโ”€โ”€ components/     # Reusable UI components (Heatmap, Charts)
โ”œโ”€โ”€ pages/          # Main application pages
โ”‚   โ”œโ”€โ”€ TokenizerPage.tsx
โ”‚   โ”œโ”€โ”€ EmbeddingsPage.tsx
โ”‚   โ”œโ”€โ”€ ForwardPassPage.tsx
โ”‚   โ”œโ”€โ”€ TrainingPage.tsx
โ”‚   โ””โ”€โ”€ InferencePage.tsx
โ”œโ”€โ”€ engine/         # Core ML engine
โ”‚   โ”œโ”€โ”€ autograd.ts # Automatic differentiation
โ”‚   โ”œโ”€โ”€ model.ts    # GPT model implementation
โ”‚   โ”œโ”€โ”€ data.ts     # Data handling utilities
โ”‚   โ””โ”€โ”€ random.ts   # Random number generation
โ””โ”€โ”€ App.tsx         # Main application component

Technology Stack

  • React 19 - UI framework
  • TypeScript - Type safety
  • Vite - Build tool and dev server
  • Custom Autograd - Educational ML engine

Educational Purpose

This project is designed to help understand transformer models by:

  • Providing visual feedback at each stage of the process
  • Implementing core concepts from scratch
  • Making complex operations transparent and interactive
  • Allowing experimentation with parameters in real-time

Contributing

Contributions are welcome! Feel free to open issues or submit pull requests.

Credits & Acknowledgments

This project is inspired by and based on:

  • MicroGPT Guide by Andrej Karpathy - Comprehensive guide explaining the implementation
  • microgpt.py by Andrej Karpathy - The implementation closely mirrors this minimal GPT implementation
  • makemore dataset by Andrej Karpathy - Training data (names.txt) used for character-level language modeling
  • micrograd by Andrej Karpathy - Inspiration for the autograd engine design
Special thanks to Andrej Karpathy for creating educational resources that make deep learning accessible and understandable.

License

MIT

Author

enescang

๐Ÿ”— More in this category

ยฉ 2026 GitRepoTrend ยท enescang/microgpt-visualizer ยท Updated daily from GitHub