xenova / microgpt.js
PublicThe most atomic way to train and inference a GPT in pure, dependency-free JavaScript. This repository covers the complete algorithm. Everything else is just efficiency. Inspired by Karpathy's microgpt.py.
A standalone JavaScript program that trains a tiny language model on text from a file and generates new similar text, with no extra software needed.
How It Works
You find this fun, simple project that lets you train a tiny AI to copy writing styles from your own text files.
Create a plain text file filled with stories, names, poems, or any writing you want the AI to learn and mimic.
Run the program with your text file, and it begins teaching itself the patterns in your writing, step by step.
You see numbers dropping as the AI improves at guessing what words come next, feeling the magic of learning happen.
Tell the AI to dream up fresh text, and it generates creative new stories or names in the style it learned.
Now you have a personal tiny brain that writes like your input, ready for endless fun experiments!
Star Growth
Repurpose is a Pro feature
Generate ready-to-use prompts for X threads, LinkedIn posts, blog posts, YouTube scripts, and more -- with full repo context baked in.
Unlock RepurposeSimilar repos coming soon.