NJX-njx/microgpt
🔬 The most atomic GPT-2 implementation in 265 lines of pure Python & CUDA. A bilingual "Rosetta Stone" for understanding LLM internals from scratch. No dependencies, just math and kernels.
This project offers a compact, understandable implementation of a GPT-2 style language model. It helps developers learn how large language models work internally by providing side-by-side Python and CUDA code. You input a text corpus, and it trains a model to generate new text, helping you understand the process from raw data to text generation.
Use this if you are a developer or researcher looking to deeply understand the core algorithms of a GPT-2 style LLM through a highly optimized, minimalist codebase.
Not ideal if you need a production-ready LLM, a library for building applications, or a tool that doesn't require direct code interaction.
Stars
21
Forks
—
Language
HTML
License
—
Category
Last pushed
Mar 05, 2026
Commits (30d)
0
Get this data via API
curl "https://pt-edge.onrender.com/api/v1/quality/transformers/NJX-njx/microgpt"
Open to everyone — 100 requests/day, no key needed. Get a free key for 1,000/day.
Higher-rated alternatives
tabularis-ai/be_great
A novel approach for synthesizing tabular data using pretrained large language models
EleutherAI/gpt-neox
An implementation of model parallel autoregressive transformers on GPUs, based on the Megatron...
shibing624/textgen
TextGen: Implementation of Text Generation models, include LLaMA, BLOOM, GPT2, BART, T5, SongNet...
ai-forever/ru-gpts
Russian GPT3 models.
AdityaNG/kan-gpt
The PyTorch implementation of Generative Pre-trained Transformers (GPTs) using Kolmogorov-Arnold...