ONNX as the Interchange Layer: What the Reference Implementation Actually Gives You
Open standard for machine learning interoperability
At a glance
- What is it?
- The onnx/onnx repository is the reference implementation of the ONNX format, used to define the computation graph model, operators, and data types. This review covers what it does, how to run it, and where its limits are for production inference.
- Who is it for?
- Adopt onnx/onnx if you need a stable, community-governed format for moving models between frameworks, or if you are building a tool that must read or write ONNX graphs. Do not adopt it as your inference runtime; it is a reference implementation, not a performance engine.
- Can I use it commercially?
- Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Yes. The repository last received commits 3 days ago.
- What is it written in?
- Mainly Python, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on September 14, 2026, and from our analysis. They are not legal advice.
DEEP OPEN-SOURCE ANALYSIS
What ONNX Actually Solves
ONNX solves a specific, narrow problem: it gives AI models a common file format so a model trained in PyTorch can be loaded in TensorFlow, or exported to a runtime that runs on a particular GPU. The repository is the reference implementation of that format, not the runtime itself. The README states that ONNX defines an extensible computation graph model, built-in operators, and standard data types, and that it currently focuses on inferencing. The people who need this are engineers who build tooling around models, or who need to move models between frameworks without rewriting them. If you are only training and deploying within one framework, ONNX adds a layer you may not need.
The Mechanism: A Graph Model, Not a Runtime
The core of ONNX is the intermediate representation. A model is a graph of nodes, where each node is an operator, and edges carry tensors with typed data. The repository provides the Python package that lets you construct, inspect, and manipulate these graphs. The README points to a Shape and Type Inference document, which is a key mechanism: given a graph with unknown shapes, the reference implementation can infer the shapes and types of intermediate tensors. This is not a trivial feature; it is what makes it possible to validate a model before sending it to a runtime. The graph optimization and opset version conversion are separate repositories, so the core package does not do heavy optimization. It is a specification with a reference implementation, and the reference part is deliberately simple.
Getting It Running: Pip, Wheels, and ABI3
Installation is straightforward. The README gives the command: pip install onnx, with the optional extra pip install onnx[reference] for the reference implementation dependencies. The package is published on PyPI, and there are weekly builds available as onnx-weekly for early testing. One notable detail is the abi3 compatibility claim: the wheels are built against the Python stable ABI, so a single wheel works across Python 3.12 and later. That is a real maintenance advantage if you support multiple Python versions. To run the tests, you install pytest and run pytest, as the README shows. The build process also sets SOURCE_DATE_EPOCH to the commit timestamp, which supports reproducible builds, though the README is careful to note that this alone does not guarantee identical artifacts unless all other inputs are controlled.
The Python API: What You Can Actually Do
The repository includes a Python API Overview document, and the package gives you the tools to load, save, and manipulate ONNX models. The typical workflow is: you export a model from your training framework to ONNX, then use the Python package to check its opset version, inspect the graph, and run shape inference. This is the layer where you catch problems early, like an unsupported operator or a missing shape. The API is not a high-level inference interface; there is no built-in model runner in the core package. The reference implementation is for correctness, not speed. If you want to execute the graph, you need a separate runtime, which the README does not name but implies by the focus on inferencing and the existence of other tools.
A Genuine Limitation: It Is a Spec, Not a Performance Engine
The biggest limitation is that onnx/onnx is the wrong tool for running models in production. The README explicitly says the focus is on inferencing capabilities, but the core package does not provide a fast execution engine. It is a reference implementation, so its performance is not the point. If you need low latency or high throughput, you will use a runtime like ONNX Runtime, which is a separate project. Another limitation is operator coverage: not every operator from every framework is in the ONNX spec. The README links to a document about adding new operators, which signals that the operator set is finite and subject to a governance process. If your model uses a rare operator, you may need to extend the spec or find a workaround. The versioning principles, linked in the docs, mean that opsets change over time, and you must manage which opset your model targets.
The Alternative: ONNX Runtime and Other Backends
The obvious alternative is ONNX Runtime, which is a separate project that consumes ONNX models and executes them on CPUs, GPUs, and other hardware. The difference in approach is clear: onnx/onnx defines the format and provides reference code for manipulation, while ONNX Runtime is a performance-oriented inference engine. If you are comparing the two, you are not choosing between equals. You usually need both: onnx/onnx to validate and convert your model, and a runtime to run it. Another alternative is to skip ONNX entirely and use a framework-specific format, like PyTorch's .pt or TensorFlow's SavedModel. That works if you never need to cross framework boundaries, but you lose the interoperability that ONNX provides. The trade-off is between a single-vendor format that is simple and a multi-vendor format that requires a spec and a conversion step.
Maintenance and Upgrade Cost
The repository is actively maintained, with a recent release v1.22.0 in June 2026, and the project follows a yearly roadmap process. The maintenance cost for users is tied to opset versioning: when you upgrade the onnx package, you may need to update your models to a newer opset, or at least verify that the older opset is still supported. The versioning principles document, linked in the README, explains how the spec evolves, and it is a governance process with working groups and SIGs. The license is Apache-2.0, which is permissive for commercial use, but the README also mentions a trademark policy, so you cannot use the ONNX name in a misleading way. The reproducible build support is a plus for supply chain security, but it is not a guarantee of byte-for-byte identical artifacts, as the README clearly states. For a project that is a standard, the upgrade cost is mostly about tracking opset changes and re-validating models.
Editorial conclusion
Adopt onnx/onnx if you need a stable, community-governed format for moving models between frameworks, or if you are building a tool that must read or write ONNX graphs. Do not adopt it as your inference runtime; it is a reference implementation, not a performance engine. Before relying on it for a specific model, verify that every operator you use is supported in the ONNX opset you target, and check the shape inference results for your model, since the docs note that not all operators have complete inference rules. If you need faster execution, look at ONNX Runtime or a hardware-specific backend, and treat onnx/onnx as the interchange layer, not the final step.
Community notes