Rebuilding GPT2 inference in 500 lines of
Launched as “Rebuilding GPT2 inference in ~500 lines of (commented) code”
Rebuilding GPT2 inference in 500 lines of launched on August 26, 2025 with 5 votes and more than 75% of that year's launches. The site was still online in September 2026, 1 year on.
Forecast
95%
chance that this product’s website is still online in December 2031. Typical launch of 2025 gets 88%.
- 1 year · Dec 2027
- 99%
- typical 97%
- 3 years · Dec 2029
- 96%
- typical 90%
- 5 years · Dec 2031
- 95%
- typical 88%
- Rebuilding GPT2 inference in 500 lines of
- Typical launch of 2025
Launch signals stronger than 98% of the archiveweakest → strongest
Made on December 2, 2026, when the site was online, from what was public on launch day. It is not revised, and it is graded when the site is checked again. How the forecast works and how often it is right →
What it does
Hey! Like most engineers I’ve been looking at the latest LLMs and wondering how they actually work. I watched a couple videos to try to understand them ( Karpathy’s video series are pretty good ) but they’re mostly taught by machine learning PhDs so they tend to gloss over the non-mathy part of the problems. To try to break it down further I rebuilt GPT2 from scratch . This file loads the open source GPT2 weights and applies all the inference math until we get to the results. I’m also going to add explanations for everything that happens along the way. By the way, if you have any questions or comments, hit me up at hello at khamidou.com ! It’s very limited Swift though, and you don’t really…from khamidou.com
Does a similar job
free ones →all alternatives →
Speeding up LLM inference 2x times (possibly)2024 · asciinema.org · ▲419This project presents an algorithm for accelerating large language model inference on Apple Silicon chips.
A Python tool for text-based AI training and2020 · github.com · ▲174A robust Python tool for text-based AI training and generation using GPT-2.
Minimal LLM Post-Training Experiments on an 8GBAug 2026 · github.com · ▲21Minimal, readable LLM post-training experiments on one 8GB GPU. Measures forgetting, seed variance, and RL emergence.
- PPhilip22019 · medium.com · ▲8
Finetune a Gemma 2B model for codegen2024 · github.com · ▲5Supervised fine-tuning of Google's open-source Gemma-2B model to optimize writing Python code
A memory for Claude & ChatGPT with custom data2025 · dry.ai · ▲8
More life & fun this month
the category →
Tiny SFO▲630A tiny, live SFO: real flights land, taxi to their gates and take off under the Bay
Life & fun · 5d ago · tinysfo.com
- Bbouncemarket▲432
a ball will fall. trade on where it lands.
Life & fun · 6d ago · bouncemarket.minhanhday.com

- Y

- ON
Twenty-three graphics card demos by 3dfx, NVIDIA and ATI from 1998 to 2006, running in the browser.
Life & fun · 8d ago · gpu-demo-gallery.pages.dev
Is Rebuilding GPT2 inference in 500 lines of yours? Feature it on the home page: $19, or free with the badge →
Source: Show HN post ↗
Launched alongside, August 2025
the whole month →

A wooden pixel display constructed over six years renders images one pixel at a time, requiring 30 to 60 minutes per complete image.
Work · 2025 · benholmen.com

Kitten TTS▲1,003Kitten TTS is an open-source text-to-speech model smaller than 25 MB, designed to run on resource-limited devices like Raspberry Pi, smartphones, wearables, and browsers without requiring a GPU.
AI · 2025 · github.com

This is an interactive visualization that demonstrates how to arrange objects along a spherical helix path using parametric equations.
Life & fun · 2025 · visualrambling.space

A web service that generates a CSS gradient representation of the current sky at the user's approximate location.
Dev tools · 2025 · sky.dlazaro.ca