skillfed

onnxmltools

Converts Machine Learning models to ONNX

onnxmltools v1.16.0 902.5K downloads/30d#4,769 on PyPI1,168
Permissive license Apache-2.0 Active released

What it is and what it does

ONNXMLTools is a conversion toolkit that translates trained machine learning models from their native framework formats into ONNX (Open Neural Network Exchange), a standardized model interchange format. It wraps or implements converters for TensorFlow, scikit-learn, Core ML, LightGBM, XGBoost, H2O, CatBoost, Spark ML, and libsvm, allowing models trained in any of these frameworks to be exported as ONNX files that can then run on any ONNX-compatible runtime.

The package depends on numpy, onnx, protobuf, and skl2onnx as core runtime dependencies. Conversion is controlled via a target_opset parameter to ensure compatibility with specific ONNX versions; the converter respects operator set versioning by selecting the maximum opset required by all operators in the model. It is actively maintained, tested with Python 3.9 through 3.13, and has no known security vulnerabilities.

Use it for:

  • Export a scikit-learn classifier to ONNX for deployment on a web service or edge device that only supports ONNX Runtime.
  • Convert a TensorFlow model to ONNX to enable inference on platforms that lack TensorFlow support.
  • Standardize model formats across a team using different ML frameworks by converting all models to ONNX for unified inference pipelines.
  • Prepare a LightGBM or XGBoost model for production by exporting to ONNX to decouple inference from the original training library.
  • Validate model behavior across frameworks by converting to ONNX and running inference to verify numerical consistency.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Converts machine learning models from multiple frameworks (TensorFlow, scikit-learn, Core ML, LightGBM, XGBoost, H2O, CatBoost, Spark ML, libsvm) into ONNX format for cross-platform inference.

Yes. The package is actively maintained, has low install friction, carries a permissive license, and solves a real problem—enabling model portability across ML frameworks. It is well-suited for teams needing to standardize model formats or deploy models on runtimes that require ONNX. Install it when you need to convert models from any of its supported frameworks; skip it if your workflow stays within a single framework's native inference ecosystem.

Install

onnxmltools on PyPI

pip

pip install onnxmltools

uv

uv add onnxmltools

poetry

poetry add onnxmltools

Installing onnxmltools

Before you install

Low friction install with a pure-wheel distribution. Actively maintained with recent commits and a stable release cadence. Requires numpy, onnx, protobuf, and skl2onnx as runtime dependencies, all widely available.

License in practice

Licensed under Apache-2.0 (permissive), allowing use in commercial and proprietary projects with minimal restrictions beyond attribution.

Quickstart

pip install onnxmltools

import onnxmltools

# Convert a model (framework-specific converter called with model object)
onnx_model = onnxmltools.convert_coreml(coreml_model, 'Example Model')
onnxmltools.utils.save_model(onnx_model, 'example.onnx')

Source installation requires setting environment variable ONNX_ML=1 before installing the onnx package; framework-specific converters require those frameworks to be installed separately.

Verify before relying

  • Whether all listed framework converters (Spark ML marked experimental, others not) are production-ready or carry known limitations.
  • Performance characteristics when converting large or complex models across different frameworks.
  • Compatibility matrix between specific framework versions and onnxmltools converter reliability.

Package facts

License Apache-2.0 (permissive)
Python support supports the current Python release (>=3.9)
Install friction low — pure-Python wheel
Runtime dependencies 4 — numpy, onnx, protobuf, skl2onnx
Maintenance actively maintained — 196 days since the last release
Last repo commit
First released
Downloads 902,456/month — #4,769 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: onnxmltools-1.16.0-py3-none-any.whl

Development Status :: 4 - BetaEnvironment :: ConsoleIntended Audience :: DevelopersProgramming Language :: PythonProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.9

Tags

convert models to onnxml model format conversiontensorflow to onnxsklearn model exportxgboost onnx converterlightgbm onnx exportcross-framework model interchange
model-conversiononnxml-interop

More Artificial Intelligence packages