Skip to main content

OMLE

Open Machine Learning Exchange — an open, schema-aware interchange format for classical machine learning inference.

OMLE provides a compact binary format (protobuf) for representing trained ML models and their preprocessing and postprocessing pipelines. It preserves model semantics at a level practical for interoperability, conversion, validation, and deployment-oriented inference across major ML ecosystems.

Why OMLE?

Classical ML has an interoperability gap:

  • PMML is semantically rich but XML-based, verbose, and no meaningful updates for many years.
  • ONNX-ML has poor support for classical ML semantics. It lacks schema-level concepts like feature binding, missing/invalid/outlier handling, measure levels, and value domains.
  • Framework-native formats (pickle, joblib, XGBoost JSON, LightGBM text) are not portable and carry security risks.

OMLE fills this gap with a modern binary format that combines PMML's semantic richness with ONNX's operational pragmatism, under a permissive license.

Capability PMML ONNX-ML OMLE
Feature schema with measure levels ✓ ✗ ✓
Missing / invalid / outlier handling ✓ ✗ ✓
Structured ML models (trees, tree ensembles, linear, SVM, MLP, naive Bayes, clustering, anomaly detection) ✓ partial ✓
Generic ML models (KNN) ✗ ✗ ✓
Generic operator graph ✗ ✓ ✓
Embedded verification, warm-up and sample inputs partial ✗ ✓
Binary format ✗ ✓ ✓
Versioned operator registry ✗ ✓ ✓
Permissive license ✓ ✓ ✓

Design

OMLE uses a hybrid representation:

  • Logical schema — named features and targets with types, measure levels, value domains, and preprocessing policies (missing, invalid, outlier handling)
  • Graph nodes — a DAG of named operators spanning preprocessing, model scoring, and postprocessing
  • Structured model bodies — dedicated proto messages for classical ML families where preserving high-level semantics matters

Data Model

Every named value in the graph has shape [N, ...], where N is the leading row dimension. The graph operates on a namespace of named tensors — nodes consume named values and produce new named values. Structured implementations use positional indexing into a flat slot space derived from their input list.

Expression DSL

OMLE includes an elementwise expression sub-DSL for per-column derived computations. Expressions operate on [N] columns using a versioned set of 61 primitives (arithmetic, comparison, logical, math, conditional, null handling, string, date, type conversion, value mapping). The expression language is separate from the graph operator set — graph nodes handle structurally interesting operations, expressions handle elementwise math.

Scope Isolation

CompositeNode introduces local namespaces for subgraph isolation. Internal nodes only see names explicitly passed as inputs — no transitive visibility into enclosing scopes. This enables clean composition of preprocessing pipelines and multi-model architectures without name collisions.

Installation

The omle Python package is the reference implementation: the in-memory IR, protobuf serialization, validation, and the omle CLI.

# Core SDK (IR types, protobuf I/O, validation, CLI)
pip install omle

# With individual components
pip install "omle[convert]"   # converters (scikit-learn, Spark ML, XGBoost, LightGBM, CatBoost)
pip install "omle[runtime]"   # C++ inference runtime
pip install "omle[viewer]"    # Jupyter / browser DAG viewer

# Everything
pip install "omle[all]"

Requires Python 3.10+. protobuf is the only required dependency.

Quick Start

import omle

# Load a model — format is inferred from the extension
# (.omle / .pb / .bin → protobuf, .json → JSON)
model = omle.load("model.omle")

# Validate against structural rules and the operator/function registries
result = omle.validate(model)
if not result.is_valid:
    print(result)

# Inspect
print(model.metadata.format_version)
for fw in model.metadata.source_frameworks:
    print(fw.name, fw.version, fw.role)
for node in model.nodes:
    print(node.name, f"{node.domain}.{node.op}")

# Round-trip to JSON for diffing or hand-editing
omle.save(model, "model.json")

Converting a trained model requires omle-convert:

from omle import export_omle

# scikit-learn, XGBoost, LightGBM, CatBoost — pass the fitted model
export_omle(sklearn_pipeline, "model.omle", X=X_test)

# Spark ML — pass a fitted PipelineModel; dataset supplies verification and sample rows
export_omle(pipeline_model, "spark_model.omle", dataset=train_df)

Command-Line Interface

The omle CLI provides tools for working with model files:

# Validate a model file
omle validate model.omle
omle validate model.omle --no-registry

# Inspect a model's structure
omle inspect model.omle
omle inspect model.omle --section nodes
omle inspect model.omle --section metadata
omle inspect model.omle --json

# Open the interactive DAG viewer in a browser (requires omle-viewer)
omle view model.omle

# Convert a model to OMLE format (requires omle-convert).
# The source framework is auto-detected from the file contents or extension.
omle convert model.joblib    output.omle   # scikit-learn
omle convert saved_pipeline/ output.omle   # Spark ML
omle convert model.json      output.omle   # XGBoost JSON (or CatBoost JSON)
omle convert model.txt       output.omle   # LightGBM
omle convert model.cbm       output.omle   # CatBoost native

omle convert forwards all arguments to omle-convert; see its README for the full option set.

Reference

Ecosystem

Package Language Purpose
omle Python This package — IR, protobuf I/O, validation, CLI
omle-convert Python Converters from trained models to .omle
omle-runtime C++ (Python/Java bindings) Inference runtime
omle-viewer Python + TypeScript Interactive DAG viewer for Jupyter and the browser
omle.js TypeScript Browser/Node loader, validator, and execution engine

Converter Status

Provided by omle-convert:

Framework Status Notes
Scikit-Learn Available Pipeline walker; trees, ensembles, linear, SVM, MLP, KNN, Naive Bayes, clustering, anomaly detection, decomposition, text, preprocessing; category_encoders supported
Spark ML Available Live (PySpark) and no-Spark (saved-format reader via pyarrow) paths; XGBoost4J and SynapseML LightGBM models
XGBoost Available Sklearn wrappers, native Booster, and .json files
LightGBM Available Sklearn wrappers, native Booster, and .txt files
CatBoost Available Sklearn wrappers and .cbm / .json files
PMML Planned Round-trip fidelity for the compliance audience

Contributing

OMLE is in active development. The proto schema and registries are stabilizing toward a v1 release. See CONTRIBUTING.md for development setup and the checks a change needs to pass, and CODE_OF_CONDUCT.md for community expectations.

Contributions are welcome in:

  • Converter implementations
  • Runtime implementations
  • Validation tooling
  • Documentation and specification refinements

License

Apache License v2.0

Release files for omle 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for omle 0.1.0
File Size Uploaded
omle-0.1.0.tar.gz 185.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for omle 0.1.0
File Interpreter ABI Platform
omle-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 286.9 kB

Release files / omle-0.1.0.tar.gz

Download URL omle-0.1.0.tar.gz
Size 185.7 kB
Tags Source
SHA-256 checksum
How to use checksums
17968ae25c19be4d9ac6bdaefdf3edb556781a599816c610d134c2b3ab836a9f
BLAKE2b-256 checksum
How to use checksums
bf47fea0dee8b6727f19ef31ca2291e83c4f90d89c0cca9f8bb23ecfb42c8170
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 16, 2026.

Transparency log

Release files / omle-0.1.0-py3-none-any.whl

Download URL omle-0.1.0-py3-none-any.whl
Size 101.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a915f3cd048e42fe886642af948376a57ade8edc2f0cd1ebed15a9a3e23bee03
BLAKE2b-256 checksum
How to use checksums
16718c91986f94bb4f25691a62427295c956d75869e5e77b6864d70e5864261e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 16, 2026.

Transparency log
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page