skl2onnx
Convert scikit-learn models to ONNX
Decision gist · record as of 2026-08-14
Yes. The package is actively maintained, has no known vulnerabilities, installs with minimal friction, and solves a real deployment problem—getting scikit-learn models into a portable format. Use it if you need to deploy scikit-learn models outside their native environment.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Low friction install with only two runtime dependencies (onnx and scikit-learn).
- The package is actively maintained with a recent release and no known vulnerabilities.
License · maintenance · safety
Apache License v2.0 (permissive) — Apache License v2.0 is permissive, allowing use in commercial and private projects with minimal restrictions beyond attribution and liability disclaimers.
last release 2026-01-30 (196 days) · last repo commit 2026-08-07 · 628 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 2,556,584 downloads/mo, #3,002 on PyPI
Alternatives
Verify before relying
pip install skl2onnx
from skl2onnx import to_onnx
clr = RandomForestClassifier()
clr.fit(X_train, y_train)
onx = to_onnx(clr, X[:1])
with open("model.onnx", "wb") as f:
f.write(onx.SerializeToString())- Whether all scikit-learn model types are supported or only a subset (documentation mentions 'Supported scikit-learn Models' page but list not provided)
- Performance improvement magnitude when using ONNX Runtime versus native scikit-learn inference
- Compatibility with custom scikit-learn estimators or only built-in models
- Whether external converters can be registered for models from libraries beyond scikit-learn
What it is and what it does
skl2onnx is a converter that takes trained scikit-learn models and transforms them into ONNX (Open Neural Network Exchange) format, an open standard for representing machine learning models. Once converted, models can be deployed and executed using ONNX Runtime or other ONNX-compatible inference engines. The package handles scikit-learn pipelines, individual models, and transformers, with support for external converters to extend functionality. It supports opset 21 and has been tested against onnxruntime.
The conversion workflow is straightforward: train a scikit-learn model, call to_onnx() with a sample input, serialize the result, and load it into an inference runtime. This is useful for deploying models in production environments where portability or interoperability with other ML frameworks matter.
Use it for
- Deploy scikit-learn models to production systems using ONNX Runtime.
- Convert scikit-learn pipelines to a portable format that can run on different platforms or languages via ONNX.
- Integrate scikit-learn models into applications that require ONNX format for compatibility with existing inference infrastructure.
- Export trained models for use in edge devices or resource-constrained environments where ONNX Runtime is available.
- Register external converters to extend ONNX support for models or transformers from external libraries.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
The package is actively maintained, has no known vulnerabilities, installs with minimal friction, and solves a real deployment problem—getting scikit-learn models into a portable format. Use it if you need to deploy scikit-learn models outside their native environment.
Install
skl2onnx on PyPI
Before you install
Low friction install with only two runtime dependencies (onnx and scikit-learn). The package is actively maintained with a recent release and no known vulnerabilities.
License in practice
Apache License v2.0 is permissive, allowing use in commercial and private projects with minimal restrictions beyond attribution and liability disclaimers.
Quickstart
pip install skl2onnx
from skl2onnx import to_onnx
clr = RandomForestClassifier()
clr.fit(X_train, y_train)
onx = to_onnx(clr, X[:1])
with open("model.onnx", "wb") as f:
f.write(onx.SerializeToString())
Verify before relying
- Whether all scikit-learn model types are supported or only a subset (documentation mentions 'Supported scikit-learn Models' page but list not provided)
- Performance improvement magnitude when using ONNX Runtime versus native scikit-learn inference
- Compatibility with custom scikit-learn estimators or only built-in models
- Whether external converters can be registered for models from libraries beyond scikit-learn
Package facts
| License | Apache License v2.0 permissive |
| Python support | Supports the current Python release >=3.8 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 2 packagesonnxscikit-learn |
| Maintenance | Actively maintained 196 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 2,556,584 / month, #3,002 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 4 - BetaEnvironment :: ConsoleIntended Audience :: DevelopersLicense :: OSI Approved :: Apache Software LicenseOperating System :: MacOS :: MacOS XOperating System :: Microsoft :: WindowsProgramming Language :: PythonProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9 |
Evidence: skl2onnx-1.20.0-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “scikit-learn to ONNX conversion”
- skl2onnxConverts trained scikit-learn models to ONNX format for deployment…
- onnxconverter-commonProvides common utilities and functions for converting machine…
- onnxmltoolsConverts machine learning models from multiple frameworks…
Give your agent the search over MCP, or paste the wish link into any chat.
More Artificial Intelligence packages
LiteLLM provides a unified Python interface to call 100+ LLM providers (OpenAI, Anthropic, Gemini, Bedrock, Azure, and others) using OpenAI-compatible API format, available as both a Python SDK and a self-hosted AI Gateway proxy server.
Install it if you need to work with multiple LLM providers or want to centralize LLM routing in your organization.
Client library and CLI tool for downloading, uploading, and managing models, datasets, and repositories on the Hugging Face Hub platform.
Install it if you work with Hugging Face Hub models or datasets.
LangChain provides a framework for building agents and LLM-powered applications by composing language models, tools, and memory through a unified API that abstracts over multiple model providers.
hf-xet provides chunk-based deduplication and efficient file transfer for the Hugging Face Hub, enabling faster uploads and downloads of large files with local disk caching.
Tokenizers converts raw text into token sequences for NLP models, with support for training custom vocabularies and using pre-built tokenizers (BPE, WordPiece) optimized for speed via Rust.
Transformers provides a unified framework for loading, fine-tuning, and running state-of-the-art pretrained models across text, vision, audio, video, and multimodal tasks using PyTorch, JAX, or TensorFlow.
Install it if you need to run or train any transformer-based model for NLP, vision, audio, or multimodal tasks.
See also onnxmltools · optimum-onnx · onnx · onnx-weekly · onnxconverter-common · onnxsim · onnxruntime · onnx2torch · tf2onnx · onnxruntime-gpu