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

Configure Feed

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

Zig 53.5%
JavaScript 27.3%
Python 19.2%
10 1 0

Clone this repository

https://tangled.org/m17e.co/microgpt https://tangled.org/did:plc:2f7mndshqqlmdmjypop4p6oy/microgpt
git@tangled.org:m17e.co/microgpt git@tangled.org:did:plc:2f7mndshqqlmdmjypop4p6oy/microgpt

For self-hosted knots, clone URLs may differ based on your setup.

Download tar.gz
README.md

microgpt.zig#

This is a fork of microgpt.js which ports the original Python implementation implemented by karpathy. This fork ports the implementations to Zig. Claude Code and Windsurf were both used for the port.

Build with zig build-exe microgpt.zig -O ReleaseFast. Run with ./microgpt


The 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.

Adapted from Karpathy's microgpt.py. This implementation matches the original exactly, but now can run in JavaScript environments, including browsers and Node.js.

py-vs-js