Table of Contents

Constructor LLM

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

LLM(Uri, string, DeviceConfiguration, LoadingOptions, ModelDownloadingProgressCallback, ModelLoadingProgressCallback)

Creates an instance of the Model class from a System.Uri object.

public LLM(Uri uri, string storagePath = "", LLM.DeviceConfiguration deviceConfiguration = null, LLM.LoadingOptions loadingOptions = null, LLM.ModelDownloadingProgressCallback downloadingProgress = null, LLM.ModelLoadingProgressCallback loadingProgress = null)

Parameters

uri Uri

Defines the Uniform Resource Identifier (URI) indicating the location of the model. This can either be a web address using the HTTP protocol or a path to a local file.

storagePath string

An optional parameter that specifies the location on the local machine where the model should be downloaded, if applicable.

deviceConfiguration LLM.DeviceConfiguration

An optional LLM.DeviceConfiguration object specifying device configuration options. Defaults to null.

loadingOptions LLM.LoadingOptions

An optional LLM.LoadingOptions object specifying various loading options. Defaults to null.

downloadingProgress LLM.ModelDownloadingProgressCallback

An optional reference to a ModelDownloadingProgressCallback to monitor the model's downloading progress.

loadingProgress LLM.ModelLoadingProgressCallback

An optional ModelLoadingProgressCallback reference to monitor the progress of model loading.

Exceptions

ArgumentNullException
ModelNotDownloadedException
ModelNotLoadedException

LLM(string, DeviceConfiguration, LoadingOptions, ModelLoadingProgressCallback)

Creates an instance of the Model class from a file.

public LLM(string modelPath, LLM.DeviceConfiguration deviceConfiguration = null, LLM.LoadingOptions loadingOptions = null, LLM.ModelLoadingProgressCallback loadingProgress = null)

Parameters

modelPath string

A path to a model file, in GGUF format.

deviceConfiguration LLM.DeviceConfiguration

An optional LLM.DeviceConfiguration object specifying device configuration options. Defaults to null.

loadingOptions LLM.LoadingOptions

An optional LLM.LoadingOptions object specifying various loading options. Defaults to null.

loadingProgress LLM.ModelLoadingProgressCallback

An optional ModelLoadingProgressCallback reference to monitor the progress of model loading.

Exceptions

ArgumentNullException
FileNotFoundException
ModelNotLoadedException