OpenLanguageModel (OLM) is an open-source PyTorch library designed for transparent pretraining of small language models. It structures model code to mirror architecture diagrams using explicit wiring modules like Block and Parallel, enabling seamless transitions from educational notebooks to full-scale research ablations. The library integrates tokenizers, streaming datasets, optimization, mixed precision, and hardware-aware execution across CPU and single-node GPU setups.
- Code readability mirrors architecture diagrams, easing debugging and teaching.
- Reusable components allow moving from notebooks to production pretraining unchanged.
- Built-in support for FineWeb-Edu and other streaming datasets simplifies data pipelines.
- Hardware-aware execution covers CPU, single-GPU, and single-node multi-GPU modes.