UAIX.LmRuntime / Package guide

UAIX.LmRuntime.Backends.CpuManaged

The explicit managed .NET CPU backend registration, capability declaration, device identity, and no-native-asset compatibility lane.

Required For the package-visible managed CPU backend and explicit CPU fallback identity

UAIX.LmRuntime.Backends.CpuManaged

The explicit managed .NET CPU backend registration, capability declaration, device identity, and no-native-asset compatibility lane.

Overview

Backends.CpuManaged supplies the backend object used to represent managed CPU execution in the Acceleration registry. Its probe is available when the package is loaded, reports the current process runtime identifier and a stable CPU device ID, and requires no GPU, driver, native inference library, provider API, subprocess, network request, or model download.

Who should use it Applications and hosts that require a package-visible managed CPU backend, deterministic CPU selection, or explicit CPU fallback identity.

Install

.NET CLI
dotnet add package UAIX.LmRuntime.Backends.CpuManaged
Project file
<PackageReference Include="UAIX.LmRuntime.Backends.CpuManaged" />

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 ↗

Direct package dependencies

Package role and boundaries

Required For the package-visible managed CPU backend and explicit CPU fallback identity

  • You need a registered CPU backend that probes available without native assets.
  • You need a stable managed CPU backend ID and device descriptor in diagnostics.
  • You need PreferGpu to fall back to an explicitly registered CPU lane.

Boundary

  • It does not expose the tensor kernels directly; use Kernels.Cpu for managed math APIs.
  • It does not load a GGUF model; use LocalEndpoint or Models.Llama for model execution.
  • It does not claim GPU or native inference.

Always-local probe

The backend is available when loaded because it has no GPU, driver, or native-asset dependency.

Stable identity

The backend ID is uaix.lmruntime.cpu-managed and the default device ID is cpu:managed:default.

Visible fallback

When selected after a GPU-prefer miss, Acceleration reports UsedCpuFallback rather than relabeling the CPU lane.

Key types

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.

Coding examples

Examples use public package signatures documented on LMRuntime.com. Model paths, hashes, byte counts, prompts, and host-specific identifiers remain application inputs.

Register the managed CPU backend

Add the backend through the fluent registry extension and inspect deterministic order.

RegisterCpuManagedExample.cs
using UAIX.LmRuntime.Acceleration;
using UAIX.LmRuntime.Backends.CpuManaged;

var registry = new RuntimeBackendRegistry();
registry.AddUaixCpuManagedBackend();

foreach (IRuntimeBackend backend in registry.GetBackends())
{
    Console.WriteLine($"{backend.Id} ({backend.Kind})");
}

Boundary: Calling the registration helper twice on the same registry throws because duplicate backend IDs are rejected.

Probe managed CPU availability

Read the backend and device evidence returned by the local probe.

ProbeCpuManagedExample.cs
using UAIX.LmRuntime.Acceleration;
using UAIX.LmRuntime.Backends.CpuManaged;

var backend = new CpuManagedRuntimeBackend();
RuntimeBackendProbeResult probe = await backend.ProbeAsync(
    new RuntimeBackendOptions
    {
        Policy = RuntimeSelectionPolicy.RequireCpu
    });

Console.WriteLine($"Available: {probe.IsAvailable}");
Console.WriteLine($"Native assets: {probe.Capabilities.NativeAssetState}");
foreach (RuntimeDeviceDescriptor device in probe.Devices)
{
    Console.WriteLine($"{device.DeviceId} / {device.RuntimeIdentifier}");
}

Boundary: The probe reports managed CPU availability only; it does not parse or execute a model.

Require the managed CPU backend by stable ID

Use a backend-ID policy when the host must reject every other execution class.

PinCpuManagedExample.cs
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,
        AllowCpuFallback = false
    });

if (!result.Succeeded)
{
    throw new InvalidOperationException(result.FailureReason);
}

Boundary: The stable ID pins backend selection, not a particular operating-system thread or CPU core.

Assert the no-native boundary in host startup checks

Fail application startup when package metadata contradicts the expected managed CPU lane.

AssertCpuBoundaryExample.cs
using UAIX.LmRuntime.Backends.CpuManaged;

var backend = new CpuManagedRuntimeBackend();

if (backend.Capabilities.UsesNativeInference ||
    backend.Capabilities.UsesGpuAcceleration ||
    backend.Capabilities.NativeAssetState != "not-required")
{
    throw new InvalidOperationException(
        "The selected backend does not match the required managed CPU boundary.");
}

Boundary: This checks declared capability metadata. A full host readiness check should also probe and record the returned device identity.

Generated API reference

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.

CpuManagedRuntimeBackendUAIX.LmRuntime.Backends.CpuManaged 7 members

Reports the UAIX managed CPU backend to the acceleration registry.

This backend represents compatibility required for systems without GPUs. It does not require GPU hardware, GPU drivers, native runtime libraries, provider APIs, subprocess execution, or model downloads.

Field BackendId

The stable backend identifier used by selection policies.

Property Capabilities

Gets the backend capability declaration.

Property DisplayName

Gets the human-readable backend name.

Property Id

Gets the stable backend identifier.

Property Kind

Gets the backend kind.

Method CpuManagedRuntimeBackend

Initializes a new instance of the UAIX.LmRuntime.Backends.CpuManaged.CpuManagedRuntimeBackend class.

Method ProbeAsync(UAIX.LmRuntime.Acceleration.RuntimeBackendOptions,System.Threading.CancellationToken)

Probes the managed.NET backend for local execution availability.

options
The caller-supplied probing and selection options.
cancellationToken
A token that cancels the probe.

Returns: The available CPU probe result.

RuntimeBackendRegistryExtensionsUAIX.LmRuntime.Backends.CpuManaged 1 member

Provides registration helpers for the managed CPU backend.

Hosts can call this helper to make CPU fallback explicit in the acceleration registry.

Method AddUaixCpuManagedBackend(UAIX.LmRuntime.Acceleration.IRuntimeBackendRegistry)

Adds the UAIX managed CPU backend to a registry.

registry
The registry to update.

Returns: The same registry instance for fluent configuration.

Frequently asked questions

Is this the same package as Kernels.Cpu?

No. Backends.CpuManaged represents backend selection and diagnostics. Kernels.Cpu exposes managed numerical operations.

Does it require a RID-specific native package?

No. NativeAssetState is not-required and the probe has no native dependency.

Does it download models?

No. Model acquisition and trust remain host responsibilities.