Table of Contents

Class EmbeddingEngineSettings

Namespace
Uralstech.UAI.LiteRTLM
public sealed class EmbeddingEngineSettings : LiteRTLMNativeHandle
Inheritance
object
EmbeddingEngineSettings
Inherited Members

Constructors

EmbeddingEngineSettings(string, string, string?, string?)

Creates managed embedding engine settings from a model path. The caller is responsible for disposing the wrapper using Dispose().

public EmbeddingEngineSettings(string modelPath, string backend, string? visionBackend = null, string? audioBackend = null)

Parameters

modelPath string

The path to the model file.

backend string

The backend to use (e.g., "cpu", "gpu", "npu").

visionBackend string

The vision backend to use, or null if not set.

audioBackend string

The audio backend to use, or null if not set.

Exceptions

InvalidOperationException

Thrown if the native object could not be created.

Methods

ReleaseUnmanagedResources()

protected override void ReleaseUnmanagedResources()

SetActivationDataType(ActivationDataType)

Sets the activation data type for the embedding engine settings.

public void SetActivationDataType(ActivationDataType activationDataType)

Parameters

activationDataType ActivationDataType

The activation data type.

SetAudioLitertDispatchLibDir(string)

Sets the LiteRT dispatch library directory for the audio NPU backend.

public void SetAudioLitertDispatchLibDir(string libDir)

Parameters

libDir string

The dispatch library directory.

SetAudioNumThreads(int)

Sets the number of threads for the audio CPU backend in Embedding Engine Settings.

public void SetAudioNumThreads(int numThreads)

Parameters

numThreads int

The number of threads.

SetCacheDir(string)

Sets the cache directory for the Embedding Engine.

public void SetCacheDir(string cacheDir)

Parameters

cacheDir string

The cache directory.

SetLitertDispatchLibDir(string)

Sets the LiteRT dispatch library directory for the main NPU backend.

public void SetLitertDispatchLibDir(string libDir)

Parameters

libDir string

The dispatch library directory.

SetMaxInputLength(int)

Sets the maximum sequence length (in tokens) for text encoder signatures in Embedding Engine Settings.

public void SetMaxInputLength(int maxInputLength)

Parameters

maxInputLength int

The maximum input length. Passing a non-positive value unsets the option.

SetMinInputLength(int)

Sets the minimum sequence length (in tokens) for text encoder signatures in Embedding Engine Settings.

public void SetMinInputLength(int minInputLength)

Parameters

minInputLength int

The minimum input length. Passing a negative value unsets the option.

SetNumThreads(int)

Sets the number of threads for the CPU backend in Embedding Engine Settings.

public void SetNumThreads(int numThreads)

Parameters

numThreads int

The number of threads.

SetVisionLitertDispatchLibDir(string)

Sets the LiteRT dispatch library directory for the vision NPU backend.

public void SetVisionLitertDispatchLibDir(string libDir)

Parameters

libDir string

The dispatch library directory.

SetVisionTokensPerImage(int)

Sets the desired number of vision tokens generated per image in Embedding Engine Settings.

public void SetVisionTokensPerImage(int visionTokensPerImage)

Parameters

visionTokensPerImage int

The vision tokens per image. Passing a non-positive value unsets the option.