onnxmltools
Converts Machine Learning models to ONNX
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 onnxmltoolsuv
uv add onnxmltoolspoetry
poetry add onnxmltoolsInstalling 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
Tags
More Artificial Intelligence packages
LiteLLM provides a unified Python interface to…
permissive · top 100 on PyPI
huggingface-hubClient library and CLI tool for downloading,…
permissive · top 100 on PyPI
langchainLangChain provides a framework for building…
permissive · top 1,000 on PyPI
hf-xethf-xet provides chunk-based deduplication and…
permissive · top 1,000 on PyPI
tokenizersTokenizers converts raw text into token…
permissive · top 1,000 on PyPI
transformersTransformers provides a unified framework for…
permissive · top 1,000 on PyPI
onnxconverter-commonProvides common utilities and functions for…
permissive · top 5,000 on PyPI
skl2onnxConverts trained scikit-learn models to ONNX…
permissive · top 5,000 on PyPI
tf2onnxConverts TensorFlow, Keras, TensorFlow.js, and…
permissive · top 15,000 on PyPI
onnx2torchConverts ONNX models to PyTorch modules with a…
permissive · top 15,000 on PyPI
coremltoolsConverts trained machine learning models from…
permissive · top 5,000 on PyPI
sklearn2pmmlConverts fitted Scikit-Learn pipelines to PMML…
agpl · top 15,000 on PyPI
orbax-exportOrbax Export serializes JAX models to…
permissive · top 15,000 on PyPI
netronNetron is a viewer for neural network and…
permissive · top 15,000 on PyPI
tensorflowjsConverts TensorFlow models to TensorFlow.js…
permissive · top 5,000 on PyPI
onnx2tfConverts ONNX model files to LiteRT,…
permissive · top 5,000 on PyPI