$npx skillfedfor your agent

onnx-graphsurgeon

ONNX GraphSurgeon

Worth itPyPI Artificial IntelligenceReleased Apr 2026752.0K downloads / moApache 2.0Pure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — onnx_graphsurgeon-0.6.1-py2.py3-none-any.whl
v0.6.1 · released 2026-04-08 · 3 runtime deps: ml-dtypes, numpy, onnx

Yes. The package is actively maintained, has no known vulnerabilities, installs with minimal friction, and solves a real problem for anyone working with ONNX models programmatically. The permissive Apache 2.0 license poses no restrictions. Install it if you need to create or modify ONNX graphs in code.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Installation is straightforward with low friction; the package is a pure Python wheel with only three runtime dependencies (numpy, onnx, ml-dtypes).
  • The project shows active maintenance with a recent release and steady repository activity.

License · maintenance · safety

Apache 2.0 (permissive) — Apache 2.0 is a permissive license, allowing you to use, modify, and distribute the package freely in both open-source and commercial projects, provided you include a copy of the license and state any significant changes.

last release 2026-04-08 (128 days) · last repo commit 2026-08-04 · 13,250 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 751,950 downloads/mo, #5,155 on PyPI

Verify before relying

import onnx_graphsurgeon as gs
import onnx

# Load an ONNX model
graph = gs.import_onnx(onnx.load("model.onnx"))

# Modify the graph (e.g., cleanup unused nodes)
graph.cleanup()

# Export back to ONNX
onnx.save(gs.export_onnx(graph), "modified_model.onnx")
  • Whether the package supports all ONNX operator types and opset versions
  • Performance characteristics when working with very large models
  • Whether external data handling works seamlessly with all model types
Same gist for agents: .md · .json

What it is and what it does

ONNX GraphSurgeon is a Python library for creating and modifying ONNX neural network models. It provides an intermediate representation (IR) layer that abstracts away ONNX's low-level details, letting you work with graphs, nodes, and tensors as Python objects. You can import ONNX models, manipulate their structure by adding, removing, or rewiring nodes and tensors, and export the result back to ONNX format.

The library is organized around three main components: importers (to load ONNX models into the IR), the IR itself (where all modifications happen), and exporters (to write modified graphs back to ONNX). It handles both in-memory models and models with externally stored data. Common operations include topological sorting, cleanup of unused nodes, and direct manipulation of tensor values and node attributes.

Use it for

  • Remove unused layers or nodes from ONNX models before deployment to reduce size
  • Programmatically build custom ONNX models from scratch without writing raw protobuf
  • Debug and visualize neural network graphs by inspecting nodes, tensors, and their connections
  • Adapt models by inserting, removing, or rewiring layers for transfer learning workflows
  • Automate model transformations as part of a model compilation or optimization pipeline

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

Worth it

Yes.

The package is actively maintained, has no known vulnerabilities, installs with minimal friction, and solves a real problem for anyone working with ONNX models programmatically. The permissive Apache 2.0 license poses no restrictions. Install it if you need to create or modify ONNX graphs in code.

Install

onnx-graphsurgeon on PyPI

Before you install

Installation is straightforward with low friction; the package is a pure Python wheel with only three runtime dependencies (numpy, onnx, ml-dtypes). The project shows active maintenance with a recent release and steady repository activity.

License in practice

Apache 2.0 is a permissive license, allowing you to use, modify, and distribute the package freely in both open-source and commercial projects, provided you include a copy of the license and state any significant changes.

Quickstart

import onnx_graphsurgeon as gs
import onnx

# Load an ONNX model
graph = gs.import_onnx(onnx.load("model.onnx"))

# Modify the graph (e.g., cleanup unused nodes)
graph.cleanup()

# Export back to ONNX
onnx.save(gs.export_onnx(graph), "modified_model.onnx")

Verify before relying

  • Whether the package supports all ONNX operator types and opset versions
  • Performance characteristics when working with very large models
  • Whether external data handling works seamlessly with all model types

Package facts

LicenseApache 2.0 permissive
Python supportNot specified
Install frictionLow. Pure-Python wheel
Runtime dependencies
3 packages
ml-dtypesnumpyonnx
MaintenanceActively maintained 128 days since the last release
Last repo commit
First released
Downloads751,950 / month, #5,155 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
Intended Audience :: DevelopersProgramming Language :: Python :: 3

Evidence: onnx_graphsurgeon-0.6.1-py2.py3-none-any.whl

Tags

Capabilities
onnx model editinggraph modification libraryneural network model manipulationonnx ir intermediate representationcreate onnx models programmaticallyonnx graph transformationmodel graph surgery
Topics
model-optimizationonnx-toolsgraph-manipulation

Let your AI agent find packages like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.

wish › “neural network model manipulation”

  • onnx-graphsurgeonONNX GraphSurgeon lets you programmatically create and modify ONNX…
  • equinoxEquinox provides neural network and model building on top of JAX with…
  • snc4onnxMerges multiple ONNX neural network models into a single combined…

Give your agent the search over MCP, or paste the wish link into any chat.

More Artificial Intelligence packages

litellm With conditions
PyPI · Artificial Intelligence · released Aug 2026

LiteLLM provides a unified Python interface to call 100+ LLM providers (OpenAI, Anthropic, Gemini, Bedrock, Azure, and others) using OpenAI-compatible API format, available as both a Python SDK and a self-hosted AI Gateway proxy server.

Install it if you need to work with multiple LLM providers or want to centralize LLM routing in your organization.

MITcompiled wheel
682.8Mdownloads / mo
huggingface-hub Worth it
PyPI · Artificial Intelligence · released Aug 2026

Client library and CLI tool for downloading, uploading, and managing models, datasets, and repositories on the Hugging Face Hub platform.

Install it if you work with Hugging Face Hub models or datasets.

Apache-2.0pure Python · 3.10.0+
442.4Mdownloads / mo
langchain Worth it
PyPI · Python Modules · released Aug 2026

LangChain provides a framework for building agents and LLM-powered applications by composing language models, tools, and memory through a unified API that abstracts over multiple model providers.

MITpure Python
315.4Mdownloads / mo
hf-xet With conditions
PyPI · Artificial Intelligence · released Aug 2026

hf-xet provides chunk-based deduplication and efficient file transfer for the Hugging Face Hub, enabling faster uploads and downloads of large files with local disk caching.

Apache-2.0compiled wheel · 3.8+
258.4Mdownloads / mo
tokenizers Worth it
PyPI · Artificial Intelligence · released Apr 2026

Tokenizers converts raw text into token sequences for NLP models, with support for training custom vocabularies and using pre-built tokenizers (BPE, WordPiece) optimized for speed via Rust.

Apache-2.0compiled wheel · 3.10+
222.9Mdownloads / mo
transformers Worth it
PyPI · Artificial Intelligence · released Aug 2026

Transformers provides a unified framework for loading, fine-tuning, and running state-of-the-art pretrained models across text, vision, audio, video, and multimodal tasks using PyTorch, JAX, or TensorFlow.

Install it if you need to run or train any transformer-based model for NLP, vision, audio, or multimodal tasks.

permissive licensepure Python · 3.10.0+
186.6Mdownloads / mo

See also onnx-ir · snd4onnx · soa4onnx · onnxsim · sor4onnx · sog4onnx · tf2onnx · onnx2torch · onnxscript · cotengra