Programming Large Language Models from Scratch in Python