Table of Contents

Class Experimental

Namespace
Uralstech.UAI.LiteRTLM

WARNING: The methods in this class are EXPERIMENTAL and subject to change or removal without notice. API stability and backward compatibility are not guaranteed.

public static class Experimental
Inheritance
object
Experimental

Methods

GetDebugInfo(Session)

Returns debug info for the session, or null on failure or if debugging is unsupported/disabled. The caller is responsible for disposing the returned wrapper.

public static SessionDebugInfo? GetDebugInfo(this Session session)

Parameters

session Session

The session to query.

Returns

SessionDebugInfo

The session debug info result, or null on failure or if debugging is unsupported.

GetSessionDebugInfo(Conversation)

Returns session debug info for the conversation's underlying session, or null on failure or if debugging is unsupported/disabled. The caller is responsible for disposing the returned wrapper.

public static SessionDebugInfo? GetSessionDebugInfo(this Conversation conversation)

Parameters

conversation Conversation

The conversation to query.

Returns

SessionDebugInfo

The session debug info result, or null on failure or if debugging is unsupported.

IsDebuggerEnabled()

Checks whether the LiteRT-LM runtime binary was built with the debugger tracing backend enabled (LITERT_LM_DEBUGGER_ENABLED=1).

public static int IsDebuggerEnabled()

Returns

int

1 if debugger is enabled at compile-time, 0 otherwise.

UpdateGPUEnableMetalResidencySet(Engine, bool)

Updates whether to enable Metal residency set on GPU for the given engine at runtime.

public static int UpdateGPUEnableMetalResidencySet(this Engine engine, bool enableMetalResidencySet)

Parameters

engine Engine

The engine to update.

enableMetalResidencySet bool

Whether to enable Metal residency set.

Returns

int

0 on success, non-zero on failure.

Remarks

To configure this setting during initialization, use SetGPUEnableMetalResidencySet(bool) instead.

When enabled on Apple platforms (macOS and iOS with Metal GPU backend), this uses Apple's MTLResidencySet API to ensure model weights and allocations remain resident in GPU memory, preventing memory swapping and reducing allocation overhead.

This setting is only supported on Apple platforms (macOS / iOS) with the GPU backend. On other platforms (e.g. Linux, Android, Windows) or non-GPU backends, this setting has no effect and is safely ignored.