/** * @octomil/browser — Inference engine * * Wraps ONNX Runtime Web to create an inference session from a model * buffer, auto-detect the best execution provider (WebGPU > WASM), * and run forward passes. */ import type { Backend, NamedTensors, PredictOutput } from "../../../types.js"; import type { ModelRuntime } from "../../core/model-runtime.js"; export type { ModelRuntime } from "../../core/model-runtime.js"; export declare class InferenceEngine implements ModelRuntime { private session; private ortModule; private resolvedBackend; /** * Create an ONNX Runtime session from the given model bytes. * * @param modelData Raw ONNX model ArrayBuffer. * @param backend Requested backend (`"webgpu"`, `"wasm"`, or `undefined` for auto). */ createSession(modelData: ArrayBuffer, backend?: Backend): Promise; /** * Run inference and return the output tensors plus timing info. */ run(inputs: NamedTensors): Promise; /** Names of the model's input tensors. */ get inputNames(): readonly string[]; /** Names of the model's output tensors. */ get outputNames(): readonly string[]; /** The backend that was actually used after negotiation. */ get activeBackend(): Backend | null; /** Release WASM / WebGPU resources. */ dispose(): void; /** Check if ONNX Runtime Web can be loaded in this environment. */ isAvailable(): Promise; private loadOrt; private resolveProvider; private detectWebGPU; private ensureSession; private convertOutputs; /** * Best-effort extraction of `label` / `score` / `scores` from the * first output tensor — only if it looks like a classification head. */ private extractConvenience; } //# sourceMappingURL=engine.d.ts.map