LightStudio.OnnxWeb
1.30.0.1
dotnet add package LightStudio.OnnxWeb --version 1.30.0.1
NuGet\Install-Package LightStudio.OnnxWeb -Version 1.30.0.1
<PackageReference Include="LightStudio.OnnxWeb" Version="1.30.0.1" />
<PackageVersion Include="LightStudio.OnnxWeb" Version="1.30.0.1" />
<PackageReference Include="LightStudio.OnnxWeb" />
paket add LightStudio.OnnxWeb --version 1.30.0.1
#r "nuget: LightStudio.OnnxWeb, 1.30.0.1"
#:package LightStudio.OnnxWeb@1.30.0.1
#addin nuget:?package=LightStudio.OnnxWeb&version=1.30.0.1
#tool nuget:?package=LightStudio.OnnxWeb&version=1.30.0.1
LightStudio.OnnxWeb
ONNX Runtime Web 1.30.0 with WebGPU and WebAssembly execution providers. The
NuGet package deploys self-hosted ES modules and Wasm binaries to wwwroot/onnx.
Its asynchronous API runs sessions in a dedicated module worker. WebGPU creation
or execution failures are logged and retried on CPU; every result reports the
active execution device. Unsupported WebGPU operators can also run on CPU.
npm ci --prefix package/onnx-web
npm run build --prefix package/onnx-web
dotnet pack package/onnx-web/LightStudio.OnnxWeb.csproj -c Debug -o artifacts/packages
The build stages the exact npm-locked upstream distribution, its license and
third-party notices, and SHA-256 hashes. Node.js 20 or later and .NET 10 are
required. Consume the local package from artifacts/packages.
import { OnnxWeb } from "./onnx/lightstudio-onnx-web.mjs";
const runtime = new OnnxWeb();
const session = await runtime.createSession(modelBytes, { device: "webgpu" });
const result = await runtime.run(session.id, {
input: { type: "float32", dims: [1, 2], data: new Float32Array([1, 2]) },
}, ["output"]);
await runtime.releaseSession(session.id);
runtime.dispose();
createSession accepts ONNX Runtime session options plus device (webgpu or
wasm) and an optional third argument containing external model files as
{ path, data: Uint8Array }. Session descriptions include input/output metadata.
run accepts numeric tensors and returns their typed data, shape, and type.
fingerprint(bytes) computes an MD5 identifier through hash-wasm 4.12.0 in the
worker; this identifies model presets, not download integrity or authenticity.
For streaming integrity checks, createHash("SHA256") or createHash("SHA1")
returns a hash handle. Await appendHash(handle, bytes) for each bounded chunk,
then finishHash(handle) returns the hexadecimal digest and releases the handle.
releaseHash(handle) discards an unfinished hash and is safe after completion.
Operations are serialized in the worker. Inputs are copied before transfer;
returned tensors belong to the caller. Release sessions after pending work
finishes. dispose terminates all work and rejects pending requests.
Serve .mjs as JavaScript and .wasm as application/wasm. WebGPU requires a
secure context and a supported adapter. Cross-origin isolation (COOP/COEP) enables
up to four CPU threads; otherwise the runtime uses one. Model requests must obey
browser CORS rules and available memory limits. ONNX Runtime cannot interrupt an
individual running inference; consumers should observe cancellation between runs
or terminate a dedicated runtime. No assets are loaded from a CDN at runtime.
Learn more about Target Frameworks and .NET Standard.
This package has no dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|