Registration is explicit
The host controls which backend instances enter the registry. A package reference alone does not make a backend selectable.
UAIX.LmRuntime / Package guide
Explicit backend contracts, registration, capability declarations, local probing, deterministic selection, and visible CPU fallback.
Required For explicit backend registration, probing, selection, and fallback evidence
UAIX.LmRuntime.Acceleration
Explicit backend contracts, registration, capability declarations, local probing, deterministic selection, and visible CPU fallback.
Acceleration owns the runtime-neutral control plane for local execution backends. Hosts register backend instances, probe them in stable order, choose with a declared policy, and receive the selected backend, device, capabilities, diagnostics, and CPU-fallback state. Installing a backend package does not register it or grant execution authority.
dotnet add package UAIX.LmRuntime.Acceleration
<PackageReference Include="UAIX.LmRuntime.Acceleration" />
Version policy: The documentation deliberately omits UAIX.LmRuntime package version numbers. Resolve and pin versions through your normal dependency-management and lock-file process.
Review the current package metadata, frameworks, dependencies, and downloads on NuGet ↗
None within the UAIX.LmRuntime package family.
The host controls which backend instances enter the registry. A package reference alone does not make a backend selectable.
The result identifies the backend, device, capabilities, diagnostics, and whether a GPU-prefer policy used CPU fallback.
RequireGpu and RequireBackendId return a failed selection when the named execution class cannot prove availability.
These are the main entry points for this package. The generated reference below includes every documented type and member represented by public package XML documentation.
IRuntimeBackend
IRuntimeBackendRegistry
IRuntimeBackendSelector
RuntimeBackendRegistry
RuntimeBackendSelector
RuntimeBackendOptions
RuntimeSelectionPolicy
RuntimeSelectionResult
RuntimeBackendProbeResult
RuntimeBackendCapabilities
RuntimeDeviceDescriptor
DiagnosticRuntimeBackend
Examples use public package signatures documented on LMRuntime.com. Model paths, hashes, byte counts, prompts, and host-specific identifiers remain application inputs.
Compose Acceleration with Backends.CpuManaged and require a CPU-capable local backend.
using UAIX.LmRuntime.Acceleration;
using UAIX.LmRuntime.Backends.CpuManaged;
var registry = new RuntimeBackendRegistry();
registry.AddUaixCpuManagedBackend();
var selector = new RuntimeBackendSelector(registry);
RuntimeSelectionResult result = await selector.SelectAsync(
new RuntimeBackendOptions
{
Policy = RuntimeSelectionPolicy.RequireCpu
});
if (!result.Succeeded)
{
throw new InvalidOperationException(result.FailureReason);
}
Console.WriteLine(result.SelectedBackendId);
Console.WriteLine(result.SelectedDevice?.DeviceId);
Boundary: This composition requires the Backends.CpuManaged package. Selection does not load a model; it establishes explicit backend identity.
Register a diagnostic CUDA path and a working managed CPU path, then observe the fallback bit.
using UAIX.LmRuntime.Acceleration;
using UAIX.LmRuntime.Backends.CpuManaged;
using UAIX.LmRuntime.Backends.Cuda;
var registry = new RuntimeBackendRegistry();
registry.AddUaixCudaBackend();
registry.AddUaixCpuManagedBackend();
var selector = new RuntimeBackendSelector(registry);
RuntimeSelectionResult result = await selector.SelectAsync(
new RuntimeBackendOptions
{
Policy = RuntimeSelectionPolicy.PreferGpu,
AllowCpuFallback = true
});
Console.WriteLine($"Succeeded: {result.Succeeded}");
Console.WriteLine($"Backend: {result.SelectedBackendId}");
Console.WriteLine($"CPU fallback: {result.UsedCpuFallback}");
foreach (string diagnostic in result.Diagnostics)
{
Console.WriteLine(diagnostic);
}
Boundary: The supplied CUDA registration is diagnostic and probes unavailable until a native adapter proves assets, runtime libraries, and a device.
Use a require policy when CPU substitution would violate the host workload contract.
using UAIX.LmRuntime.Acceleration;
using UAIX.LmRuntime.Backends.Cuda;
var registry = new RuntimeBackendRegistry();
registry.AddUaixCudaBackend();
var selector = new RuntimeBackendSelector(registry);
RuntimeSelectionResult result = await selector.SelectAsync(
new RuntimeBackendOptions
{
Policy = RuntimeSelectionPolicy.RequireGpu,
AllowCpuFallback = false,
RequireNativeAssets = true
});
if (!result.Succeeded)
{
Console.Error.WriteLine(result.FailureReason);
foreach (string diagnostic in result.Diagnostics)
{
Console.Error.WriteLine(diagnostic);
}
}
Boundary: RequireGpu never reports a managed CPU selection as GPU execution.
Build a diagnostics view without asking the selector to choose an execution path.
using UAIX.LmRuntime.Acceleration;
using UAIX.LmRuntime.Backends.CpuManaged;
using UAIX.LmRuntime.Backends.DirectML;
using UAIX.LmRuntime.Backends.Vulkan;
var registry = new RuntimeBackendRegistry();
registry
.AddUaixCpuManagedBackend()
.AddUaixDirectMlBackend()
.AddUaixVulkanBackend();
var probeSettings = new RuntimeBackendOptions
{
RequestedRuntimeIdentifier = System.Runtime.InteropServices.RuntimeInformation.RuntimeIdentifier
};
foreach (IRuntimeBackend backend in registry.GetBackends())
{
RuntimeBackendProbeResult probe = await backend.ProbeAsync(probeSettings);
Console.WriteLine($"{backend.Id}: available={probe.IsAvailable}");
foreach (string diagnostic in probe.Diagnostics)
{
Console.WriteLine($" {diagnostic}");
}
}
Boundary: Probing is local and diagnostic. The registry order is preserved so reports and selection remain deterministic.
Pin selection to the stable backend ID rather than relying on registration order.
using UAIX.LmRuntime.Acceleration;
using UAIX.LmRuntime.Backends.CpuManaged;
var registry = new RuntimeBackendRegistry();
registry.AddUaixCpuManagedBackend();
var selector = new RuntimeBackendSelector(registry);
RuntimeSelectionResult result = await selector.SelectAsync(
new RuntimeBackendOptions
{
Policy = RuntimeSelectionPolicy.RequireBackendId,
PreferredBackendId = CpuManagedRuntimeBackend.BackendId
});
Console.WriteLine(result.Succeeded
? $"Selected {result.SelectedBackendId}"
: result.FailureReason);
Boundary: RequireBackendId returns failure when the ID is empty, unregistered, or unavailable.
Read backend capability metadata and then check the independent probe result.
using UAIX.LmRuntime.Acceleration;
using UAIX.LmRuntime.Backends.Cuda;
IRuntimeBackend backend = new CudaRuntimeBackend();
RuntimeBackendCapabilities declared = backend.Capabilities;
RuntimeBackendProbeResult probe = await backend.ProbeAsync(new RuntimeBackendOptions());
Console.WriteLine($"API: {declared.BackendApiName}");
Console.WriteLine($"Declares GPU execution: {declared.SupportsGpuExecution}");
Console.WriteLine($"Native asset state: {declared.NativeAssetState}");
Console.WriteLine($"Available now: {probe.IsAvailable}");
Boundary: Capabilities describe the backend family. Probe evidence decides whether execution is available in the current host.
Expand a type to review its documented fields, properties, constructors, methods, parameter descriptions, and return descriptions. Browser Find also works across the closed detail elements.
DiagnosticRuntimeBackendUAIX.LmRuntime.Acceleration
5 members
Provides shared diagnostic behavior for backend packages that declare compatibility before native execution is proven.
The class keeps package-visible backend declarations DRY. It performs no native loads, subprocess execution, provider calls, network access, or model downloads; concrete packages remain responsible only for naming their compatibility API, runtime identifiers, and package-specific diagnostics.
Capabilities
Gets the backend capability declaration.
DisplayName
Gets the human-readable backend name.
Id
Gets the stable backend identifier.
Kind
Gets the backend kind.
ProbeAsync(UAIX.LmRuntime.Acceleration.RuntimeBackendOptions,System.Threading.CancellationToken)
Probes a diagnostic backend and reports unavailable until native assets, runtime libraries, and devices are proven.
optionscancellationTokenReturns: The backend probe result.
IRuntimeBackendUAIX.LmRuntime.Acceleration
5 members
Defines a local runtime backend that can report capabilities and probe available devices.
Backends are package-visible compatibility surfaces. Implementations must not perform hidden downloads, provider calls, subprocess execution, or remote inference during probing or selection.
Capabilities
Gets the backend capability declaration.
DisplayName
Gets the human-readable backend name.
Id
Gets the stable backend identifier.
Kind
Gets the backend kind.
ProbeAsync(UAIX.LmRuntime.Acceleration.RuntimeBackendOptions,System.Threading.CancellationToken)
Probes the backend for local execution availability and devices.
optionscancellationTokenReturns: The backend probe result.
IRuntimeBackendRegistryUAIX.LmRuntime.Acceleration
3 members
Defines a registry of runtime backends available to a host application.
The registry is explicit and local. Merely installing a package does not grant hidden runtime authority unless the host registers the backend instance.
FindById(string)
Finds a backend by identifier.
backendIdReturns: The matching backend, or when no backend is registered for the ID.
GetBackends
Gets the currently registered runtime backends.
Returns: The ordered registered backend list.
Register(UAIX.LmRuntime.Acceleration.IRuntimeBackend)
Registers one runtime backend.
backendIRuntimeBackendSelectorUAIX.LmRuntime.Acceleration
1 member
Defines backend selection over a registered set of local runtime backends.
Selection returns explicit backend and device identity so CPU fallback is never confused with GPU execution.
SelectAsync(UAIX.LmRuntime.Acceleration.RuntimeBackendOptions,System.Threading.CancellationToken)
Selects a backend according to the supplied policy and options.
optionscancellationTokenReturns: The backend selection result.
RuntimeBackendCapabilitiesUAIX.LmRuntime.Acceleration
13 members
Reports the execution and compatibility capabilities declared by a runtime backend.
Capabilities are package-visible declarations. Availability is still decided by probing native assets, runtime libraries, drivers, and devices before a backend is selected for execution.
BackendApiName
Gets or sets the backend API name, such as CUDA, DirectML, Vulkan, ROCm, Metal, or managed CPU.
Diagnostics
Gets diagnostic messages describing compatibility, package state, and probe status.
NativeAssetState
Gets or sets the backend-reported native asset state.
RuntimeIdentifiers
Gets runtime identifiers supported or observed by the backend package.
SupportsCpuOnlyExecution
Gets or sets a value indicating whether the backend can execute without GPU hardware.
SupportsDeviceSelection
Gets or sets a value indicating whether callers can select among backend devices.
SupportsGguf
Gets or sets a value indicating whether the backend supports GGUF model inputs.
SupportsGpuExecution
Gets or sets a value indicating whether the backend can execute on a GPU device.
SupportsLlama
Gets or sets a value indicating whether the backend supports LLaMA-family model binding.
SupportsMemoryQuery
Gets or sets a value indicating whether the backend can query device or execution memory.
SupportsStreaming
Gets or sets a value indicating whether the backend supports streaming token output.
UsesGpuAcceleration
Gets or sets a value indicating whether the backend uses GPU acceleration when it executes successfully.
UsesNativeInference
Gets or sets a value indicating whether the backend uses native inference components.
RuntimeBackendKindUAIX.LmRuntime.Acceleration
8 members
Identifies the accelerator API family or execution class represented by a runtime backend.
The value describes the backend package family, not a claim that a device, driver, or native library is available on the current machine.
CpuManaged
The managed CPU reference backend.
Cuda
An NVIDIA CUDA backend.
DirectML
A Windows DirectML backend.
ExternalNative
A backend supplied by an external native package or host adapter.
Metal
An Apple Metal backend.
Rocm
An AMD ROCm backend.
Unknown
An unknown or not-yet-classified backend.
Vulkan
A Vulkan compute backend.
RuntimeBackendOptionsUAIX.LmRuntime.Acceleration
7 members
Provides caller-supplied backend selection and probing options.
These options never authorize hidden downloads, provider fallback, subprocess execution, or remote inference. They only describe how registered local backends should be probed and selected.
AllowCpuFallback
Gets or sets a value indicating whether prefer policies may fall back to CPU execution.
NativeAssetDirectory
Gets or sets an optional directory that a backend may inspect for native assets.
Policy
Gets or sets the backend selection policy.
PreferredBackendId
Gets or sets the preferred or required backend identifier for backend-id policies.
PreferredDeviceId
Gets or sets the preferred backend-local device identifier when device selection is supported.
RequestedRuntimeIdentifier
Gets or sets the runtime identifier requested by the caller, when different from the current process.
RequireNativeAssets
Gets or sets a value indicating whether a selected backend must have native assets available.
RuntimeBackendProbeResultUAIX.LmRuntime.Acceleration
6 members
Reports the result of probing one registered runtime backend.
A backend may declare capabilities but still probe unavailable when native assets, runtime libraries, drivers, or devices are absent.
BackendId
Gets or sets the backend identifier.
BackendKind
Gets or sets the backend kind.
Capabilities
Gets or sets the backend capabilities.
Devices
Gets discovered devices reported by the backend.
Diagnostics
Gets probe diagnostics.
IsAvailable
Gets or sets a value indicating whether the backend is available for execution.
RuntimeBackendRegistryUAIX.LmRuntime.Acceleration
3 members
Provides an in-memory explicit registry of local runtime backends.
Registration order is preserved so callers can make deterministic selection decisions.
FindById(string)
Finds a backend by identifier.
backendIdReturns: The matching backend, or when no backend is registered for the ID.
GetBackends
Gets the currently registered runtime backends.
Returns: The ordered registered backend list.
Register(UAIX.LmRuntime.Acceleration.IRuntimeBackend)
Registers one runtime backend.
backendRuntimeBackendSelectorUAIX.LmRuntime.Acceleration
2 members
Selects a local runtime backend from an explicit registry.
The selector probes registered backends and reports fallback identity instead of silently substituting one execution class for another.
RuntimeBackendSelector(UAIX.LmRuntime.Acceleration.IRuntimeBackendRegistry)
Initializes a new instance of the UAIX.LmRuntime.Acceleration.RuntimeBackendSelector class.
registrySelectAsync(UAIX.LmRuntime.Acceleration.RuntimeBackendOptions,System.Threading.CancellationToken)
Selects a backend according to the supplied policy and options.
optionscancellationTokenReturns: The backend selection result.
RuntimeDeviceDescriptorUAIX.LmRuntime.Acceleration
12 members
Describes one CPU or accelerator device discovered by a runtime backend probe.
Device descriptors are diagnostic evidence. They should identify the device that would execute work without exposing private file paths, credentials, prompt text, or generated text.
BackendApiName
Gets or sets the acceleration API name associated with the device.
BackendId
Gets or sets the identifier of the backend that reported the device.
BackendKind
Gets or sets the backend kind that reported the device.
ComputeCapability
Gets or sets the backend-reported compute capability, feature level, or API version.
DeviceId
Gets or sets the stable backend-local device identifier.
Diagnostics
Gets diagnostic messages associated with the device descriptor.
DisplayName
Gets or sets the human-readable device name.
IsCpu
Gets or sets a value indicating whether the descriptor represents CPU execution.
IsGpu
Gets or sets a value indicating whether the descriptor represents GPU execution.
MemoryBytes
Gets or sets the backend-reported device memory in bytes when known.
RuntimeIdentifier
Gets or sets the runtime identifier associated with the probed process.
Vendor
Gets or sets the vendor or implementation owner reported by the backend.
RuntimeSelectionPolicyUAIX.LmRuntime.Acceleration
6 members
Defines how the selector chooses among registered runtime backends.
Policies that prefer a backend may fall back when the options allow it. Policies that require a backend fail clearly when the required capability is unavailable.
PreferBackendId
Prefer a specific backend identifier and fall back only when fallback is permitted.
PreferCpu
Prefer a CPU-capable backend but allow a different available backend when CPU is absent.
PreferGpu
Prefer an available GPU backend and fall back to CPU only when fallback is permitted.
RequireBackendId
Select only a specific backend identifier.
RequireCpu
Select only a CPU-capable backend.
RequireGpu
Select only an available GPU backend.
RuntimeSelectionResultUAIX.LmRuntime.Acceleration
9 members
Reports the selected backend, selected device, and any fallback used by a selection policy.
Selection results make CPU fallback explicit so callers never mistake fallback execution for GPU execution.
Diagnostics
Gets selection diagnostics.
FailureReason
Gets or sets the selection failure reason when selection did not succeed.
Policy
Gets or sets the policy used for selection.
SelectedBackendId
Gets or sets the selected backend identifier.
SelectedBackendKind
Gets or sets the selected backend kind.
SelectedCapabilities
Gets or sets the selected backend capabilities.
SelectedDevice
Gets or sets the selected device descriptor.
Succeeded
Gets or sets a value indicating whether selection succeeded.
UsedCpuFallback
Gets or sets a value indicating whether a GPU-prefer policy fell back to CPU execution.
No. The host must construct or add the backend to an IRuntimeBackendRegistry.
No. CPU fallback requires AllowCpuFallback and is reported through UsedCpuFallback and diagnostics.
No. It owns contracts, registration, probing, selection, and evidence. Model execution remains in the execution packages.
Its probe should distinguish native assets, runtime libraries, drivers, devices, policy restrictions, and selected device identity without exposing private prompt or path content.