[P] no-magic: 47 AI/ML algorithms implemented from scratch in single-file, zero-dependency Python
About this article
I've been building no-magic — a collection of 47 single-file Python implementations of the algorithms behind modern AI. No PyTorch, no TensorFlow, no dependencies at all. Just stdlib Python you can read top to bottom. Every script trains and infers with python script.py. No GPU, no setup, no args. Runs on CPU in under 10 minutes. What's covered (4 tiers, ~32K lines): Foundations — BPE tokenizer, GPT, BERT, RNN/GRU/LSTM, ResNet, Vision Transformer, Diffusion, VAE, GAN, RAG, Word Embeddings Ali...
You've been blocked by network security.To continue, log in to your Reddit account or use your developer tokenIf you think you've been blocked by mistake, file a ticket below and we'll look into it.Log in File a ticket