ONNX

Open model file format and Python toolkit that lets networks move between training frameworks and runtimes.

Open SourceSelf HostedOffline Capable
0.0 (0)

About

ONNX gives trained models a shared file format, so a network built in one framework can run on another runtime or compiler. The spec has three pieces: an intermediate representation for computation graphs, a versioned catalog of standard operators grouped into opsets, and a list of tensor data types, all serialized with Protocol Buffers. It targets inference rather than training and covers classic machine learning as well as deep networks. The onnx package from pip is a toolkit for the format, not an execution engine: it builds and validates graphs, infers tensor shapes, converts models between opset versions, and runs operators through an optional pure Python reference backend for testing. Models usually arrive through exporters in PyTorch, TensorFlow and Keras, scikit-learn, or Hugging Face Optimum, then run on engines such as ONNX Runtime; ready-made models live in the onnx-community space on Hugging Face. An open steering committee and SIGs under the Linux Foundation govern it, the code is Apache 2.0, and releases land several times a year. Core knowledge for anyone moving models between stacks.

Should you use ONNX?

Pick it when

Pick this when a model trained in PyTorch, TensorFlow, or scikit-learn must run somewhere else, such as a C++ service, a mobile app, or an engine like ONNX Runtime or OpenVINO, and you want one portable graph file as the hand-off.

Look elsewhere when

ONNX defines the format, not a production runtime, so you still need ONNX Runtime or another engine to serve models. Exports can fail on custom operators, and PyTorch-only apps can use ExecuTorch for devices instead.

Alternatives to ONNX

  • ONNX Runtime

    The engine that executes ONNX graphs fast on CPU, CUDA, TensorRT, and DirectML; you need it, or a similar runtime, alongside the format.

  • Safetensors

    Stores only tensors for safe weight sharing, not the compute graph; simpler when the consumer also runs PyTorch or Transformers code.

  • ExecuTorch

    Exports straight from PyTorch to on-device backends with no intermediate format; PyTorch only, where ONNX accepts many source frameworks.

  • OpenVINO

    A runtime that ingests ONNX among other formats and optimizes for Intel CPUs, GPUs, and NPUs; it consumes the format rather than replacing it, and suits Intel targets.

Reviews (0)

Leave a Review

No reviews yet. Be the first to review!

Details

Price
Free
Platform
Local/Desktop
Difficulty
Easy (2/5)
License
Apache-2.0
Added
Apr 3, 2026

Tags