200loc is a single-page walkthrough of the tiny microgpt.py program shipped
with this repo.
The app shows one GPT inference step at a time in the browser, with the Python source, explanation, and model view kept in sync.
Requirements:
- Node 20+
- Python 3
npm install
npm run devFor a production preview:
npm run build
npm run previewRebuild the exported model bundle and reference trace fixture with:
npm run generate:modelThis updates public/assets/microgpt-model.json and
src/test/fixtures/expected-step-em.json. If input.txt is missing, the
script fetches the names corpus snapshot from Andrej Karpathy's makemore
repository.
npm test
npm run test:coverage
npm run lint
npm run build
npm run test:e2eUse npm run test:e2e:headed for a headed browser pass.
200loc pays respect to Andrej Karpathy for
microgpt and to Brendan Bycroft for
LLM Visualization, which inspired the model viewer.