# MicroGPT in Pure C Hits 10M Tokens/sec on Apple M5

Original title: Microgpt in pure C hits 10M tps on Apple m5

> Hacker News story 49347477 · language: en · submitted 2026-08-18
> Web version: https://zeli.app/story/49347477
> About this feed: https://zeli.app/llms.txt · Agent guide: https://zeli.app/skill.md

▲ 136 · by [dhorthy](<https://news.ycombinator.com/user?id=dhorthy>) · 💬 50
[original](<https://github.com/vixhal-baraiya/microgpt-c>) · [HN discussion](<https://news.ycombinator.com/item?id=49347477>)

## Summary

A new GitHub project, microgpt-c, implements a character-level GPT entirely in dependency-free C, with training and inference in a single file. It achieves over 10 million tokens per second on an Apple M5 Pro using NEON optimizations, and 6.9M on an AMD Ryzen 5 5600H with AVX2. The model, with only 4,192 parameters, generalizes well, beating an interpolated trigram on unseen data.

## Key quote

> c fp32+NEON 10168430 tok/sec

## HN discussion (50 comments)

### [hasteg](<https://news.ycombinator.com/item?id=49366276>)

> This is pretty cool. Implemented something similar myself (a really small language model with ~10M params) just to teach myself the ML behind the LLMs. Did not implement it in C obviously, just use PyTorch, but it's interesting to go through the c file and see how he has implemented stuff I took for granted in Python in C.
>
> Anyway, I just tested this out myself on my AMD Ryzen 9 9800x3d. I got 7647173 tok/sec using karpathy's Shakespeare dataset https://raw.githubusercontent.com/karpathy/char-rnn/master/d.... Going to play around with it and see if I can get a CUDA kernal built to see what it could do on a 5090. Claude estimates with napkin math that we could get around 2B tok/s

### [Retr0id](<https://news.ycombinator.com/item?id=49363988>)

> \> The most atomic way to train and inference a GPT in pure, dependency-free C.
>
> What sense of the word "atomic" is meant here?

### [MycroftJones](<https://news.ycombinator.com/item?id=49364333>)

> Check out this port of microgpt to C, posted 5 months ago.  It got a 2500x speedup over the python version.  https://github.com/moebiusV/cugpt

### [ilaksh](<https://news.ycombinator.com/item?id=49363196>)

> This is not an LLM obviously 
>
> , it's just for generating random names. But interesting to think of the possibilities of truly tiny language models if there were connected together.

### [gok](<https://news.ycombinator.com/item?id=49365461>)

> It could probably go quite a bit faster using Arm SME. The entire network could fit into the ZA register.

---

## Cite

- Page: https://zeli.app/story/49347477
- Date: 2026-08-18
- Source: github.com (https://github.com/vixhal-baraiya/microgpt-c)
- Hacker News: https://news.ycombinator.com/item?id=49347477

## Other languages

- zh: https://zeli.app/zh/story/49347477 · markdown: https://zeli.app/zh/story/49347477.md
- ja: https://zeli.app/ja/story/49347477 · markdown: https://zeli.app/ja/story/49347477.md
- ko: https://zeli.app/ko/story/49347477 · markdown: https://zeli.app/ko/story/49347477.md
- de: https://zeli.app/de/story/49347477 · markdown: https://zeli.app/de/story/49347477.md
- es: https://zeli.app/es/story/49347477 · markdown: https://zeli.app/es/story/49347477.md
