Expand description
§combs-formats
File-format adapter layer. The runtime and model crates never touch file
formats directly; they go through the ModelSource trait (the
LiteRT-LM ModelResources equivalent). Phase 1 ships the
[safetensors] adapter (HuggingFace config.json + model.safetensors,
mmap-backed, zero-copy views). GGUF / ONNX / litertlm adapters plug in
here later by implementing the same trait.
Modules§
- quants
- Reference CPU dequantizers for GGUF quant formats. These scalar
implementations are the harmony reference that the fused GPU kernels in
combs-modelsvalidate against: every kernel is tested against a portable reference.
Structs§
- Attention
Pattern - Attention RoPE/scale settings that vary by layer type (Gemma2/3):
pattern-th layers are “global” (full attention,rope_theta); the rest are “local” (sliding-window attention,rope_local_theta). - Gguf
Source - A parsed GGUF file.
- Model
Metadata - Architecture + hyperparameter description of a model, format-agnostic.
- Quant
Tensor - A quantized tensor’s packed bytes, exactly as stored in the file.
- Safetensors
Source ModelSourceover a HuggingFace-format directory.- Sampler
Config - Default sampler parameters, typically from
generation_config.json. - Section
Info - A section directory entry.
- Tensor
Reader - A lazy view over one tensor’s raw bytes inside a
ModelSource. - Tflite
Source - A TFLite model file as a
ModelSource(Gemma-family exports). - Tokenizer
Spec - Where to find the tokenizer and which special tokens it defines.
- Vision
Config - Vision-encoder hyperparameters parsed from
config.json::vision_config(plus top-levelscale_factor/image_token_id).
Enums§
- Activation
- MLP activation function, parsed from
hidden_act/hidden_activation. The tanh-approximation family (gelu_pytorch_tanh,gelu_new,gelu_fast) all map toActivation::GeluTanh. - Format
Error - Errors produced by format adapters.
- Quant
Format - GGUF quant formats with a native device kernel (see
combs-models). - Rope
Scaling - RoPE frequency scaling, parsed from HF
rope_scaling(accepts both the modernrope_typeand the legacytypekey). Table math lives incombs-models::rope; this is parse-only. - Tensor
Dtype - Element dtypes supported by the loaders.
Traits§
- Model
Source - The central adapter trait: a source of model weights + config, independent
of the on-disk format (LiteRT-LM
ModelResourcesequivalent).
Functions§
- ensure_
tokenizer_ json_ from_ spm - Ensures a tokenizer.json exists for a SentencePiece
.modelfile, converting + caching it next to the source on first use. Returns the path (idempotent: an existing cache is reused). - litertlm_
read_ sections - Reads the section directory of a
.litertlmfile header. - open_
model_ source - Opens any supported model path: a
.gguffile, or a directory in the HuggingFace safetensors layout. This is the single entry point the CLI, FFI and server use — format detection lives here. - spm_
added_ tokens - Parses a SentencePiece model and returns its special-token map
(id → string), for
TokenizerSpec.added_tokens.
Type Aliases§
- Result
- Convenient result alias for this crate.