--- id: onnxruntime-extensions version: "0.15.2" license: MIT License license_treatment: permissive maintenance: active --- # onnxruntime_extensions — ONNXRuntime Extensions License: permissive · Maintenance: active · Downloads: 207.9K/mo ## What it is and what it does ONNXRuntime-Extensions is a C/C++ library that plugs into ONNX Runtime to add custom operators for common pre- and post-processing tasks in vision, text, and NLP models. It works by registering a custom operator library with an ONNX Runtime session, allowing you to build enhanced ONNX models that include these operators and run them end-to-end without leaving the ONNX Runtime inference engine. The package provides Python bindings (plus Java and C# support) and includes utilities to convert Hugging Face transformer data processing classes into ONNX graphs that can be merged with your model. The typical workflow is to generate or enhance an ONNX model with preprocessing operators, then load it with ONNXRuntime-Extensions registered to handle those custom ops during inference. It supports Windows, macOS, Linux, and mobile platforms like Android and iOS, with compiled wheels available for recent Python versions. Use it for: - Embed tokenization and text normalization directly in ONNX models for end-to-end NLP inference without Python preprocessing. - Add image resizing, normalization, and augmentation operators to vision models for deployment without external preprocessing. - Convert Hugging Face transformer preprocessing pipelines into ONNX graphs for portable, framework-agnostic model deployment. - Build mobile-ready ONNX models with built-in preprocessing for Android and iOS inference. - Combine multiple models with standardized pre- and post-processing in a single ONNX graph. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Extends ONNX Runtime with custom operators for pre- and post-processing in vision, text, and NLP models, available as a C/C++ library with Python, Java, and C# bindings. Yes, if you are building ONNX-based inference pipelines and need to embed preprocessing or postprocessing operators directly in your models. The package is actively maintained, has no known vulnerabilities, and uses a permissive MIT license. Install friction is moderate due to compiled wheels, but prebuilt binaries are available for common platforms and Python versions. Not necessary if you handle all preprocessing in application code before inference. ## Install pip install onnxruntime-extensions uv add onnxruntime-extensions poetry add onnxruntime-extensions ## Installing onnxruntime_extensions Before you install: Medium install friction due to compiled wheels for multiple Python versions and platforms (cp310–cp313 on macOS and Linux). Repository is actively maintained with recent commits and no archived status. License in practice: MIT License permits commercial and private use with minimal restrictions; suitable for most production deployments. Quickstart: pip install onnxruntime-extensions import onnxruntime as _ort from onnxruntime_extensions import get_library_path as _lib_path so = _ort.SessionOptions() so.register_custom_ops_library(_lib_path()) # sess = _ort.InferenceSession(model, so) Requires onnxruntime to be installed separately; ONNX package needed for generating pre-/post-processing models. Verify before relying: - Whether the package works with all Python versions or only cp310–cp313 as wheel availability suggests. - Specific minimum versions of onnxruntime required for compatibility. - Performance characteristics or overhead of custom operator registration. ## Package facts - License: MIT License (permissive) - Python support: unspecified - Install friction: medium - Maintenance: active - Downloads: 207.9K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags onnx runtime custom operators, onnx model preprocessing, vision nlp text processing onnx, onnx runtime extensions, custom ops for onnx inference, onnx model post-processing, huggingface transformer onnx, onnx-inference, model-preprocessing, custom-operators [View on SkillFed](https://skillfed.io/packages/onnxruntime-extensions) · [View on PyPI](https://pypi.org/project/onnxruntime-extensions/)