Corpus
Collect character or domain-mixed training text.
data/*.txt
Language model systems lab
Vexel is a compact language-model project for learning tensor math, reverse-mode autograd, GPT architecture, training, export, and Rust inference end to end.
$ python >>> import vexel >>> x = vexel.Tensor([[1.0, 2.0], ... [3.0, 4.0]]) >>> tape = vexel.TensorTape() >>> node = tape.leaf(x) >>> tape.backward(node) # gradients remain explicit [[1.0, 1.0], [1.0, 1.0]]
01 / overview
Compare the implementation surfaces and follow one concept without hiding the mechanics behind a framework.
| Surface | Role | Implementation | Best for |
|---|---|---|---|
| Rust core | Tensor and autograd engine | 2D row-major storage, tape nodes, operators | Understanding layout and gradients |
| Python API | Interactive experiment layer | PyO3 binding for Tensor and TensorTape | Fast debugging and small demos |
| PyTorch | Practical training | Character and BPE GPT loops | Datasets, checkpoints, generation |
| Rust inference | Portable forward pass | Exported JSON weights and GPT forward code | Inspecting deployment mechanics |
02 / workflow
The shortest complete path, kept visible at every stage.
Collect character or domain-mixed training text.
data/*.txt
Character IDs or learned byte-pair merges.
bpe.py
Run attention, norms, ReLU, and backward passes.
train_bpe_gpt.py
Convert weights and run the Rust forward pass.
export_to_json.py
03 / features
Search the implemented systems and jump into the code that owns them.
Row-major storage with matmul, transpose, scale, sum, split, concat, ReLU, and softmax.
Tape-based gradient tracing makes every recorded operator and gradient inspectable.
Causal attention, embeddings, pre-norm blocks, ReLU MLP, and final LM logits.
PyO3 classes exchange two-dimensional nested lists through a small, explicit API.
Corpus preparation, subword vocabulary, mixed-domain data, and checkpoint tracking.
JSON weight export, Rust forward inference, and a limited Flask completion demo.
04 / architecture
Select a layer to inspect its role and owned components.
05 / quick start
Build the native module, run the tests, and then open the smallest pieces of the implementation.
cargo testpython3 -m maturin develop --releasecd python && python3 web_server.py06 / status
Usable 2D storage, operators, tape nodes, and gradient checks.
PyTorch training paths for character and mixed-domain corpora.
Educational-scale only; not optimized for large models or factual reliability.