Table of Contents

Method LoadEncryptedFromStream

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

LoadEncryptedFromStream(Stream, string, DeviceConfiguration, LoadingOptions, ModelLoadingProgressCallback, bool)

Load an LM-Kit encrypted GGUF (.lmke) container directly from a caller-supplied encryptedStream, reading the encryption scheme from the container's own header. Equivalent to LoadEncryptedFromStream(Stream, GgufEncryptionScheme, string, DeviceConfiguration, LoadingOptions, ModelLoadingProgressCallback, bool) with the recorded scheme.

public static LM LoadEncryptedFromStream(Stream encryptedStream, string password, LM.DeviceConfiguration deviceConfiguration = null, LM.LoadingOptions loadingOptions = null, LM.ModelLoadingProgressCallback loadingProgress = null, bool leaveOpen = false)

Parameters

encryptedStream Stream
password string
deviceConfiguration LM.DeviceConfiguration
loadingOptions LM.LoadingOptions
loadingProgress LM.ModelLoadingProgressCallback
leaveOpen bool

Returns

LM

LoadEncryptedFromStream(Stream, GgufEncryptionScheme, string, DeviceConfiguration, LoadingOptions, ModelLoadingProgressCallback, bool)

Load an LM-Kit encrypted GGUF (.lmke) container directly from a caller-supplied encryptedStream. Tensor bytes are decrypted on the fly into the native destination buffer; no plaintext copy lives in memory nor is written to disk. The stream must be readable and seekable.

public static LM LoadEncryptedFromStream(Stream encryptedStream, GgufEncryptionScheme scheme, string password, LM.DeviceConfiguration deviceConfiguration = null, LM.LoadingOptions loadingOptions = null, LM.ModelLoadingProgressCallback loadingProgress = null, bool leaveOpen = false)

Parameters

encryptedStream Stream
scheme GgufEncryptionScheme
password string
deviceConfiguration LM.DeviceConfiguration
loadingOptions LM.LoadingOptions
loadingProgress LM.ModelLoadingProgressCallback
leaveOpen bool

Returns

LM

Remarks

Pass loadingOptions.LoadTensors = false to load only the metadata and vocabulary without decrypting any tensor bytes. This is the encrypted-stream equivalent of the plaintext metadata-only path. When leaveOpen is false (the default), the loader owns the stream and disposes it once loading completes (or fails).

Share