144 releases (stable)

Uses new Rust 2024

39.0.1 Nov 24, 2025
38.0.4 Nov 11, 2025
37.0.3 Nov 11, 2025
36.0.3 Nov 11, 2025
0.25.0 Mar 16, 2021

#2156 in WebAssembly

Download history 635/week @ 2025-09-14 845/week @ 2025-09-21 1137/week @ 2025-09-28 791/week @ 2025-10-05 520/week @ 2025-10-12 987/week @ 2025-10-19 789/week @ 2025-10-26 354/week @ 2025-11-02 590/week @ 2025-11-09 755/week @ 2025-11-16 543/week @ 2025-11-23 544/week @ 2025-11-30 473/week @ 2025-12-07

2,334 downloads per month
Used in 5 crates (4 directly)

Apache-2.0 WITH LLVM-exception

4.5MB
67K SLoC

wasmtime-wasi-nn

This crate enables support for the wasi-nn API in Wasmtime. Currently it contains an implementation of wasi-nn using OpenVINO™ but in the future it could support multiple machine learning backends. Since the wasi-nn API is expected to be an optional feature of WASI, this crate is currently separate from the wasi-common crate. This crate is experimental and its API, functionality, and location could quickly change.

Use

Use the Wasmtime APIs to instantiate a Wasm module and link in the wasi-nn implementation as follows:

let wasi_nn = WasiNnCtx::new()?;
wasmtime_wasi_nn::witx::add_to_linker(...);

Build

cargo build

To use the WIT-based ABI, compile with --features component-model and use wasmtime_wasi_nn::wit::add_to_linker.

Example

An end-to-end example demonstrating ML classification is included in examples: examples/classification-example contains a standalone Rust project that uses the wasi-nn APIs and is compiled to the wasm32-wasip1 target using the high-level wasi-nn bindings.

Dependencies

~24–70MB
~1M SLoC