Bounded intake
GgufParseOptions places explicit limits on tensor counts, metadata counts, dimensions, strings, arrays, and nesting before dependent work proceeds.
UAIX.LmRuntime / Package guide
Bounded GGUF parsing, metadata and tensor catalogs, strict validation, sharding, hashing, and mapped tensor access.
Required For GGUF inspection and validation
UAIX.LmRuntime.Gguf
Bounded GGUF parsing, metadata and tensor catalogs, strict validation, sharding, hashing, and mapped tensor access.
GGUF parser, metadata model, tensor catalog, sharding, and validation for pure C# local LLM runtime packages.
dotnet add package UAIX.LmRuntime.Gguf
<PackageReference Include="UAIX.LmRuntime.Gguf" />
Version policy: The documentation deliberately omits UAIX.LmRuntime package version numbers. Resolve and pin versions through your normal dependency-management and lock-file process.
Review the current package metadata, frameworks, dependencies, and downloads on NuGet ↗
GgufParseOptions places explicit limits on tensor counts, metadata counts, dimensions, strings, arrays, and nesting before dependent work proceeds.
GgufModel represents container metadata and tensor descriptors. A structurally valid file can still be unsupported by a tokenizer or model-family loader.
MappedGgufFile owns the mapping lifetime. Tensor spans and views must not outlive the owner, and callers should dispose the mapping deterministically.
These are the main entry points for this package. The generated reference below includes every documented type and member represented by public package XML documentation.
GgufReader
GgufParseOptions
GgufModel
GgufStrictValidator
GgufTensorDescriptor
GgufHashingReader
MappedGgufFile
MappedTensorView
Float32TensorReader
SegmentedModelFileReader
Examples use public package signatures documented on LMRuntime.com. Model paths, hashes, byte counts, prompts, and host-specific identifiers remain application inputs.
Return all structural validation errors without moving immediately into model execution.
using UAIX.LmRuntime.Gguf;
var options = new GgufParseOptions
{
MaxTensorCount = 100_000,
MaxMetadataCount = 100_000,
MaxDimensionCount = 8,
MaxStringBytes = 16 * 1024 * 1024,
MaxArrayLength = 10_000_000,
MaxArrayDepth = 8
};
GgufValidationReport report =
GgufStrictValidator.Validate("models/model.gguf", options);
if (!report.IsValid)
{
foreach (GgufValidationError error in report.Errors)
{
Console.Error.WriteLine(
$"{error.Code}: {error.Message} @ {error.ByteOffset?.ToString() ?? "n/a"}");
}
return;
}
Console.WriteLine($"Tensors: {report.Model.Tensors.Count}");
Console.WriteLine($"Metadata entries: {report.Model.Metadata.Count}");
Parse the container and enumerate the metadata/tensor catalog without materializing model weights.
using UAIX.LmRuntime.Gguf;
GgufModel model = GgufReader.Read(
"models/model.gguf",
new GgufParseOptions());
Console.WriteLine($"Artifact kind: {model.ArtifactKind}");
Console.WriteLine($"GGUF container version: {model.Version}");
Console.WriteLine($"Tensor data offset: {model.TensorDataOffset}");
Console.WriteLine($"Alignment: {model.Alignment}");
if (model.TryGetString("general.name", out string? modelName))
{
Console.WriteLine($"Model name: {modelName}");
}
foreach (GgufTensorDescriptor tensor in model.Tensors)
{
Console.WriteLine(
$"{tensor.Name}: {tensor.GgmlType}, " +
$"{tensor.ElementCount:N0} elements, {tensor.ByteLength:N0} bytes");
}
Calculate SHA-256 before accepting a local artifact into a trusted model catalog.
using UAIX.LmRuntime.Gguf;
public static class GgufIdentityVerifier
{
/// <summary>
/// Computes the current GGUF digest and rejects an artifact that does not match the trusted identity.
/// </summary>
/// <param name="modelPath">The local GGUF path to hash.</param>
/// <param name="expectedSha256">The expected 64-character SHA-256 digest.</param>
/// <returns>The normalized digest computed from the current file bytes.</returns>
public static string VerifySha256(
string modelPath,
string expectedSha256)
{
ArgumentException.ThrowIfNullOrWhiteSpace(modelPath);
ArgumentException.ThrowIfNullOrWhiteSpace(expectedSha256);
string actualSha256 = GgufHashingReader.ComputeSha256(modelPath);
if (!string.Equals(
actualSha256,
expectedSha256,
StringComparison.OrdinalIgnoreCase))
{
throw new InvalidDataException(
"The GGUF artifact hash does not match the trusted identity.");
}
return actualSha256;
}
}
Keep the mapped file alive while reading a tensor view and copy values only when the caller needs an owned array.
using System.Linq;
using UAIX.LmRuntime.Gguf;
using UAIX.LmRuntime.Tensors;
GgufModel model = GgufReader.Read(
"models/model.gguf",
new GgufParseOptions());
GgufTensorDescriptor descriptor = model.Tensors
.First(tensor => tensor.GgmlType == GgmlTensorType.F32);
using var mapped = new MappedGgufFile(model);
MappedTensorView view = mapped.CreateTensorView(
descriptor,
descriptor.Dimensions);
var reader = new Float32TensorReader(view);
float firstValue = reader.ReadElement(0);
float[] ownedValues = reader.ToArray();
Console.WriteLine($"First value: {firstValue}");
Console.WriteLine($"Copied values: {ownedValues.Length}");
Expand a type to review its documented fields, properties, constructors, methods, parameter descriptions, and return descriptions. Browser Find also works across the closed detail elements.
Float32TensorReaderUAIX.LmRuntime.Gguf
5 members
Reads float32 values from a validated tensor view with explicit GGUF byte-order handling.
ElementCount
Gets the logical float32 element count.
CopyTo(System.Span<float>)
Decodes every element into a caller-provided destination.
destinationFloat32TensorReader(UAIX.LmRuntime.Gguf.IReadOnlyTensorView)
Initializes a new Float32TensorReader instance with validated dependencies and operational bounds.
viewReadElement(int)
Reads one element by flat storage index.
indexReturns: The float value computed by Float32TensorReader.ReadElement for this contract: Reads one element by flat storage index. Range, finite-value, and overflow checks are completed before the value is returned.
ToArray
Creates an explicit bounded managed copy for scalar reference execution.
Returns: A newly allocated float[] containing the ordered result of Float32TensorReader.ToArray: Creates an explicit bounded managed copy for scalar reference execution. The caller owns the returned array and later mutation cannot alter the source object.
GgufArtifactClassifierUAIX.LmRuntime.Gguf
1 member
Classifies GGUF artifacts from metadata.
Classify(UAIX.LmRuntime.Gguf.GgufModel)
Classifies the GGUF artifact kind from validated metadata and tensor-layout evidence.
modelReturns: The GgufArtifactKind result produced by GgufArtifactClassifier.Classify for this contract: Classifies the GGUF artifact kind from validated metadata and tensor-layout evidence. It is published only after all documented validation and ownership transitions succeed.
GgufArtifactKindUAIX.LmRuntime.Gguf
5 members
Identifies the likely role of a GGUF artifact.
BaseModel
Base model artifact.
LoraSidecar
LoRA sidecar artifact.
MultimodalProjectorSidecar
Multimodal projector sidecar artifact.
MultiTokenPredictionSidecar
Multi-token-prediction sidecar artifact.
VocabOnly
Vocabulary-only artifact.
GgufByteOrderUAIX.LmRuntime.Gguf
3 members
Identifies the byte order used by a GGUF artifact.
Auto
Detect the byte order from the version field and reject ambiguous headers.
BigEndian
Interpret multi-byte values as big-endian.
LittleEndian
Interpret multi-byte values as little-endian.
GgufDiagnosticUAIX.LmRuntime.Gguf
3 members
Represents a structured GGUF parser diagnostic.
ByteOffset
Gets the byte offset associated with the diagnostic when known.
Code
Gets the stable diagnostic code.
Message
Gets the diagnostic message.
GgufDumpWriterUAIX.LmRuntime.Gguf
1 member
Writes human-readable GGUF metadata and tensor catalog dumps.
Write(UAIX.LmRuntime.Gguf.GgufModel)
Creates a textual dump for a parsed GGUF model.
modelReturns: The text produced by GgufDumpWriter.Write for this contract: Creates a textual dump for a parsed GGUF model. The returned string is detached from mutable caller storage and is not persisted by the operation.
GgufFormatExceptionUAIX.LmRuntime.Gguf
3 members
Represents a GGUF format violation with a stable code and byte offset.
ByteOffset
Gets the byte offset associated with the violation when known.
Code
Gets the stable diagnostic code.
GgufFormatException(string,string,System.Nullable<ulong>,System.Exception)
Initializes a new GgufFormatException instance with validated dependencies and operational bounds.
codemessagebyteOffsetinnerExceptionGgufHashingReaderUAIX.LmRuntime.Gguf
1 member
Computes integrity hashes for GGUF and related model artifacts.
ComputeSha256(string)
Computes the SHA-256 hash of a file.
pathReturns: The text produced by GgufHashingReader.ComputeSha256 for this contract: Computes the SHA-256 hash of a file. The returned string is detached from mutable caller storage and is not persisted by the operation.
GgufJsonDumpWriterUAIX.LmRuntime.Gguf
1 member
Writes machine-readable GGUF dump JSON.
Write(UAIX.LmRuntime.Gguf.GgufModel)
Writes a stable JSON dump for a parsed GGUF model.
modelReturns: The text produced by GgufJsonDumpWriter.Write for this contract: Writes a stable JSON dump for a parsed GGUF model. The returned string is detached from mutable caller storage and is not persisted by the operation.
GgufMetadataAccessorsUAIX.LmRuntime.Gguf
6 members
Provides strongly typed accessors for GGUF metadata values.
TryGetBoolean(UAIX.LmRuntime.Gguf.GgufModel,string,bool@)
Tries to read a Boolean metadata value.
modelkeyvalueReturns: True when the key exists and contains a Boolean value.
TryGetByteArray(UAIX.LmRuntime.Gguf.GgufModel,string,System.Collections.Generic.IReadOnlyList<byte>@)
Tries to read a metadata byte array.
modelkeyvaluesReturns: True when the key exists and contains integral elements convertible to bytes.
TryGetInt32(UAIX.LmRuntime.Gguf.GgufModel,string,int@)
Tries to read a metadata 32-bit signed integer scalar.
modelkeyvalueReturns: True when the key exists and contains an integral value convertible to int.
TryGetInt32Array(UAIX.LmRuntime.Gguf.GgufModel,string,System.Collections.Generic.IReadOnlyList<int>@)
Tries to read a metadata 32-bit signed integer array.
modelkeyvaluesReturns: True when the key exists and contains integral elements convertible to int.
TryGetSingleArray(UAIX.LmRuntime.Gguf.GgufModel,string,System.Collections.Generic.IReadOnlyList<float>@)
Tries to read a metadata single-precision floating point array.
modelkeyvaluesReturns: True when the key exists and contains numeric elements convertible to float.
TryGetStringArray(UAIX.LmRuntime.Gguf.GgufModel,string,System.Collections.Generic.IReadOnlyList<string>@)
Tries to read a metadata string array.
modelkeyvaluesReturns: True when the key exists and contains only string elements.
GgufMetadataArrayUAIX.LmRuntime.Gguf
3 members
Represents a typed GGUF metadata array.
ElementType
Gets the element type.
Items
Gets the array values.
ToString
Returns a concise description of this array.
Returns: The text produced by GgufMetadataArray.ToString for this contract: Returns a concise description of this array. The returned string is detached from mutable caller storage and is not persisted by the operation.
GgufMetadataKeyPolicyUAIX.LmRuntime.Gguf
1 member
Validates GGUF metadata key syntax.
Validate(string)
Validates the supplied key against the invariants required by GgufMetadataKeyPolicy.
keyReturns: The GgufValidationError? result produced by GgufMetadataKeyPolicy.Validate for this contract: Validates the supplied key against the invariants required by GgufMetadataKeyPolicy. It is published only after all documented validation and ownership transitions succeed.
GgufMetadataValueUAIX.LmRuntime.Gguf
4 members
Represents a typed GGUF metadata value.
Type
Gets the metadata value type.
Value
Gets the scalar value or a UAIX.LmRuntime.Gguf.GgufMetadataArray for arrays.
Create(UAIX.LmRuntime.Gguf.GgufMetadataValueType,object)
Creates the GGUF metadata value from the validated inputs required by GgufMetadataValue.
typevalueReturns: The metadata value, with ownership and disposal obligations defined by the returned type and the Create contract.
ToString
Returns the string representation of this value.
Returns: The text produced by GgufMetadataValue.ToString for this contract: Returns the string representation of this value. The returned string is detached from mutable caller storage and is not persisted by the operation.
GgufMetadataValueTypeUAIX.LmRuntime.Gguf
13 members
Identifies GGUF metadata value types.
Array
Typed array.
Bool
Boolean.
Float32
32-bit floating point.
Float64
64-bit floating point.
Int16
16-bit signed integer.
Int32
32-bit signed integer.
Int64
64-bit signed integer.
Int8
8-bit signed integer.
String
UTF-8 string.
UInt16
16-bit unsigned integer.
UInt32
32-bit unsigned integer.
UInt64
64-bit unsigned integer.
UInt8
8-bit unsigned integer.
GgufModelUAIX.LmRuntime.Gguf
15 members
Represents a parsed GGUF artifact catalog and metadata dictionary.
Alignment
Gets the tensor-data alignment.
ArtifactKind
Gets the inferred artifact kind.
ByteOrder
Gets the resolved byte order used by the artifact.
FileLength
Gets the source file length captured during parsing.
Metadata
Gets the parsed metadata dictionary.
Path
Gets the source file path.
Shard
Gets shard metadata.
TensorDataOffset
Gets the absolute tensor-data section start offset.
Tensors
Gets the tensor catalog.
Version
Gets the GGUF format version.
Load(string,UAIX.LmRuntime.Gguf.GgufParseOptions)
Loads the GGUF model from a verified local source into GgufModel.
pathoptionsReturns: The parsed model catalog, with ownership and disposal obligations defined by the returned type and the Load contract.
TryGetSingle(string,float@)
Tries to get a single-precision metadata value.
keyvalueReturns: True when the key exists and can be converted to a single-precision value.
TryGetString(string,string@)
Tries to get a string metadata value.
keyvalueReturns: True when the key exists and contains a string.
TryGetTensor(string,UAIX.LmRuntime.Gguf.GgufTensorDescriptor@)
Tries to resolve a tensor descriptor by its exact GGUF name.
nametensorReturns: True when try get tensor succeeds for the supplied values; otherwise, false.
TryGetUInt32(string,uint@)
Tries to get an unsigned 32-bit metadata value.
keyvalueReturns: True when the key exists and can be converted to an unsigned 32-bit integer.
GgufParseOptionsUAIX.LmRuntime.Gguf
7 members
Defines safety limits for GGUF parsing.
ByteOrder
Gets the requested GGUF byte order. Auto uses the version-field heuristic.
MaxArrayDepth
Gets the maximum recursive array depth.
MaxArrayLength
Gets the maximum metadata array length.
MaxDimensionCount
Gets the maximum supported dimension count per tensor.
MaxMetadataCount
Gets the maximum supported metadata key-value count.
MaxStringBytes
Gets the maximum metadata string byte length.
MaxTensorCount
Gets the maximum supported tensor count.
GgufParseResultUAIX.LmRuntime.Gguf
3 members
Represents a non-throwing GGUF parse result.
Diagnostics
Gets parser diagnostics.
Model
Gets the parsed model when parsing succeeded.
Succeeded
Gets a value indicating whether parsing succeeded without diagnostics.
GgufReaderUAIX.LmRuntime.Gguf
2 members
Reads and validates GGUF model artifacts.
Read(string,UAIX.LmRuntime.Gguf.GgufParseOptions)
Reads a GGUF artifact from disk without copying tensor payloads to managed memory.
pathoptionsReturns: The GgufModel result produced by GgufReader.Read for this contract: Reads a GGUF artifact from disk without copying tensor payloads to managed memory. It is published only after all documented validation and ownership transitions succeed.
TryRead(string,UAIX.LmRuntime.Gguf.GgufParseOptions)
Parses a GGUF artifact and returns structured diagnostics instead of throwing for format failures.
pathoptionsReturns: True when the GGUF parse result is produced successfully; otherwise, false and no successful result is published.
GgufShardInfoUAIX.LmRuntime.Gguf
3 members
Describes sharding metadata found in a GGUF artifact.
IsSharded
Gets a value indicating whether sharding metadata was found.
ShardCount
Gets the shard count when present.
ShardIndex
Gets the shard index when present.
GgufShardResolverUAIX.LmRuntime.Gguf
1 member
Resolves GGUF shard files adjacent to a root artifact.
ResolveShards(string)
Resolves likely shard paths for a GGUF model path.
pathReturns: An ordered read-only IReadOnlyList<string> result from GgufShardResolver.ResolveShards: Resolves likely shard paths for a GGUF model path. Mutable internal collection aliases are not exposed through the returned contract.
GgufStrictValidatorUAIX.LmRuntime.Gguf
1 member
Validates GGUF artifacts without claiming execution parity.
Validate(string,UAIX.LmRuntime.Gguf.GgufParseOptions)
Validates the supplied path and the supplied options against the invariants required by GgufStrictValidator.
pathoptionsReturns: The GgufValidationReport result produced by GgufStrictValidator.Validate for this contract: Validates the supplied path and the supplied options against the invariants required by GgufStrictValidator. It is published only after all documented validation and ownership transitions succeed.
GgufTensorDescriptorUAIX.LmRuntime.Gguf
7 members
Describes a tensor stored in a GGUF artifact without copying its payload.
AbsoluteOffset
Gets the absolute file offset for this tensor.
ByteLength
Gets the physical tensor byte length.
Dimensions
Gets tensor dimensions in GGUF order.
ElementCount
Gets the logical element count.
GgmlType
Gets the GGML storage type.
Name
Gets the tensor name.
RelativeOffset
Gets the relative tensor offset from the tensor data section.
GgufTensorPayloadViewUAIX.LmRuntime.Gguf
3 members
Represents a zero-copy tensor payload range inside a GGUF file.
AbsoluteOffset
Gets the absolute file offset.
LengthBytes
Gets the payload byte length.
FromTensor(UAIX.LmRuntime.Gguf.GgufTensorDescriptor)
Creates a payload view from a tensor descriptor.
tensorReturns: The GgufTensorPayloadView result produced by GgufTensorPayloadView.FromTensor for this contract: Creates a payload view from a tensor descriptor. It is published only after all documented validation and ownership transitions succeed.
GgufValidationErrorUAIX.LmRuntime.Gguf
3 members
Represents a GGUF validation error.
ByteOffset
Gets the byte offset associated with the error, if known.
Code
Gets the diagnostic code.
Message
Gets the diagnostic message.
GgufValidationReportUAIX.LmRuntime.Gguf
3 members
Represents the result of strict GGUF validation.
Errors
Gets validation errors with byte offsets when known.
IsValid
Gets a value indicating whether validation succeeded.
Model
Gets the parsed model when validation succeeded.
IMappedModelFileUAIX.LmRuntime.Gguf
6 members
Defines bounded, zero-copy access to tensor payloads in a mapped model artifact.
FileLength
Gets the mapped file length in bytes.
Model
Gets the parsed GGUF model catalog associated with the mapping.
GetMemorySegments(ulong,ulong,int)
Creates bounded read-only memory windows for a validated mapped-file range.
absoluteOffsetbyteLengthmaximumSegmentByteCountReturns: Ordered borrowed segments whose combined length equals byteLength.
GetTensorBytes(UAIX.LmRuntime.Gguf.GgufTensorDescriptor)
Gets a synchronous read-only span over one tensor payload.
tensorReturns: A read-only span valid until this mapping is disposed.
GetTensorMemory(UAIX.LmRuntime.Gguf.GgufTensorDescriptor)
Gets a read-only memory view over one tensor payload.
tensorReturns: A read-only memory view whose owner remains the mapped file.
TryGetTensorMemory(string,System.ReadOnlyMemory<byte>@)
Attempts to get a read-only memory view by tensor name.
tensorNamememoryReturns: True when try get tensor memory succeeds for the supplied values; otherwise, false.
IReadOnlyTensorViewUAIX.LmRuntime.Gguf
8 members
Defines a read-only tensor view backed by validated model storage.
ByteOrder
Gets the GGUF byte order.
DataType
Gets the runtime data type.
Descriptor
Gets the authoritative GGUF tensor descriptor.
IsDisposed
Gets whether the backing owner has been disposed.
LogicalDimensions
Gets normalized logical row-major dimensions.
StorageDimensions
Gets dimensions in GGUF storage order.
GetMemory
Gets a borrowed read-only memory view over the tensor payload.
Returns: The memory region containing the memory, bounded to the validated range owned by the result.
GetSpan
Gets a synchronous borrowed span over the tensor payload.
Returns: The bounded ReadOnlySpan<byte> view produced by IReadOnlyTensorView.GetSpan: Gets a synchronous borrowed span over the tensor payload. Its lifetime and ownership remain tied to the owner identified by the containing type; no out-of-range region is exposed.
MappedGgufFileUAIX.LmRuntime.Gguf
14 members
Owns a read-only operating-system mapping of a GGUF artifact and exposes bounded tensor payload views.
The mapping is the sole owner of the acquired unmanaged pointer. Returned spans and memory views borrow that pointer and become invalid immediately after UAIX.LmRuntime.Gguf.MappedGgufFile.Dispose. Public entry points verify that descriptors belong to the parsed catalog before pointer arithmetic occurs.
FileLength
Gets the mapped file length captured from the validated catalog.
IsDisposed
Gets a value indicating whether the mapping has been disposed.
Model
Gets the immutable GGUF catalog that was validated before the operating-system mapping was opened.
CopyBytes(ulong,System.Span<byte>)
Copies a validated mapped-file range into a caller-owned destination.
absoluteOffsetdestinationCopyTensorBytes(UAIX.LmRuntime.Gguf.GgufTensorDescriptor,System.Span<byte>)
Copies a complete tensor payload into a caller-owned destination.
tensordestinationCreateTensorView(UAIX.LmRuntime.Gguf.GgufTensorDescriptor,System.Collections.Generic.IReadOnlyList<ulong>)
Creates a read-only typed tensor view whose lifetime is owned by this mapping.
tensorlogicalDimensionsReturns: The borrowed mapped tensor view, with ownership and disposal obligations defined by the returned type and the CreateTensorView contract.
Dispose
Releases the acquired view pointer, operating-system mapping handles, and source file handle.
GetBytes(ulong,ulong)
Gets a read-only span over a validated file range.
absoluteOffsetbyteLengthReturns: The bounded ReadOnlySpan<byte> view produced by MappedGgufFile.GetBytes: Gets a read-only span over a validated file range. Its lifetime and ownership remain tied to the owner identified by the containing type; no out-of-range region is exposed.
GetMemorySegments(ulong,ulong,int)
Splits a validated mapped-file range into bounded borrowed memory segments.
absoluteOffsetbyteLengthmaximumSegmentByteCountReturns: Ordered borrowed memory segments that exactly cover the requested range.
GetTensorBytes(UAIX.LmRuntime.Gguf.GgufTensorDescriptor)
Gets a synchronous borrowed span over one catalog tensor payload.
tensorReturns: A read-only span whose lifetime cannot exceed the current synchronous call chain.
GetTensorMemory(UAIX.LmRuntime.Gguf.GgufTensorDescriptor)
Gets a borrowed memory object over one catalog tensor payload.
tensorReturns: A read-only memory view backed directly by the operating-system mapping.
MappedGgufFile(string,UAIX.LmRuntime.Gguf.GgufParseOptions)
Opens, validates, and maps a GGUF file read-only.
pathoptionsMappedGgufFile(UAIX.LmRuntime.Gguf.GgufModel)
Maps a GGUF file using an already validated catalog.
modelTryGetTensorMemory(string,System.ReadOnlyMemory<byte>@)
Tries to resolve a named tensor and create a borrowed mapped-memory view.
tensorNamememoryReturns: True when the tensor exists and a view was created; otherwise false.
MappedTensorViewUAIX.LmRuntime.Gguf
9 members
Carries validated tensor geometry and a borrowed read-only view into a mapped GGUF file.
ByteOrder
DataType
Descriptor
IsDisposed
LogicalDimensions
StorageDimensions
GetMemory
Retrieves the memory from the current MappedTensorView state after validating the requested access.
Returns: The memory region containing the memory, bounded to the validated range owned by the result.
GetSpan
Retrieves the span from the current MappedTensorView state after validating the requested access.
Returns: The bounded ReadOnlySpan<byte> view produced by MappedTensorView.GetSpan: Retrieves the span from the current MappedTensorView state after validating the requested access. Its lifetime and ownership remain tied to the owner identified by the containing type; no out-of-range region is exposed.
MappedTensorView(UAIX.LmRuntime.Gguf.MappedGgufFile,UAIX.LmRuntime.Gguf.GgufTensorDescriptor,System.Collections.Generic.IReadOnlyList<ulong>)
Initializes a new MappedTensorView instance with validated dependencies and operational bounds.
ownerdescriptorlogicalDimensionsModelFileSegmentUAIX.LmRuntime.Gguf
5 members
Owns one pooled, bounded model-file segment returned by UAIX.LmRuntime.Gguf.SegmentedModelFileReader.
The segment owns an System.Buffers.ArrayPool`1 lease. Consumers may retain UAIX.LmRuntime.Gguf.ModelFileSegment.Memory only while this instance is alive and must dispose the segment exactly once when the bytes are no longer needed.
IsDisposed
Gets whether the pooled segment has been released.
Length
Gets the number of valid bytes in the segment.
Memory
Gets the read-only segment bytes while this owner remains alive.
Offset
Gets the unsigned logical file offset represented by this segment.
Dispose
Returns the rented byte array to the shared pool and invalidates Memory.
SegmentedModelFileOptionsUAIX.LmRuntime.Gguf
1 member
Configures bounded segmented reads from a model file whose logical offsets remain unsigned 64-bit values.
MaximumSegmentByteCount
Gets the maximum bytes returned by one owned segment.
SegmentedModelFileReaderUAIX.LmRuntime.Gguf
7 members
Reads bounded windows from a local model file without representing the complete file as one managed span.
Logical positions remain unsigned 64-bit values until the final checked conversion required by the operating-system random-access API. Returned owned segments are copies in pooled memory; caller-provided spans remain caller owned. This class performs no network access and never follows URLs.
IsDisposed
Gets whether the reader has released its file handle.
Length
Gets the file length as an unsigned 64-bit value.
MaximumSegmentByteCount
Gets the maximum owned segment size.
Dispose
Releases resources owned by SegmentedModelFileReader and transitions it to the disposed state.
ReadExactly(ulong,System.Span<byte>)
Reads exactly into a caller-owned bounded destination.
offsetdestinationReadSegment(ulong,int)
Reads the segment from the current binary source using the component's validated representation.
offsetlengthReturns: The ModelFileSegment result produced by SegmentedModelFileReader.ReadSegment for this contract: Reads the segment from the current binary source using the component's validated representation. It is published only after all documented validation and ownership transitions succeed.
SegmentedModelFileReader(string,UAIX.LmRuntime.Gguf.SegmentedModelFileOptions)
Opens a local model file for deterministic random access.
pathoptionsRead is the direct parse path and can throw for invalid input. TryRead returns a GgufParseResult containing success state, diagnostics, and the parsed model when available.
No. It proves the checked container invariants. Tokenizer compatibility, architecture support, required tensors, storage layouts, and execution still need their own validation gates.
No. Treat every span, memory segment, and mapped tensor view as borrowing the mapping lifetime.
No. The caller supplies local paths and owns model acquisition, licensing review, and trust policy.