--- id: sne4onnx version: "2.0.1" license: MIT License license_treatment: permissive maintenance: active --- # sne4onnx — A very simple tool for situations where optimization with onnx-simplifier would exceed the Protocol Buffers upper file size limit of 2GB, or simply to separate onnx files to any size you want. Simple Network Extraction for ONNX. License: permissive · Maintenance: active · Downloads: 127.8K/mo ## What it is and what it does sne4onnx is a lightweight utility for extracting subgraphs from ONNX neural network models. It takes an ONNX file and a pair of input and output operation names, then isolates the computation graph between those points and writes a new, smaller ONNX file. The tool was built to address a specific problem: when onnx-simplifier optimization would push a model past the Protocol Buffers 2GB file size limit, or when you simply want to partition a large model into smaller pieces for deployment or analysis. The package provides both a command-line interface and a Python API. It implements its own graph extraction logic rather than relying on the slower onnx.utils.extractor.extract_model function. With no runtime dependencies and support for Python versions >=3.6, it integrates easily into existing ONNX workflows. The tool is commonly used in model optimization pipelines, particularly in computer vision and deep learning contexts where model size and inference latency matter. Use it for: - Extract a specific layer or stage from a large ONNX model to debug or profile that portion independently. - Split an oversized ONNX model into smaller subgraphs to stay under the 2GB Protocol Buffers limit. - Isolate a trained backbone or encoder from a full model for transfer learning or fine-tuning. - Partition a multi-stage inference pipeline (e.g., preprocessing, main model, postprocessing) into separate deployable units. - Reduce model file size for embedded or edge deployment by keeping only the necessary computation graph. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Extracts subgraphs from ONNX model files by specifying input and output operation names, generating smaller ONNX files without the overhead of standard extraction methods. Yes. The package is lightweight, actively maintained, has no runtime dependencies, carries a permissive MIT license, and solves a real problem in ONNX model workflows—particularly when dealing with large models or size constraints. Install it if you work with ONNX models and need to extract subgraphs or partition files by operation boundaries. ## Install pip install sne4onnx uv add sne4onnx poetry add sne4onnx ## Installing sne4onnx Before you install: Low friction: pure Python wheel with no runtime dependencies. Last release was recent (2026-02-24), and the project is actively maintained with a clean repository. License in practice: MIT License permits free use, modification, and distribution with minimal restrictions—suitable for both open-source and proprietary projects. Quickstart: pip install sne4onnx from sne4onnx import extraction extracted_graph = extraction( input_op_names=['aaa','bbb','ccc'], output_op_names=['ddd','eee','fff'], input_onnx_file_path='input.onnx', output_onnx_file_path='output.onnx', ) Requires onnx package to be installed separately (not listed as a dependency in this package). Verify before relying: - Whether onnx is an undeclared runtime dependency or expected to be pre-installed by the user. - Performance characteristics compared to onnx.utils.extractor.extract_model on large models. - Whether the custom extraction logic handles all ONNX opset versions correctly. ## Package facts - License: MIT License (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 127.8K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags onnx model subgraph extraction, split onnx files by size, extract onnx layers by name, onnx graph slicing tool, reduce onnx file size, onnx network extraction, onnx-tools, model-optimization [View on SkillFed](https://skillfed.io/packages/sne4onnx) · [View on PyPI](https://pypi.org/project/sne4onnx/)