Class OnnxEdgeBuilderExtensions
Registers ONNX Runtime hosting on the Qavren.Edge builder.
public static class OnnxEdgeBuilderExtensions
- Inheritance
-
OnnxEdgeBuilderExtensions
- Inherited Members
Methods
- AddBundledModelSource(EdgeBuilder, Func<string, CancellationToken, ValueTask<Stream>>)
Registers an app-package source. The opener is the consumer's - in MAUI that is
FileSystem.OpenAppPackageFileAsync- so this package never references MAUI.
- AddHuggingFaceModelSource(EdgeBuilder, Action<HttpOnnxModelSourceOptions>?)
Registers the resumable, verified HTTP source.
- AddModelSource(EdgeBuilder, Func<IServiceProvider, IOnnxModelSource>)
Registers a source built by a factory.
- AddModelSource<TSource>(EdgeBuilder)
Registers a source. Sources are probed in registration order, with FileOnnxModelSource always last.
- AddOnnx(EdgeBuilder, Action<OnnxOptions>?)
Idempotent. Registers IEdgeModelPaths, IEdgeResourceMonitor, the model store, the session host, FileOnnxModelSource as the fallback source, the
OrtEnvstartup task (order 200), the lifecycle observer and the diagnostics contributor. Calling it twice registers one of each.
- AddOnnxModel(EdgeBuilder, OnnxModelManifest, Action<OnnxSessionOptions>?)
Declares a model. Provisioning and session creation stay lazy: nothing is fetched and no session is created until the first
IOnnxSessionHost.AcquireAsync.
- ProvisionModelAtStartup(EdgeBuilder, string)
Startup order 210. Verifies presence and faults startup if the model is missing. Off by default, and it never downloads: blocking
IEdgeHost.Startedon a transfer also blocks everyIEdgeDatabase.OpenConnectionAsync.
- UseExecutionProviderPolicy(EdgeBuilder, Action<OnnxExecutionProviderPolicy>)
Configures the default execution-provider policy every session starts from.
- UseModelPaths(EdgeBuilder, IEdgeModelPaths)
Replaces IEdgeModelPaths. Tests point it at a temp directory.
- WarmUpSessionAtStartup(EdgeBuilder, string)
Startup order 220. Creates the session so the first real call pays neither graph optimisation nor a CoreML compile. Loads only - it runs no inference, because a batch needs a tokenizer and a generator and both live in
Qavren.Edge.Embeddings.Onnx. Off by default, because it forces provisioning and spec 10 keeps that lazy.