# onnxsim/onnxsim

Simplify your onnx model

Repository: https://github.com/onnxsim/onnxsim
Canonical: https://ross.abutalabs.com/products/onnxsim
Homepage: https://onnxsim.github.io/onnxsim/
Language: C++
License: Apache-2.0
License Family: permissive
Topics: deep-learning, onnx, pytorch
Last push: 2026-08-26T14:47:40+00:00

## Health v2 (maintenance only)
Score: 98/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 99, release rhythm 97, longevity 100
- inputs: {"age_days": 2711, "days_push": 7, "days_rel": 21, "gap_med": 7, "n_releases_24m": 10}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 4390, forks 432 (observed 2026-08-28T04:08:47.224095+00:00)

## What it is
ONNX Simplifier (onnxsim) is a tool that simplifies ONNX models by inferring the whole computation graph and replacing redundant operators with their constant outputs via constant folding. It is available as a Python package/CLI, a C++ tool, and a WebAssembly build that runs entirely in the browser.

## Use cases
- simplify an onnx model exported from pytorch
- remove redundant operators from an onnx graph via constant folding
- fuse batchnorm into conv in an onnx model
- run shape inference on an onnx model
- verify a simplified onnx model produces the same outputs as the original
- optimize onnx models before deploying to mobile or edge runtimes
- inspect and simplify onnx models in the browser without uploading them

## When to choose
- you exported a model to ONNX and the graph is more complicated than expected
- you want smaller, faster-loading ONNX models for inference deployment
- you need to fold constants or apply graph optimization passes to ONNX models
- you want a privacy-preserving, browser-based ONNX simplification tool

## When to avoid
- you need to train or quantize models rather than simplify inference graphs
- you work with non-ONNX model formats like raw TensorFlow or PyTorch checkpoints
- you need a full model conversion framework rather than a simplifier

## Facets
- artifact type: cli-tool
- maturity: active
- function: machine-learning, compiler, developer-tools
- domain: deep-learning, machine-learning, developer-tools
- platform: python, cpp, cli, browser, wasm, cross-platform
- tags: onnx, constant-folding, graph-optimization, shape-inference, model-optimization, pytorch

## Member repositories
- onnxsim/onnxsim (main) score 98

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:08:47.224095+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T18:21:12.889679+00:00, confidence not recorded.
  - readme: https://github.com/onnxsim/onnxsim (fetched 2026-08-28T04:08:47.224095+00:00, sha 5bb16ad52010)
  - homepage: https://onnxsim.github.io/onnxsim/ (fetched 2026-08-29T09:09:09.248074+00:00, sha 09734c4e6333)
- Data as of 2026-08-30T08:39:29.467469+00:00.
