Skip to content

v0.1.0 — Initial Release

Choose a tag to compare

@Luv-Goel Luv-Goel released this 10 May 04:44
· 6 commits to main since this release

🔪 ONNX Model Surgery v0.1.0

First public release. A terminal workbench for inspecting, pruning, patching, and optimizing ONNX models — no API keys, no cloud, no GPU required.

What's inside

🔍 Inspectiononnx-surgery info model.onnx gives you a complete structural dump: IR version, opsets, every node, every tensor shape, parameter sizes. JSON export for scripting.

📊 Graph visualizationonnx-surgery graph renders the full model topology as ASCII right in your terminal. Optional Graphviz DOT generation for pretty PNGs.

✂️ Pruning — Drop entire op types (--op-types Dropout Identity), keep only named nodes, or prune isolated subgraphs automatically.

🔧 Patching — Replace any node's operation, inputs, or outputs. Rename tensors across the entire model. Insert new nodes.

🧹 Stripping — Remove unused initializers, fold Identity nodes, eliminate dangling subgraphs.

✅ Validation — Runs the official ONNX checker and reports any structural issues.

Installation

pip install onnx numpy rich
pip install git+https://github.com/Luv-Goel/onnx-model-surgery.git

Stats

  • 8 source modules, ~2,500 lines
  • 12 passing tests
  • Python 3.10+ support
  • Zero external API dependencies