OpenArch – PyTorch implementations of modern LLM architectures
OpenArch is a new repository providing readable, from-scratch PyTorch implementations of modern large language model architectures. The project aims to prioritize educational clarity over production-level performance.
Why it matters
It serves as a valuable resource for developers and researchers seeking to understand the structural nuances of state-of-the-art AI models.
Python implementations of modern open-source LLM architectures — written from scratch, one model at a time.
This repository contains hand-written PyTorch implementations of the model architectures cataloged in Sebastian Raschka's LLM Architecture Gallery . Each model is implemented to the best of my knowledge from the original papers, technical reports, reference config.json files, and the excellent writeups by Sebastian Raschka and Machine Learning Mastery.
The goal is not to compete with transformers or other production libraries. The goal is clarity and learning : a single readable file per architecture, with the structural choices (attention type, normalization, layer mix, MoE routing, positional encoding) made explicit and easy to compare side-by-side.
Modern LLM architectures share a common skeleton but differ in dozens of small, important choices:
Reading the official model code can be hard because production repos optimize for speed, sharding, and backward compatibility. This repo optimizes for reading .
Get smarter about the news
Sign up free for a feed built around what you actually care about, Dive Deeper research on any story, and the full text of every article.
Create free accountAlready have an account? Sign in