![]() |
VOOZH | about |
dotnet add package WACS.WASI.NN.MLNet --version 0.2.4
NuGet\Install-Package WACS.WASI.NN.MLNet -Version 0.2.4
<PackageReference Include="WACS.WASI.NN.MLNet" Version="0.2.4" />
<PackageVersion Include="WACS.WASI.NN.MLNet" Version="0.2.4" />Directory.Packages.props
<PackageReference Include="WACS.WASI.NN.MLNet" />Project file
paket add WACS.WASI.NN.MLNet --version 0.2.4
#r "nuget: WACS.WASI.NN.MLNet, 0.2.4"
#:package WACS.WASI.NN.MLNet@0.2.4
#addin nuget:?package=WACS.WASI.NN.MLNet&version=0.2.4Install as a Cake Addin
#tool nuget:?package=WACS.WASI.NN.MLNet&version=0.2.4Install as a Cake Tool
ML.NET-flavored ONNX backend for WACS.WASI.NN.
Implements IBackend for graph-encoding.onnx against
Microsoft.ML.OnnxTransformer
under an MLContext lifecycle — for embedders composing wasi-nn inference with the rest
of an ML.NET pipeline (preprocessing transformers, custom predictors, IDataView /
PredictionEngine).
For raw tensor inference with no pipeline integration, prefer
WACS.WASI.NN.OnnxRuntime —
it avoids the Microsoft.ML transitive surface (~70 MB lighter).
dotnet add package WACS.WASI.NN.MLNet
The package's bin ships its NuGet transitives + RID-specific native libs (via
<EnableDynamicLoading>true</EnableDynamicLoading>), so Assembly.LoadFrom resolves
everything from the LoadFromContext probe.
# After dotnet build of this project's repo:
MLNET=$(realpath Wacs.WASI/Wacs.WASI.NN/Wacs.WASI.NN.MLNet/bin/Release/net8.0/Wacs.WASI.NN.MLNet.dll)
wacs run my.component.wasm --wasip2 --bind "$MLNET" -d ./models::/models
--bind auto-pulls the WASI.NN typed surface + DI sibling onto host-packages when the
identity starts with Wacs.WASI.NN.. The Preview 2 DI scope wires the ML.NET-backed ORT
into the DI bundle's WasiNNConfiguration.Backends[ONNX].
Interpreter / one-line:
using Wacs.Core.Runtime;
using Wacs.WASI.NN;
using Wacs.WASI.NN.MLNet;
using Wacs.WASI.NN.Types;
var runtime = new WasmRuntime();
runtime.UseWasiNN(b => b.AddBackend(GraphEncoding.ONNX, new MLNetBackend()));
MLNetBackend : IBackend — wraps ORT under MLContext.Transforms.ApplyOnnxModel
/ IDataView, exposing the same LoadGraph(builders, target) /
Compute(inputs) shape as the bare ORT backend. Embedders who want the
ML.NET preprocessing surface get it; the rest of WACS doesn't noticeWasiNNMLNetBindable : IBindable — parameterless adapter for --bind[assembly: WasiHostPackage]Use this backend when:
IDataView consumers) and you want them composed in one host-side
processMicrosoft.ML for adjacent work — the marginal cost of
routing wasi-nn through MLContext is smallMLContext.Log / structured ML.NET diagnostics around the inference callFor everything else — image classification, embeddings, encoder-only LLMs, raw tensor
in / raw tensor out — bare
WACS.WASI.NN.OnnxRuntime is
lighter and simpler.
| Use case | Package |
|---|---|
| ONNX with ML.NET pipeline integration | WACS.WASI.NN.MLNet (this) |
| Standard ONNX inference (lighter footprint) | WACS.WASI.NN.OnnxRuntime |
| GGUF / llama.cpp generative LLMs | WACS.WASI.NN.LlamaSharp |
docs/WASI_NN_USAGE.md —
unified usage guide (CLI flags, env vars, programmatic embedding, worked examples)docs/COMPONENT_CHAINING.mdWacs.WASI/Wacs.WASI.NN/README.md
— backend matrix + package layoutApache-2.0
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
This package is not used by any NuGet packages.
This package is not used by any popular GitHub repositories.