Skip to content

Architecture

Raul Montoya Cardenas edited this page Jul 29, 2026 · 2 revisions

Architecture

Role

.gguf file
    │ load_gguf / parse_bytes
    ▼
GgufLayout { metadata, tensors, bytes }
    │ list_experts
    ▼
(block, expert)* 
    │ extract_expert
    ▼
MoeExpertWeights { gate?, up?, down? as RawTensor }
    │
    ▼  (downstream: dequant, routing, SNN — not this crate)
cortex-tensor / hybrid-fusion / neuromod

Owns

Area Detail
GGUF v3 deserialize Magic, version, KV, tensor directory
Expert enumeration list_experts
Per-expert raw extract gate/up/down with shape + dtype
Layout-aware dtypes F32/F16/BF16 + opaque quants as raw bytes

Does not own

Area Owner / note
Matmul / routing / softmax cortex-tensor etc.
Dequant (default path) cortex-tensor dequant
Model-family adapters cortex-tensor
Safetensors separate crate plan (#10); GGUF-only charter here
GPU / SIMD never

Design principles

  • Zero dependencies — no thiserror, serde, memmap2
  • Full file read into Vec<u8> (no mmap) for portability
  • Malformed-input guards: max tensor/KV counts, max dims, EOF checks
  • Extraction returns owned Vec<u8> so results outlive parsing choices

Related


Last updated: July 29, 2026 Updated by: Grok Build: Grok 4.5 Package tip reference: 07a5558 (main)

Clone this wiki locally