A family of machine learning libraries written from scratch in Rust, with zero ML dependencies.
| Library | Focus | Size |
|---|---|---|
mlrust-core |
Shared tensor & autograd foundation | ~1,200 lines |
mlrust |
Transformers & NLP | ~10,000 lines |
MLRustFoundation |
CNNs & computer vision | ~2,600 lines |
See ECOSYSTEM.md for the full architecture, feature comparison, and integration examples across the three libraries.
[dependencies]
mlrust-core = { path = "../mlrust-core" }use mlrust_core::Tensor;
let a = Tensor::ones((2, 2), true);
let b = Tensor::ones((2, 2), true);
let c = a.add(&b);
let mut loss = c.sum();
loss.backward();
println!("gradient of a: {:?}", a.grad());Each crate has its own README with install instructions, quick-start examples, and a rundown of what is (and isn't) implemented yet:
Each library is its own Cargo project:
cd mlrust-core && cargo test
cd MLRustFoundation && cargo test
cd mlrust-transformers && cargo testClarity over performance. These are learning projects — every component is written to be readable and easy to follow rather than optimized for production workloads.
MIT - see LICENSE.