JavaScript ML Frameworks vs Native JavaScript API
WebNN can be used either through supported JavaScript machine learning frameworks or directly via its native API. Choose the approach that best suits your needs.
ML Frameworks
WebNN API is integrating into major JavaScript machine learning frameworks like ONNX Runtime Web, Transformers.js, and LiteRT. This enables web developers to build AI applications using these high-level frameworks with less codes while leveraging WebNN’s efficient, low-level neural network operations.
Native WebNN API
Use the WebNN API directly to create custom computational graphs and neural network models with greater flexibility in your AI applications.