He's done it because he evidently loves it, and wants to share his hard-earned knowledge with the rest of the world.
He may be a product of the ivory tower, but he's been in the trenches. He knows firsthand how f-ing hard it is to ship a product.
And here he is, sharing useful personal code with everyone.
This github repo now has collected ~4K stars and its antecessor (minGPT) has collected ~11K stars over the past couple of years. In my experience, the number of people who clone, copy, view or otherwise use code from a repo is one to two orders of magnitude larger than the number of people who star it, so we can safely say that Andrej has helped at least a few hundred thousand -- but likely more than a million -- individuals around the world learn how to build and tinker with GPT models.
Remarkably, as I write this, no one else here has said thank you yet, so let me say it on everyone's behalf:
THANK YOU ANDREJ.
--
EDITS: I changed the wording in response to latexr's comments below.