3 min readfrom Machine Learning

Millwright — experimenting with an end-to-end machine learning framework in Rust [P]

Our take

Millwright is an open-source project exploring a complete machine learning workflow built in Rust, addressing gaps often found when integrating individual ML libraries. This framework streamlines the classical ML lifecycle—ingest, explore, preprocess, and beyond—by providing a common abstraction layer over existing Rust libraries and interoperating with the Python/ONNX ecosystem. Currently featuring capabilities like AutoML and drift monitoring, Millwright aims to provide a valuable execution layer across training, inference, and production.

The emergence of Millwright, an open-source machine learning framework built in Rust, presents a compelling exploration of a critical challenge within the AI space: bridging the gaps between individual ML libraries and creating a cohesive, production-ready workflow. As we’ve explored in pieces like [Mastering the AI Project Cycle: From Concept to Production], the journey from model selection to deployment and monitoring is rarely seamless. Millwright’s creator rightly identifies that the difficulty often lies not in training the models themselves, but in orchestrating the entire lifecycle – encompassing preprocessing, evaluation, explainability, and ongoing monitoring. This resonates with the concerns raised in [Is Agentic AI Just Automation?], which highlights the need for robust architectures that extend beyond simple automation flows to encompass the complexities of real-world ML systems. The project's focus on integration, rather than simply replicating existing Python libraries, is a particularly astute observation.

Millwright’s ambition isn’t to displace Python as the dominant language for ML, a realistic and pragmatic assessment given Python’s mature ecosystem. Instead, it proposes Rust as a valuable common execution layer – a unifying force across training, inference, and production. The architectural choice of a central "Frame" data boundary, while introducing conversion costs, allows for interoperability between components built with different backends, which is a significant advantage in a landscape increasingly characterized by specialized libraries. The project’s current feature set – encompassing preprocessing pipelines, cross-validation, multiple backends, explainability tools like SHAP, and even AutoML – demonstrates a broad scope and a commitment to addressing key aspects of the ML lifecycle. The inclusion of Python bindings further enhances its practicality, allowing for integration with existing workflows and leveraging the vast resources of the Python community.

The creator’s call for feedback, particularly from those working on ML systems, is commendable. Identifying where Rust can genuinely add value, and conversely, where separation of concerns is preferable, is crucial for the project's long-term success. The willingness to challenge architectural decisions early on, rather than becoming locked into inflexible patterns, is a hallmark of a thoughtful and adaptive development process. This iterative approach, focused on real-world workflows and potential weaknesses exposed by reproducing tasks from scikit-learn, will be vital for ensuring Millwright's relevance and utility. The ongoing development of tools like Diagrid Catalyst 2.0, which [Diagrid Catalyst 2.0 Adds Durable and Verifiable Execution for AI Agents], underscores the growing need for robust and verifiable execution environments for AI agents and workflows, a challenge Millwright implicitly addresses through its focus on production readiness.

Ultimately, Millwright’s experiment represents a fascinating exploration of the potential for Rust to carve out a distinct niche within the machine learning landscape. It’s a testament to the value of building tools that address the often-overlooked challenges of operationalizing AI, rather than simply chasing the latest algorithmic breakthroughs. The question now is whether this approach – prioritizing integration, interoperability, and production-readiness – will gain traction and inspire a broader movement towards more robust and unified ML frameworks, potentially leading to a future where Rust plays a more significant role in the deployment and maintenance of AI systems beyond research and experimentation.

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.

https://millwright-rs.dev/

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/

Source:
https://github.com/mi7plus/millwright

submitted by /u/olty5000
[link] [comments]

Read on the original site

Open the publisher's page for the full experience

View original article