Expand description
Q-GGUF Hybrid Packaging
Parses monolithic .gguf files: vocabulary (KV section) and tensor names/offsets
(tensor-info section) are extracted into native Rust types; multi-gigabyte tensor
payloads are left on disk for direct VRAM mapping via gguf_bridge.rs.
Structs§
- GGuf
Sharder - Extracts the Ontological mapping and Lexicon from a raw GGUF file
- Gguf
Hyperparams - Architecture hyper-parameters parsed from the GGUF KV section.
- Gguf
Tensor Index - Lookup table from tensor-name hash →
GgufTensorInfo, built by walking the GGUF tensor-info section that immediately follows the KV metadata section. - Gguf
Tensor Info - Shape + type + offset for one tensor parsed from the GGUF tensor-info section.
- Gguf
Tokenizer - Vocabulary and BOS/EOS metadata extracted from a GGUF KV section.
Used by
infer_local_model()to encode prompts and decode output token IDs. - Layer
Tensors - Per-layer transformer weight metadata (all
Option— absent tensors skipped). - Pretoken
Span
Enums§
- Chat
Family - Chat-template family, detected from the special tokens a model’s vocab carries. Instruct models must have their prompt wrapped in this template (with an assistant-turn cue) or they degenerate (emit EOS immediately, or repeat) — a raw prompt gives the model no “your turn to answer” signal.
- Pretoken
Error
Constants§
- ARCH_
DEEPSEEK_ MOE - ARCH_
FLAG_ HAS_ PLE - Feature flags on
GgufHyperparams::arch_flags. - ARCH_
FLAG_ HAS_ QK_ NORM - ARCH_
FLAG_ HAS_ SHARED_ KV - ARCH_
FLAG_ HAS_ SOFTCAP - ARCH_
FLAG_ HAS_ SWA - ARCH_
GEMMA - ARCH_
GEMM A2 - ARCH_
GEMM A3 - ARCH_
GEMM A4 - Gemma 4 (E2B/E4B/…): dual head-dim SWA+global, PLE, shared KV — not standard Llama-shape.
- ARCH_
GLM4 - ARCH_
LLAMA - ARCH_
OTHER - ARCH_
PHI4 - ARCH_
QWEN2 - ARCH_
UNKNOWN - Architecture id (stored in P64 hparams + used for support gating).
- DEFAULT_
ROPE_ FREQ_ BASE - Default RoPE base for Llama 3 / SmolLM2 when GGUF omits
llama.rope.freq_base. - MAX_
STOP_ TOKEN_ IDS - Max stop-token ids kept on the tokenizer (eos + chat-end family + extras).
Functions§
- parse_
architecture_ id - Map
general.architectureGGUF string → [ARCH_*]. - write_
blk_ tensor_ name - Write
blk.{layer}.{suffix}intoout; returns total bytes written.