Model Loading

30 public types in this namespace, organized by kind.

Models & Types (16)

Type Summary
DbrxTensorSource Adapts a DBRX checkpoint’s tensors to the Hugging Face parameter names the pretrained builders expect.
FusedProjectionSource Wraps a tensor source that stores fused projections (Phi-3: a single self_attn.qkv_proj and mlp.gate_up_proj per layer) and exposes the individual q_proj/k_proj/v_proj and gate_proj/up_proj tensors that LlamaModelBuilder e…
GgufModelSource Opens a GGUF (llama.cpp) checkpoint as a decoder-ready source: it reads the architecture from the GGUF metadata into a HuggingFaceConfig and exposes the weights under the Hugging Face parameter names LlamaModelBuilder expects, translati…
HuggingFaceModelLoader<T> Downloads and caches models from HuggingFace Hub.
LoadResult Result of a model weight loading operation.
ONNXImporter<T> Imports weights from ONNX model files.
ONNXTensorInfo Information about a tensor in an ONNX file.
OnnxFullModelAdapter<T> Adapts an OnnxModel (an IOnnxModel that runs an ONNX graph through the ONNX runtime) to the IFullModel, ILanguageModel, and IIncrementalCausalLanguageModel contracts so ConfigureModel(PretrainedSource.Onnx(path)) supports full-c…
ParameterRegistry<T> Manages named parameters for weight loading.
PretrainedModelLoader<T> Loads pretrained models from various sources.
PretrainedSource A declarative description of where a pretrained model comes from and how to decode it.
SafeTensorsLoader<T> Loads model weights from SafeTensors format files.
ShardedSafetensorsSource An INamedTensorSource over a Hugging Face model directory whose weights may be split across several *.safetensors shards.
TensorMetadata Metadata about a tensor in a SafeTensors file.
ValidationResult Result of weights file validation.
WeightMapping Maps weight names between different model formats.

Enums (2)

Type Summary
PretrainedDType The numeric precision a pretrained checkpoint’s weights are decoded into when loaded.
PretrainedModelKind The kind of pretrained-model source a PretrainedSource points at.

Delegates (1)

Type Summary
DecoderFactory<T> Builds a weight-loaded network from a parsed config and a tensor source.

Options & Configuration (2)

Type Summary
DecoderOptions<T> Per-family knobs for LlamaModelBuilder that capture the small, faithful differences between LLaMA-family decoders (LLaMA/Mistral/Qwen2 use the defaults; Gemma flips the norm and embedding options; Phi-3 pre-splits its fused projections be…
HuggingFaceConfig A strongly-typed view over a Hugging Face decoder config.json (the LLaMA / Mistral / Qwen2 text-model family).

Helpers & Utilities (9)

Type Summary
CohereModelBuilder<T> Reconstructs a Cohere (Command-R) decoder from a Hugging Face HuggingFaceConfig and loads its weights.
DbrxModelBuilder<T> Reconstructs a DBRX decoder from a Hugging Face HuggingFaceConfig and loads its weights.
Gemma2ModelBuilder<T> Reconstructs a Gemma-2 decoder from a Hugging Face HuggingFaceConfig and loads its weights.
LlamaModelBuilder<T> Reconstructs a LLaMA-family decoder (LLaMA / Mistral / Qwen2) from a Hugging Face HuggingFaceConfig and loads its pretrained weights from a safetensors/GGUF tensor source.
MoEModelBuilder<T> Reconstructs a sparse mixture-of-experts decoder (Mixtral) from a Hugging Face HuggingFaceConfig and loads its pretrained weights.
PretrainedArchitectures<T> Registry mapping Hugging Face architecture / model-type names to the factory that reconstructs and weight-loads that architecture.
PretrainedLoader<T> Resolves a PretrainedSource to a ready-to-use model: it downloads (for hub sources), reads config.json, looks the architecture up in PretrainedArchitectures, reconstructs the network, and loads its pretrained weights.
Qwen2MoEModelBuilder<T> Reconstructs a Qwen2-MoE decoder from a Hugging Face HuggingFaceConfig and loads its weights.
StarCoder2ModelBuilder<T> Reconstructs a StarCoder2 decoder from a Hugging Face HuggingFaceConfig and loads its weights.