--- id: onnx-tool version: "1.0.1" license: MIT license_treatment: permissive maintenance: active --- # onnx-tool — A tool for parsing, editing, optimizing, and profiling ONNX models. License: permissive · Maintenance: active · Downloads: 110.9K/mo ## What it is and what it does onnx-tool is a comprehensive toolkit for working with ONNX neural network models. It provides parsing and editing capabilities through an intuitive API, allowing you to load ONNX files, access computation graphs, modify operators and tensor data, and save changes. The package excels at analyzing model structure and performance characteristics through rapid shape inference and detailed profiling that computes MACs, parameter counts, and memory footprint with sparsity awareness. Beyond analysis, the toolkit offers optimization and transformation features including constant folding, operator fusion, weight quantization (FP16, INT8/INT4 with multiple schemes), and activation memory compression. It includes specialized support for large language models with KV cache analysis, diffusion models, and computer vision architectures. The compute graph engine removes shape-calculation overhead for efficient inference integration, making it useful for both model development and deployment preparation. Use it for: - Profile LLM architectures (BERT, GPT, LLaMa, Qwen) to estimate MACs, parameters, and KV cache requirements before deployment - Optimize Stable Diffusion and other diffusion models by analyzing and compressing activation memory across encoder, decoder, and UNet components - Prepare quantized models for edge deployment by analyzing weight compression ratios and memory footprint reduction across INT8/INT4 schemes - Integrate ONNX models into custom inference engines by extracting compute graphs with minimal shape-calculation overhead - Validate model transformations through shape regression testing after applying constant folding or operator fusion optimizations ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Parse, analyze, optimize, and profile ONNX neural network models with support for shape inference, quantization analysis, memory compression, and LLM-specific workloads. Yes. The package fills a genuine need for ONNX model analysis and optimization with low install friction, active maintenance, permissive licensing, and no known vulnerabilities. It is most valuable for developers working with LLMs, diffusion models, or deploying neural networks to resource-constrained environments where profiling and compression are critical. ## Install pip install onnx-tool uv add onnx-tool poetry add onnx-tool ## Installing onnx-tool Before you install: Low friction install with three straightforward runtime dependencies (onnx, numpy, tabulate). Active maintenance with recent commits and steady development since 2022. License in practice: MIT license permits unrestricted use, modification, and distribution with minimal legal friction. Quickstart: pip install onnx-tool from onnx_tool import Model model = Model('model.onnx') graph = model.graph node = graph.nodemap['Conv_0'] model.save_model('modified.onnx') Verify before relying: - Whether shape inference handles all dynamic dimension scenarios in production models - Performance characteristics of the compute graph engine on very large models - Compatibility with ONNX opset versions beyond those explicitly documented ## Package facts - License: MIT (permissive) - Python support: unspecified - Install friction: low - Maintenance: active - Downloads: 110.9K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags onnx model analysis and optimization, neural network profiling tools, llm model compression and quantization, onnx graph transformation, model memory optimization, onnx shape inference, deep learning model toolkit, model-optimization, onnx-ecosystem, llm-tools [View on SkillFed](https://skillfed.io/packages/onnx-tool) · [View on PyPI](https://pypi.org/project/onnx-tool/)