minhub is an R package that provides minimal, self-contained implementations of deep learning models, inspired by Karpathy’s minGPT. Each model lives in a single file with no external dependencies, making it easy to copy into your own projects.
The package prioritizes clean, readable code over performance, making it well suited for learning how models like GPT-2, LLaMA, Gemma 3, and Mistral work under the hood. It supports loading pre-trained weights directly from Hugging Face Hub. Implementations cover a range of architectures including GPT-NeoX, SantaCoder, Qwen, and others, all built on top of the torch for R ecosystem.