Table of Contents

Namespace LMKit.Model

Namespaces

LMKit.Model.Gguf

Classes

LM

Provides a unified manager for AI model instances, including small and large language models, embedding models (image and text), vision-language models, and speech-to-text models, across GGUF, GGML, ONNX, and LMK container formats. This class handles downloading, loading, configuring, and interacting with these models, ensuring a consistent API for text generation, embeddings, multimodal inference, and speech recognition.

LM.DeviceConfiguration

Handles the underlying model device configuration, including GPU settings and memory management options.

LM.LoadingOptions

Represents options for loading a model, allowing customization of the loading process.

LM.Metadata

Represents metadata information associated with a model.

LM.MetadataCollection

Represents a collection of Metadata objects.

LM.TensorDistribution

Represents the distribution of model layers or rows across multiple GPUs.

LM.TensorOverride

Specifies a tensor buffer type override that controls which device (CPU or GPU) is used for tensors matching a regex pattern. This enables fine-grained control over tensor placement, particularly useful for offloading MoE (Mixture of Experts) expert weights to CPU while keeping attention layers on GPU.

ModelCard

Represents metadata and attributes for a language model in the LM-Kit library.

ModelFileLock

Cross-process guard for materializing one model file on a volume that several processes may share: the first writer holds an exclusive lock file beside the destination while it downloads or extracts, every other process asking for the same file waits on that lock instead of writing concurrently, and on release the waiter finds the finished file and simply uses it. The lock file is opened with DeleteOnClose and no sharing, so it evaporates with its holder: a crashed writer releases waiters through the operating system, never through cleanup code that would have to run. Uncontended acquisition costs one file create/delete.

Enums

LM.Precision

Represents the different precision types for LM models.

LM.RopeType

Specifies the type of rope algorithm used for positional encoding in models.

LM.TemplateFormat

Defines the possible formats for model chat templates, indicating specific structures and encoding standards used for chatbot interactions.

LM.TemplateFormatFlags

Flags controlling how a template formats system/developer messages and suffixes.

LM.ToolCallingFormat

The tool-call wire protocol a chat template speaks: which markers open a call, how arguments are shaped, and how results are fed back. Detected from the template fingerprint at load time; assignable through ChatToolCallingFormat so an imported model whose template the detection does not recognize can declare its dialect instead of falling back to the generic flow.

ModelCapabilities

Flags enum describing the capabilities a model supports in LM-Kit. Multiple values can be combined with bitwise operations to represent models that support several capabilities.

Delegates

LM.ModelDownloadingProgressCallback

A delegate designed to monitor and report the progress of model downloading.

LM.ModelLoadingProgressCallback

A delegate designed to monitor and report the progress of model loading.

Share