Crates.io | wasmtime-wasi-nn |
lib.rs | wasmtime-wasi-nn |
version | |
source | src |
created_at | 2021-01-08 17:49:16.859065 |
updated_at | 2025-01-14 23:25:22.629339 |
description | Wasmtime implementation of the wasi-nn API |
homepage | |
repository | https://github.com/bytecodealliance/wasmtime |
max_upload_size | |
id | 334544 |
Cargo.toml error: | TOML parse error at line 19, column 1 | 19 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
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 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(...);
$ cargo build
To use the WIT-based ABI, compile with --features component-model
and use wasmtime_wasi_nn::wit::add_to_linker
.
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.