Method LoadEncryptedFromStream
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
encryptedStreamStreamschemeGgufEncryptionSchemepasswordstringdeviceConfigurationLM.DeviceConfigurationloadingOptionsLM.LoadingOptionsloadingProgressLM.ModelLoadingProgressCallbackleaveOpenbool
Returns
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).