This `onnx-proto` package provides pre-compiled Protobuf definitions for the Open Neural Network Exchange (ONNX) format, specifically derived from the upstream `onnx/onnx.proto3` file. It enables JavaScript and TypeScript projects to interact with ONNX models by offering type-safe access to the ONNX IR (Intermediate Representation) structures, encompassing messages like `ModelProto`, `GraphProto`, `NodeProto`, and `TensorProto`. The current stable version is 8.0.1, reflecting the latest ONNX IR_VERSION 8 (corresponding to ONNX v1.10.2). Releases are automatically published to npm from the master branch whenever the underlying ONNX definition is updated or significant maintenance occurs, ensuring developers have timely access to the latest ONNX specification. Its key differentiator is being a direct, pre-compiled, and type-safe representation of the official ONNX protobuf schema, saving users the complexity of generating Protobuf code themselves for JavaScript and TypeScript environments.
npm install onnx-protoVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to import the `onnx` namespace and construct a basic `TensorProto` using its static `create` method, illustrating the package's utility for creating ONNX data structures.
Review the official ONNX release notes for v1.10.2 and migrate any model serialization/deserialization logic to accommodate IR_VERSION 8. Thoroughly test your application with models compiled against the new IR version.
Consult the changelog for `onnx-proto` and the corresponding ONNX `IR_VERSION` to understand any structural changes introduced by specific package versions.
To perform ONNX model inference in JavaScript environments, use a dedicated ONNX Runtime library such as `onnxruntime-web` or `onnxruntime-node` in conjunction with these definitions for structure validation and serialization.
Always use the static `create` method provided on each protobuf message constructor, e.g., `onnx.TensorProto.create({ ... })`.Ensure you are accessing the specific protobuf message via the `onnx` namespace, like `onnx.TensorProto.create()`.
Configure your `package.json` with `"type": "module"` if targeting a pure ES module environment, or use a bundler (e.g., Webpack, Rollup) with Babel or TypeScript to transpile to CommonJS if targeting older Node.js or specific browser environments.
Always instantiate Protobuf messages using their static `create` method: `onnx.TensorProto.create({ ... })`.No dependency data recorded yet.