Skip to main content
net10.0

ONNX Runtime GenAI backend for LMSupply.Generator. Adds local text generation on ONNX models (Phi, etc.) with CUDA GPU acceleration. Optional β€” LMSupply.Generator works with GGUF/llama-server alone without this package.

Published
Oct 7, 2026
11d ago
Total Downloads
4.6K
4,586

Install

dotnet add package LMSupply.Generator.Onnx --version 0.109.0
ProductVersions
.NET
net10.0

README

LMSupply.Generator.Onnx

ONNX Runtime GenAI backend for LMSupply.Generator. Adds local text generation on ONNX Runtime GenAI models (Phi-4 Mini ONNX and similar) with CUDA/DirectML GPU acceleration. Optional β€” LMSupply.Generator alone covers GGUF/llama-server models without this package.

Quick Start

using LMSupply.Generator;

// Register once at startup, before loading any ONNX model.
LMSupply.Generator.Onnx.OnnxGeneratorBackend.Register();

var generator = await TextGeneratorBuilder.Create()
    .WithHuggingFaceModel("microsoft/Phi-4-mini-instruct-onnx")
    .BuildAsync();

string response = await generator.GenerateCompleteAsync("What is AI?");

Without registering this package, TextGeneratorBuilder/LocalGenerator throw a NotSupportedException naming this package when asked to load an ONNX model. The hardware-aware WithDefaultModel()/"auto" path never silently depends on it either β€” on a discrete non-NVIDIA Windows GPU it only prefers ONNX/DirectML when this backend is registered, otherwise it falls back to its GGUF selection.

GPU Acceleration

# NVIDIA GPU
dotnet add package Microsoft.ML.OnnxRuntime.Gpu

# Windows (AMD/Intel/NVIDIA)
dotnet add package Microsoft.ML.OnnxRuntime.DirectML

Changes from Previous Version

No structural changes between v0.108.0 and v0.109.0.

Adoption Assessment

Assess this package against its supported frameworks, license, maintenance signals and dependency graph before making it a project standard.

Compatibility metadata lists 1 target framework; confirm the exact target used by your application.

Related Guides & Workflows

Learn how to evaluate, integrate, or audit this package in your .NET project.