onnx
Open Neural Network Exchange
What it is and what it does
ONNX is a standardized, open-source format for representing machine learning models—both deep learning and traditional ML—along with a Python package for loading, inspecting, and manipulating those models. It defines an extensible computation graph model, built-in operators, and standard data types, with a focus on inference (scoring). The package lets you load ONNX model files, validate their structure, perform shape and type inference, and convert between opset versions.
ONNX is widely adopted across frameworks (PyTorch, TensorFlow, scikit-learn, and others) and hardware platforms, making it a bridge between research and production. By using ONNX, you can train a model in one framework and deploy it with a different runtime or hardware accelerator without rewriting inference code. The Python package depends on numpy, protobuf, typing_extensions, and ml_dtypes, and provides abi3-compatible wheels for Python 3.12 and later, allowing a single binary to work across multiple Python versions.
Use it for:
- Export a model trained in PyTorch or TensorFlow to ONNX format for deployment on edge devices or inference servers.
- Load and validate ONNX models to ensure they conform to the specification before production use.
- Convert models between different ONNX opset versions to maintain compatibility across tools and runtimes.
- Perform shape and type inference on ONNX graphs to understand model I/O and intermediate tensor properties.
- Build model optimization and transformation pipelines that work across multiple training frameworks.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
ONNX provides an open-source format and runtime for representing and executing AI models across different frameworks and hardware platforms, enabling model interoperability and inference.
Yes. ONNX is a mature, widely-adopted standard (active maintenance, 21312 stars, top 5000 PyPI package) with no known vulnerabilities, permissive licensing, and broad platform support. Install it if you need to work with ONNX models, export models to ONNX format, or build cross-framework inference pipelines. The medium install friction is manageable given the availability of prebuilt wheels for common platforms and Python versions.
Install
onnx on PyPI
pip
pip install onnxuv
uv add onnxpoetry
poetry add onnxInstalling onnx
Before you install
Medium install friction with prebuilt wheels for common platforms (macOS, Linux x86_64, Windows, ARM) and Python versions 3.10–3.14. Active maintenance with a recent release and 21312 repository stars. Depends on numpy, protobuf, typing_extensions, and ml_dtypes.
License in practice
Apache-2.0 is permissive; you may use, modify, and distribute ONNX freely in commercial and open-source projects, provided you include a copy of the license and note any material changes.
Quickstart
pip install onnx
import onnx
model = onnx.load('model.onnx')
onnx.checker.check_model(model)
Requires Python 3.10 or later. Model files must be in valid ONNX format.
Verify before relying
- Whether the package includes a reference implementation or if optional dependencies are needed for full inference capability.
- Performance characteristics and inference speed compared to native framework execution.
- Supported ONNX opset versions and operator coverage for your specific models.
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | 4 — numpy, protobuf, typing_extensions, ml_dtypes |
| Maintenance | actively maintained — 60 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 20,484,447/month — #1,035 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: onnx-1.22.0-cp310-cp310-macosx_12_0_universal2.whl; onnx-1.22.0-cp310-cp310-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl; onnx-1.22.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl; onnx-1.22.0-cp310-cp310-win32.whl; onnx-1.22.0-cp310-cp310-win_amd64.whl; onnx-1.22.0-cp311-cp311-macosx_12_0_universal2.whl; onnx-1.22.0-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl; onnx-1.22.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl; onnx-1.22.0-cp311-cp311-win32.whl; onnx-1.22.0-cp311-cp311-win_amd64.whl; onnx-1.22.0-cp311-cp311-win_arm64.whl; onnx-1.22.0-cp312-abi3-macosx_12_0_universal2.whl; onnx-1.22.0-cp312-abi3-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl; onnx-1.22.0-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl; onnx-1.22.0-cp312-abi3-pyemscripten_2025_0_wasm32.whl; onnx-1.22.0-cp312-abi3-win32.whl; onnx-1.22.0-cp312-abi3-win_amd64.whl; onnx-1.22.0-cp312-abi3-win_arm64.whl; onnx-1.22.0-cp314-cp314t-macosx_12_0_universal2.whl; onnx-1.22.0-cp314-cp314t-manylinux_2_26_aarch64.manylinux_2_28_aarch64.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
onnx-weeklyonnx-weekly provides a Python package for…
permissive · top 15,000 on PyPI
onnxruntimeonnxruntime loads and executes Open Neural…
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
onnxruntime-gpuExecutes ONNX machine learning models on GPU…
permissive · top 5,000 on PyPI
onnxsimSimplifies ONNX neural network models by…
permissive · top 15,000 on PyPI
onnx-ironnx-ir provides an in-memory intermediate…
permissive · top 5,000 on PyPI
onnxruntime_extensionsExtends ONNX Runtime with custom operators for…
permissive · top 15,000 on PyPI
onnxmltoolsConverts machine learning models from multiple…
permissive · top 5,000 on PyPI
multi-model-serverMulti Model Server is a tool for serving deep…
permissive · top 15,000 on PyPI