#423 · Primary category: Education & Research

microgpt-c

artificial-intelligence c c-programming deep-learning gpt llm machine-learning microgpt

The most atomic way to train and inference a GPT in pure, dependency-free C

Project last updated:08/17/26

GitHub Stars

837

Forks

110

Contributors

1

License

MIT

Why we included this project

Most transformer tutorials leave the training loop as a black box, but microgpt-c is a character-level transformer in a single C file, with the forward pass, backprop, and Adam all written out and nothing beyond the standard library. It trains on roughly 32,000 names in a couple of seconds and generates new ones, and a specialized single-token inference path stays separate from the training forward pass. With 4,192 parameters, the model generalizes rather than memorizes, which is a clear demonstration of how a small GPT behaves. It builds on macOS, Linux, and Windows with NEON and AVX2 support, so it runs on most machines. For developers and students who want to see how a GPT actually learns, this is a compact study aid rather than a production tool.

Articles for this project

No articles for this project yet.

To suggest a topic or contribute an article, contact us.

Related projects in this category