snd4onnx
Simple node deletion tool for onnx.
What it is and what it does
snd4onnx is a lightweight utility for removing named nodes from ONNX model graphs. It works both as a command-line tool and as a Python library, accepting a list of node names to delete and either an input file path or an in-memory graph object, then outputting the modified model. The package has no runtime dependencies beyond Python itself.
The tool is designed for model optimization and experimentation workflows where you need to strip out specific operations from a trained neural network—for instance, removing debug layers, unused branches, or operations incompatible with a target inference engine. The author notes it is a hobby project with limited test coverage and likely bugs, so it is best suited for exploratory work rather than production pipelines.
Use it for:
- Remove debug or instrumentation nodes from a trained ONNX model before deployment.
- Strip out unsupported operations to make a model compatible with a specific inference runtime.
- Simplify a model graph by deleting unused branches or redundant layers during optimization.
- Experiment with model architecture by removing operations to test inference behavior.
- Preprocess models downloaded from model zoos before fine-tuning or conversion.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Removes specified nodes from ONNX model graphs via CLI or Python API, outputting a modified model file or in-memory graph.
Yes, if you need to surgically remove nodes from ONNX graphs and accept the trade-off of limited test coverage. Install friction is minimal and the MIT license is unrestrictive. The aging maintenance status and author's caveat about bugs mean it is best for ad-hoc model editing rather than critical production pipelines; for complex graph surgery, verify behavior on your specific models first.
Install
snd4onnx on PyPI
pip
pip install snd4onnxuv
uv add snd4onnxpoetry
poetry add snd4onnxInstalling snd4onnx
Before you install
Low friction install with no runtime dependencies. Last commit was 2025-10-04 and the package is marked aging, indicating infrequent updates but not abandoned.
License in practice
MIT License permits use, modification, and distribution with minimal restrictions, making it safe for both open and closed projects.
Quickstart
pip install snd4onnx
from snd4onnx import remove
onnx_graph = remove(
remove_node_names=['node_name_a', 'node_name_b'],
input_onnx_file_path='input.onnx'
)
Requires an existing ONNX model file or in-memory onnx.ModelProto object; node names must be known in advance.
Verify before relying
- Whether the tool correctly handles edge cases like nodes with multiple downstream consumers or complex graph topologies beyond the sample patterns shown.
- Performance characteristics when removing nodes from large models.
- Compatibility with all ONNX opset versions and operator types.
Package facts
| License | MIT License (permissive) |
| Python support | supports the current Python release (>=3.6) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | aging — 314 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 83,427/month — #14,076 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: snd4onnx-1.1.7-py3-none-any.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
sde4onnxRemoves embedded doc_strings from ONNX model…
permissive · top 15,000 on PyPI
simple-onnx-processing-toolsA collection of command-line tools for…
permissive · top 15,000 on PyPI
ssc4onnxAnalyzes and displays the structure of ONNX…
permissive · top 15,000 on PyPI
sng4onnxAutomatically generates and assigns operation…
permissive · top 15,000 on PyPI
sod4onnxsod4onnx removes specified output operations…
permissive · top 15,000 on PyPI
ssi4onnxInfers and fills missing tensor shape…
permissive · top 15,000 on PyPI
snc4onnxMerges multiple ONNX neural network models into…
permissive · top 15,000 on PyPI
sne4onnxExtracts subgraphs from ONNX model files by…
permissive · top 15,000 on PyPI
onnx-graphsurgeonONNX GraphSurgeon lets you programmatically…
permissive · top 15,000 on PyPI
svs4onnxSwaps connections between output and input…
permissive · top 15,000 on PyPI