v0.1.0 — Initial 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
🔍 Inspection — onnx-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 visualization — onnx-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.gitStats
- 8 source modules, ~2,500 lines
- 12 passing tests
- Python 3.10+ support
- Zero external API dependencies