Fork of https://github.com/xenova/microgpt.js
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

at main 16 lines 861 B view raw view rendered
1 2# microgpt.zig 3 4This is a fork of [microgpt.js](https://github.com/xenova/microgpt.js) which ports the original Python implementation implemented by [karpathy](https://karpathy.github.io/2026/02/12/microgpt/). This fork ports the implementations to Zig. Claude Code and Windsurf were both used for the port. 5 6Build with `zig build-exe microgpt.zig -O ReleaseFast`. Run with `./microgpt` 7 8--- 9 10The most atomic way to train and inference a GPT in pure, dependency-free JavaScript. 11This repository covers the complete algorithm. 12Everything else is just efficiency. 13 14Adapted from Karpathy's [microgpt.py](https://gist.github.com/karpathy/8627fe009c40f57531cb18360106ce95). This implementation matches the original exactly, but now can run in JavaScript environments, including browsers and Node.js. 15 16![py-vs-js](549677968-5dfe8e81-e7a9-4a81-844b-a24a133f54d7.gif)