mni-ml/transformer
A 12-million-parameter transformer language model implemented in Node.js and trained with the mni-ml/framework library on BPE-tokenized text such as TinyStories or YouTube-Commons transcripts.
mni-ml/transformer is a small transformer language model built on top of the mni-ml/framework library. Training and text generation run in JavaScript on Node.js 22.18 or newer, while included Python scripts build the training dataset from the TinyStories corpus or YouTube-Commons video transcripts and train a byte-level BPE tokenizer.
The project includes separate CPU and GPU code paths for both training and sampling: the CPU path uses a matmul attention fallback that runs everywhere, and the GPU path uses CUDA or WebGPU through an optional native framework package. A default trained checkpoint and tokenizer are committed under out/, and other checkpoints stay local.