skillfed

sna4onnx

Simple node addition tool for onnx. Simple Node Addition for ONNX.

sna4onnx v1.0.6 82.7K downloads/30d#14,142 on PyPI5
Permissive license MIT License Abandoned released

What it is and what it does

sna4onnx is a command-line and Python library tool for inserting new ONNX operators into existing model graphs. It lets you specify source and destination connection points, then injects a new operation between them while preserving model structure. The tool works by taking an input ONNX file, defining the new operator type and its input/output variables and attributes, and wiring it into the graph at the specified nodes.

The package is designed to work alongside other ONNX manipulation tools like sog4onnx (which generates operators) and snc4onnx (which merges model parts). It performs full model consistency checks after insertion and outputs the modified model even if warnings are raised. Only one operator can be added per invocation, and unconnected input/output variables are automatically added to the graph's input/output definitions.

Use it for:

  • Insert preprocessing or postprocessing operations into an existing ONNX model pipeline.
  • Add custom operators between model layers for debugging or feature extraction.
  • Inject normalization, scaling, or transformation nodes into a frozen model graph.
  • Combine operator generation (via sog4onnx) with graph insertion for model modification workflows.
  • Modify model architecture by adding intermediate operations without retraining.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Adds new operations (nodes) to ONNX model graphs at specified connection points, allowing insertion of custom operators between existing model layers.

No—the project is abandoned (last update 2022-09-09). While the tool itself is permissively licensed and has low install friction, the lack of maintenance means no bug fixes, no compatibility updates for modern ONNX or Python versions, and no support for new operator types. Use only if you have a specific, stable use case with an older ONNX version and are willing to maintain a fork yourself.

Install

sna4onnx on PyPI

pip

pip install sna4onnx

uv

uv add sna4onnx

poetry

poetry add sna4onnx

Installing sna4onnx

Before you install

Low friction install with a single runtime dependency (sog4onnx). However, the project is abandoned—last commit was 2022-09-09 with no updates since. No active maintenance or bug fixes should be expected.

License in practice

MIT License permits commercial and private use with minimal restrictions, making it safe from a licensing perspective for most projects.

Quickstart

pip install sna4onnx

from sna4onnx import add

model = add(
    connection_src_op_output_names=[["OpA", "out1", "NewOp", "in1"]],
    connection_dest_op_input_names=[["NewOp", "out1", "OpB", "in1"]],
    add_op_type="Add",
    add_op_name="NewOp",
    input_onnx_file_path="model.onnx"
)

Requires Python >=3.6; sog4onnx must also be installed as a runtime dependency.

Verify before relying

  • Whether sog4onnx (the single runtime dependency) is actively maintained or also abandoned.
  • Compatibility with recent ONNX versions and modern Python releases beyond 3.6.
  • Whether the abandoned status affects real-world usability for stable ONNX model editing tasks.

Package facts

License MIT License (permissive)
Python support supports the current Python release (>=3.6)
Install friction low — pure-Python wheel
Runtime dependencies 1 — sog4onnx
Maintenance abandoned — 1,435 days since the last release
Last repo commit
First released
Downloads 82,700/month — #14,142 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: sna4onnx-1.0.6-py3-none-any.whl

Tags

onnx node insertionadd operations to onnx modelsonnx graph modificationinsert operators between onnx nodesonnx model editing toolonnx op injectionmodify onnx graph structure
onnx-toolsmodel-editingabandoned

More Artificial Intelligence packages