Skip to content

Instantly share code, notes, and snippets.

View olveirap's full-sized avatar

Paulo Olveira olveirap

View GitHub Profile
@olveirap
olveirap / microgpt.py
Last active March 4, 2026 16:00 — forked from karpathy/microgpt.py
fadam-microgpt
"""
The most atomic way to train and run inference for a GPT in pure, dependency-free Python.
This file is the complete algorithm.
Everything else is just efficiency.
@karpathy
"""
import os # os.path.exists
import math # math.log, math.exp