47 systems · 5 layers

The modern AI stack, rebuilt to understand it

Every row is a standalone repository. Most are study builds; the nineteen marked ⚙ are engineered libraries with tests and strict typing. These are the stars in the console's sky — the shipped, production work is on the work page.

From-scratch implementations of the modern AI stack, filterable by layer
SystemLayerWhat it isLangRepository link
TransformerModeling & training“Attention Is All You Need” implemented end-to-end.Pythonsrc ↗
Vision Transformer⚙Modeling & trainingProduction-grade ViT: training engine, FastAPI serving, ONNX export, >95% test coverage.Pythonsrc ↗
CLIP multimodal projector⚙Modeling & trainingFrom-scratch dual encoders + symmetric contrastive loss, packaged as a hardened FastAPI embedding service with OpenAPI and operational guides.Pythonsrc ↗
WhisperLite⚙Modeling & trainingWhisper-style ASR from scratch: log-mel frontend, byte BPE, encoder–decoder Transformer, KV-cached decoding, training and hardened serving — 216 tests.Pythonsrc ↗
Diffusion modelsModeling & trainingDDPM + DDIM with a timestep-conditioned UNet — every equation implemented, no `diffusers`.Pythonsrc ↗
Small language modelModeling & trainingA small LM trained from scratch, end to end.Pythonsrc ↗
State space modelModeling & trainingMamba-style selective state space model.Pythonsrc ↗
MoE routerModeling & trainingMixture-of-Experts routing layer with load-balancing losses.Pythonsrc ↗
Knowledge distillationModeling & trainingTeacher→student distillation pipeline.Pythonsrc ↗
BPE tokenizerModeling & trainingByte-pair encoding tokenizer from first principles.Pythonsrc ↗
FlashAttentionModeling & trainingTiled, IO-aware attention kernel reimplementation.Pythonsrc ↗
Distributed trainingModeling & trainingFSDP / tensor-parallel training loop mechanics.Pythonsrc ↗
RLHF pipelineAlignment & fine-tuningReward modeling + PPO policy optimization loop.Pythonsrc ↗
DPOAlignment & fine-tuningDirect Preference Optimization loss and trainer.Pythonsrc ↗
LoRA trainerAlignment & fine-tuningLow-rank adaptation training from scratch.Pythonsrc ↗
PEFT library⚙Alignment & fine-tuningLoRA, DoRA, VeRA, IA³, adapters, prefix & prompt tuning — mypy-strict, ~96% coverage.Pythonsrc ↗
Inference server⚙Inference & servingONNX Runtime + Axum: backpressure, graceful shutdown, Prometheus metrics.Rustsrc ↗
Paged KV cache⚙Inference & servingvLLM-style page tables, copy-on-write forking, radix prefix cache, continuous batching.Pythonsrc ↗
Speculative decodingInference & servingDraft-and-verify decoding with acceptance sampling.Pythonsrc ↗
Logit processorInference & servingComposable sampling: temperature, top-k/p, repetition penalties.Pythonsrc ↗
Prompt cacheInference & servingPrefix-aware prompt caching for LLM serving.Pythonsrc ↗
Quantization library⚙Inference & servingINT8 / FP4 (E2M1) / NF4 with MinMax, percentile, KL & MSE calibration — zero `bitsandbytes`.Pythonsrc ↗
AI gatewayInference & servingMulti-provider LLM gateway: routing, retries, keys.TypeScriptsrc ↗
funcflow⚙Inference & servingModel-agnostic function router with validated tool registries, dependency-aware plans, parallel execution, retries and provider fallbacks.TypeScriptsrc ↗
Vector databaseRetrieval & dataHNSW index from scratch — recall >0.95 on a 10K-vector benchmark.Pythonsrc ↗
RAG pipelineRetrieval & dataChunking, embedding, retrieval and generation without frameworks.Pythonsrc ↗
Graph RAGRetrieval & dataKnowledge-graph-backed retrieval augmented generation.Pythonsrc ↗
Semantic routerRetrieval & dataEmbedding-based intent routing for LLM apps.Pythonsrc ↗
Data curation pipelineRetrieval & dataDedup, filtering and quality scoring for training corpora.Pythonsrc ↗
Synthetic dataRetrieval & dataSynthetic dataset generation toolkit.JavaScriptsrc ↗
Feature storeRetrieval & dataOffline/online feature storage with point-in-time correctness.Pythonsrc ↗
Code interpreterRetrieval & dataSandboxed code-execution tool for agents.Pythonsrc ↗
LLM eval harness⚙Evaluation & safetyJSONL datasets → prompt templates → provider adapters → scorers → crash-safe artifacts.Pythonsrc ↗
GuardrailsEvaluation & safetyInput/output validation and policy enforcement for LLM apps.TypeScriptsrc ↗
SAE interpretability toolkit⚙Evaluation & safetyActivation hooks → sharded SafeTensors → ReLU/Top-K sparse autoencoders → evaluation, feature inspection and causal interventions.Pythonsrc ↗
ThinkAct agent runtime⚙Evaluation & safetyExplicit ReAct state machine with strict JSON actions, bounded memory, tool timeouts, repeat detection and prompt-injection redaction.Pythonsrc ↗
Reasoning orchestrator⚙Evaluation & safetyDecompose → reason → critique → synthesize pipeline with targeted revision cycles, confidence signaling and runtime budgets.Pythonsrc ↗
AI observability platform⚙Evaluation & safetyOTLP tracing, retrieval/agent-trajectory visualization and cost accounting for LLM apps.Pythonsrc ↗
Durable coding and research agentEvaluation & safetyLocal-first agent: SQL-backed task graph, checkpoint/resume, evidence-cited reports.Pythonsrc ↗
Text embedding modelModeling & trainingTransformer text embedding model: contrastive training, export, FAISS index and serving.Pythonsrc ↗
Hybrid distributed training⚙Modeling & trainingDDP/FSDP/tensor/sequence parallelism from raw collectives, checked against PyTorch DDP.Pythonsrc ↗
Knowledge graph builderRetrieval & dataDocuments to an evidence-linked graph: ontology validation, entity resolution, retraction.Pythonsrc ↗
LLM evaluation platform⚙Evaluation & safetyTyped monorepo for offline LLM/RAG/agent evals: metrics, paired statistics, gates.Pythonsrc ↗
Model merger⚙Alignment & fine-tuningModel soups and SLERP checkpoint merging with bounded, streaming, per-tensor memory use.Pythonsrc ↗
Two-tower recommender⚙Retrieval & dataTwo-tower candidate retrieval: in-batch softmax, FAISS HNSW, policy-aware reranking.Pythonsrc ↗
Text-to-SQL engine⚙Retrieval & dataNL to SQL with AST validation, tenant rewriting, cost analysis after generation.Pythonsrc ↗
Text-to-speech pipeline⚙Modeling & trainingFastSpeech2 + HiFi-GAN vocoder: data pipeline through serving; ships no trained voices.Pythonsrc ↗

The modern AI stack, rebuilt to understand it — 47 readable reference implementations. ⚙ marks the 19 that are engineered libraries (tests, strict typing, production concerns); the rest are study builds. Part of 195 public repos — the applied, shipped work is a separate query (“show shipped systems”).