MLeap Bundle
MLeap Bundle is a graph-based, portable serialization format and execution engine for machine learning pipelines, designed to decouple model training from production deployment.
Publisher review
MLeap Bundle is a graph-based, portable serialization format and execution engine for machine learning pipelines, designed to decouple model training from production deployment. It targets data scientists and ML engineers who build pipelines in Apache Spark, Scikit-learn, or TensorFlow and need to serve those models in environments where the original training framework is unavailable or undesirable. By serializing the entire pipeline—including feature transformers, estimators, and algorithms—into a single .zip file (the bundle), MLeap enables teams to export models from Spark and run them in pure Java, Scala, R, or Python runtimes without any Spark dependencies. This is particularly valuable for organizations that want to deploy Shiny apps, plumber APIs, or microservices without maintaining a Spark cluster, or for collaborating across teams that use different programming languages (e.g., R and Scala). MLeap is free and open-source, hosted on GitHub under the combust organization, with over 1,500 stars and 317 forks as of early 2026, and is maintained by a community including contributors from Yelp and Posit (formerly RStudio).
MLeap works by serializing a trained ML pipeline into a bundle file using Protocol Buffers (protobuf) for efficient, language-agnostic storage. The bundle captures the entire directed acyclic graph (DAG) of transformers and models, preserving the order of pipeline steps and all learned parameters. Supported algorithms include regressions (linear, logistic), tree-based models (random forest, gradient-boosted trees), Bayesian models (naive Bayes), neural networks (multilayer perceptron), and clustering (k-means). The MLeap runtime can deserialize the bundle and execute predictions in a standalone environment—no SparkContext required. For example, the R package `mleap` (developed by Posit) provides functions like `ml_write_to_bundle_transformed()` to export a sparklyr pipeline and `mleap_load_bundle()` to load it into R for scoring. The bundle can also be loaded back into a Spark session via `ml_read_bundle()` for retraining or modification. Version compatibility is critical: the MLeap version must match the Spark version used during training; the `mleap_dep_versions_table()` function lists supported combinations (e.g., MLeap 0.20.0 with Spark 3.2). Maven is required for installation, and the `install_mleap()` function automates the setup.
MLeap occupies a specific niche in the ML serialization ecosystem, competing with formats like PMML (Predictive Model Markup Language), ONNX (Open Neural Network Exchange), and PFA (Portable Format for Analytics). Unlike PMML, which is XML-based and often struggles with complex Spark transformers, MLeap uses protobuf for compactness and supports a broader range of Spark feature transformers (e.g., tokenizer, stop words remover, hashing TF). Compared to ONNX, which is optimized for deep learning models, MLeap excels at traditional ML pipelines with extensive feature engineering steps. PFA is more flexible but has a steeper learning curve and less community adoption. MLeap’s tight integration with Spark and its ability to export pipelines without any Spark dependencies give it an advantage for teams already invested in the Spark ecosystem. However, it does not support deep learning frameworks like PyTorch or Keras natively, and its support for Scikit-learn and TensorFlow is less mature than the Spark integration. AWS SageMaker includes MLeap as a supported inference container, and Databricks provides notebooks for MLeap model export, indicating enterprise adoption.
The honest trade-offs of MLeap are clear. First, it requires Maven for installation, which adds a dependency not present in simpler serialization tools like pickle or joblib. Second, version compatibility is strict: the MLeap version must align with the Spark version used for training, and mismatches cause deserialization failures. Third, while MLeap supports Scikit-learn and TensorFlow, the primary development effort is on the Spark integration, meaning users of other frameworks may encounter fewer tested features or slower bug fixes. Fourth, the bundle format is not human-readable, making debugging harder than with PMML or JSON-based formats. Fifth, the project’s release cadence has slowed; the last commit as of March 2026 was three months prior, and the latest upgrade to Spark 4.0.1 and Java 17 occurred in November 2025. For teams that need to serve models in pure Java or Scala environments without Spark, MLeap is a strong choice, but those requiring broader deep learning support or simpler installation may prefer ONNX or PMML.
How it works
-
Spark pipeline export without Spark
Serializes trained Spark ML pipelines into a portable bundle that runs in a standalone runtime, eliminating the need for a Spark cluster during inference.
-
Multi-framework serialization
Supports exporting pipelines from Spark, Scikit-learn, and TensorFlow into a common MLeap Bundle format for cross-platform deployment.
-
Graph-based pipeline preservation
Captures the entire DAG of transformers and estimators, preserving step order and all learned parameters for exact reproduction of predictions.
-
R and Python integration
Provides R package `mleap` (by Posit) and Python bindings to load bundles and score data without Spark dependencies.
-
Wide algorithm support
Supports regressions, tree-based models, Bayesian models, neural nets, and clustering algorithms from Spark MLlib.
-
Bundle reload into Spark
Allows loading existing bundles back into a Spark session via `ml_read_bundle()` for retraining or pipeline modification.
-
Protobuf serialization
Uses Protocol Buffers for efficient, language-agnostic, and compact storage of pipeline metadata and model weights.
Strengths and trade-offs
Strengths
- Eliminates Spark dependencies in production: MLeap bundles run in a standalone JVM or R environment, reducing infrastructure costs by removing the need for a Spark cluster during inference.
- Preserves pipeline order and parameters exactly: The bundle serializes the full DAG of transformers, ensuring that feature engineering steps (e.g., tokenizer, stop words remover) are applied identically to training and scoring.
- Enables cross-team collaboration: Teams using R, Python, or Scala can share a single bundle file without requiring knowledge of the original training framework.
- Free and open-source with active community: The project has over 1,500 GitHub stars and 317 forks, with contributions from Yelp and Posit, and is available under an Apache 2.0 license.
Trade-offs
- Requires Maven for installation: Users must install Maven (or use the `install_maven()` helper) to set up the MLeap runtime, adding a dependency not needed by simpler serialization tools like pickle.
- Strict version compatibility with Spark: The MLeap version must match the Spark version used during training; mismatches cause deserialization errors, and the compatibility table only lists specific combinations.
- Limited deep learning support: MLeap does not natively support PyTorch or Keras models, making it unsuitable for deep learning pipelines that ONNX or TensorFlow Serving handle.
- Slower release cadence: The last commit as of March 2026 was three months prior, and major upgrades (e.g., to Spark 4.0.1) occurred in November 2025, suggesting slower development velocity compared to alternatives like ONNX.
Pricing context
Free and open-source under Apache 2.0 license; no paid tiers or enterprise versions.
Getting started with MLeap Bundle
-
Install Maven and MLeap
Install Maven on your system, then run `install_mleap()` in R or the equivalent Python command to download the MLeap runtime. Verify the installation by checking the MLeap version matches your Spark version using `mleap_dep_versions_table()`.
-
Train a Spark ML pipeline
Build and fit a Spark ML pipeline using transformers like tokenizer and estimators like random forest in a Spark session. Ensure the pipeline includes all feature engineering steps you want to preserve in the bundle.
-
Export pipeline to bundle
Call `ml_write_to_bundle_transformed()` on your fitted pipeline to serialize it into a .zip bundle file. This captures the entire DAG of transformers and learned parameters in a portable format.
-
Load bundle in standalone runtime
Use `mleap_load_bundle()` in R or the equivalent Python function to deserialize the bundle without a Spark context. The bundle is ready for scoring in a pure Java, Scala, or R environment.
-
Score new data with bundle
Pass a data frame or array of new records to the loaded bundle's transform method. The runtime applies all pipeline steps identically to training, returning predictions without any Spark dependencies.
Frequently Asked Questions
What is MLeap Bundle and how does it work?
MLeap Bundle is a portable serialization format and execution engine for ML pipelines. It serializes the entire pipeline, including transformers and models, into a .zip file using Protocol Buffers. This allows running predictions in standalone environments without the original training framework.
How does MLeap Bundle help deploy Spark ML models without Spark?
MLeap serializes trained Spark ML pipelines into a bundle that runs in a standalone Java, Scala, R, or Python runtime. This eliminates the need for a Spark cluster during inference, reducing infrastructure costs and simplifying deployment in microservices or Shiny apps.
What machine learning frameworks does MLeap Bundle support?
MLeap supports exporting pipelines from Apache Spark, Scikit-learn, and TensorFlow. It captures the full DAG of transformers and estimators. However, the Spark integration is most mature, while Scikit-learn and TensorFlow support may have fewer tested features.
How does MLeap Bundle compare to PMML and ONNX?
MLeap uses Protocol Buffers for compact storage and supports more Spark feature transformers than PMML, which is XML-based. Unlike ONNX, optimized for deep learning, MLeap excels at traditional ML pipelines with extensive feature engineering. It requires Maven installation and strict Spark version compatibility.
What are the installation requirements for MLeap Bundle?
MLeap requires Maven for installation, which adds a dependency not needed by simpler tools like pickle. The `install_mleap()` function automates setup. Version compatibility is strict: the MLeap version must match the Spark version used during training to avoid deserialization errors.
Can I use MLeap Bundle with R or Python for scoring?
Yes, the R package `mleap` by Posit provides functions like `mleap_load_bundle()` to load bundles and score data without Spark. Python bindings also exist. This enables cross-team collaboration, allowing R and Python users to share a single bundle file for predictions.
Alternatives
How MLeap Bundle compares
Direct head-to-head against 3 competitors. Picked by 7wData.
MLeap Bundle
- Pricing
- Free and open-source under Apache 2.0 license; no paid tiers or enterprise versions.
- Target
- MLeap Bundle is a graph-based, portable serialization format and execution engine for machine learning pipelines, designed to decouple model training from production deployment.
- Strength
- Eliminates Spark dependencies in production: MLeap bundles run in a standalone JVM or R environment, reducing infrastructure costs by removing the need for a Spark cluster during inference.
- Watch for
- Requires Maven for installation: Users must install Maven (or use the `install_maven()` helper) to set up the MLeap runtime, adding a dependency not needed by simpler serialization tools like pickle.
MLflow
- Pricing
- Open source; managed MLflow on Databricks at $0.07/DBU
- Target
- Data scientists and MLEs deploying ML models to production
- Deployment
- Self-hosted, Databricks, cloud
- Strength
- Model registry and experiment tracking built into a unified platform
- Watch for
- Complex setup for multi-step pipelines; requires external serving infra
BentoML
- Pricing
- Open source; BentoCloud starts at $0.05/CPU hour
- Target
- Teams needing to package and serve models as APIs
- Deployment
- Self-hosted, BentoCloud, Kubernetes
- Strength
- Native support for Python model serving with auto-generated REST endpoints
- Watch for
- Limited support for Spark pipelines; Python-centric ecosystem
ONNX Runtime
- Pricing
- Open source; Azure managed at $0.10/hour per instance
- Target
- Engineers optimizing cross-framework model inference performance
- Deployment
- Self-hosted, Azure, edge devices
- Strength
- Hardware-accelerated inference across CPU, GPU, and NPU
- Watch for
- Requires model conversion to ONNX format; no pipeline serialization
User reviews
No user reviews yet. Be the first to write one.
Sources
Reporting on this tool draws on these publicly available sources.