Millwright — experimenting with an end-to-end machine learning framework in Rust [P]
I've been working on an open-source project called Millwright, an attempt to explore what an end-to-end machine learning workflow could look like in Rust.
This started while I was learning and building ML tooling in Rust.
I kept finding capable individual libraries, but also gaps between them. Training a model was rarely the problem. Building the workflow around it — preprocessing, model selection, evaluation, explainability, deployment and monitoring — often meant integrating several unrelated crates and data representations.
I initially started implementing some of those missing pieces as smaller independent crates.
Eventually I realized I was more interested in the integration problem itself.
That became Millwright.
The current idea is to cover the classical ML lifecycle:
ingest → explore → preprocess → select → fit → assess → explain → export → serve → monitor
without trying to reimplement every ML algorithm.
Instead, Millwright provides a common abstraction layer over existing Rust libraries and uses adapters for different ML backends.
One architectural decision I'm experimenting with is having the framework own a small 2D data boundary (Frame) rather than exposing a particular backend's ndarray/dataframe representation throughout the API.
That allows models and components backed by different libraries to participate in the same pipeline, at the cost of conversions at backend boundaries.
The project currently includes work around:
- preprocessing and composable pipelines
- cross-validation and hyperparameter optimization
- multiple ML backends
- ensembles
- regression diagnostics
- SHAP-based explainability
- ONNX export
- model serving and registry
- drift monitoring
- time-series workflows
- incremental learning
- AutoML
There are also Python bindings.
I'm not building this on the assumption that Rust should replace Python for ML. Python's ecosystem is enormously more mature, and there would be little value in simply recreating scikit-learn in another language.
The question I find more interesting is:
Can Rust provide a useful common execution layer across training, inference and production ML while still interoperating with the existing Python/ONNX ecosystem?
I'd rather have the architecture challenged before too many decisions become difficult to change.
I'd particularly appreciate thoughts from people working on ML systems:
Where do you think Rust could genuinely add value to the classical ML lifecycle?
And conversely, which parts of this architecture do you think should remain separate rather than being unified behind one framework?
I'm also interested in real workflows that would be useful tests. If there's something straightforward in sklearn that you think would expose weaknesses in this approach, I'd be interested in trying to reproduce it.
Project / documentation:
https://millwright-rs.dev/
[link] [comments]
Want to read more?
Check out the full article on the original site