Table of Contents

Method LoadFromModelID

Namespace
LMKit.Model
Assembly
LM-Kit.NET.dll

LoadFromModelID(string, string, DeviceConfiguration, LoadingOptions, ModelDownloadingProgressCallback, ModelLoadingProgressCallback)

Loads an LM instance based on a given model identifier.

Where to find modelID:
1. Use GetPredefinedModelCards(bool) to see a list of available predefined models. Each predefined model exposes its unique identifier in the ModelID property.
2. For custom models, define your own ModelCard instance and specify the ModelID.

public static LM LoadFromModelID(string modelID, string storagePath = "", LM.DeviceConfiguration deviceConfiguration = null, LM.LoadingOptions loadingOptions = null, LM.ModelDownloadingProgressCallback downloadingProgress = null, LM.ModelLoadingProgressCallback loadingProgress = null)

Parameters

modelID string

The unique identifier of the target model. Must match one of the ModelID values returned by GetPredefinedModelCards(bool) or a custom ModelCard.

storagePath string

Optional custom path where the model is stored or downloaded.

deviceConfiguration LM.DeviceConfiguration

Optional device-specific configuration (e.g. GPU, CPU, etc.).

loadingOptions LM.LoadingOptions

Optional loading options (e.g. whether to load tensors into memory).

downloadingProgress LM.ModelDownloadingProgressCallback

Optional callback to report model-downloading progress.

loadingProgress LM.ModelLoadingProgressCallback

Optional callback to report loading progress (e.g. model initialization).

Returns

LM

An LM instance associated with the specified model ID.

Exceptions

ArgumentException

Thrown if modelID is null, empty, or does not match any known/predefined model ID.