Expand description
§combs-models
Model architecture registry. The runtime drives any architecture through
the fixed GenerativeModel contract (MLC’s embed/prefill/decode/ create_kv_cache function set); architectures register themselves in the
ModelRegistry. Phase 1 ships the Llama family (incl. SmolLM2).
Structs§
- Cache
Config - Configuration for a KV cache instance.
- ContiguousKV
Cache - Simple contiguous cache: stores one K and one V tensor per layer and concatenates along the sequence dimension every step.
- Llama
Model - Llama-family causal LM.
- Model
Registry - Maps architecture identifiers (
config.json::model_type, plus known aliases) to loaders. Mirrors MLC’smodel.py::MODELStable. - PagedKV
Cache - MLC-style paged KV cache.
- Quantized
Linear y = x @ W^T (+ b)whereWis stored group-quantized to 4 bits.- Rotary
Embedding - Precomputed RoPE cosine/sine tables.
- Smol
VlmModel - SmolVLM (Idefics3): SigLIP + connector + Llama-family text decoder.
Enums§
- Cache
Kind - Which
KVCacheimplementation to instantiate. - Model
Error - Errors produced while constructing or running models.
Traits§
- Generative
Model - Fixed contract every generative architecture implements — the direct
analog of MLC’s
embed / prefill / decode / create_kv_cachefunction set. The runtime only ever talks to models through this trait. - KVCache
- Per-layer key/value storage that owns the attention computation.
Functions§
- image_
prompt_ expansion - Builds the Idefics3 prompt expansion for one image:
<fake_token_around_image><global-img><image>×image_seq_len<fake_token_around_image>. (image_seq_len= 64 for SmolVLM-256M.) The returned string is meant to replace each<image>placeholder in the chat text. - pixels_
to_ tensor - Builds a
[1, 3, H, W]pixel tensor from planar CHW f32 data (used by the runtime to hand media toembed_multimodal). - rms_
norm y = x / rms(x) * wwherermsis taken over the last dimension andepsis added inside the square root.
Type Aliases§
- Result
- Convenient result alias for this crate.