--- id: onnxmltools version: "1.16.0" license: Apache-2.0 license_treatment: permissive maintenance: active --- # onnxmltools — Converts Machine Learning models to ONNX License: permissive · Maintenance: active · Downloads: 902.5K/mo ## 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 above — 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 pip install onnxmltools uv add onnxmltools 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_current - Install friction: low - Maintenance: active - Downloads: 902.5K/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags convert models to onnx, ml model format conversion, tensorflow to onnx, sklearn model export, xgboost onnx converter, lightgbm onnx export, cross-framework model interchange, model-conversion, onnx, ml-interop [View on SkillFed](https://skillfed.io/packages/onnxmltools) · [View on PyPI](https://pypi.org/project/onnxmltools/)