-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Raul Cardenas Montoya edited this page Sep 19, 2026
·
5 revisions

Pure-Rust, zero-dependency GGUF deserializer and MoE per-expert weight extractor.
Version: 0.2.0 | Edition: 2024 | MSRV: 1.97.1 | License: MIT OR Apache-2.0
An engram is a physical trace of memory. This crate rips frozen weights (memories) out of MoE GGUF checkpoints so live systems can consume raw byte buffers with shape/dtype metadata — no neural-network math.
Default builds are GGUF-only and zero-dependency (fs::read into Vec<u8>).
Two optional cargo features extend it:
-
safetensors(off by default): in-crate Safetensors header / manifest / MoE-discovery support — no separate crate, no extra crates -
mmap(off by default):load_gguf_mmapviamemmap2instead of reading the whole file
- Parse GGUF v3 (magic, header, KV metadata, tensor directory) →
GgufLayout - Enumerate MoE experts:
list_experts - Extract one expert's
gate/up/downraw bytes:extract_expert - Support stacked (
ffn_*_exps.weight) and per-expert (ffn_*.E.weight) layouts - Packed dequant to
f32for Q8_0, Q5_K, Q6_K, IQ3_M block layout (dequantize_packedand friends) - Safetensors checkpoint inspection behind the
safetensorsfeature:inspect_safetensors_checkpoint→ deterministicSafetensorsManifest
- No matmul, forward, routing, softmax
- No CUDA / GPU / SIMD
-
Zero crate dependencies on the default path (
[dependencies]is empty; only optionalmemmap2under--features mmap) - No tokenization or SNN dynamics
- No full model-family routing policy (see cortex-tensor)
- No Safetensors payload mmap/tensor extraction or Hugging Face
config.jsonpolicy — thesafetensorsfeature is header/manifest/discovery only
| Page | Description |
|---|---|
| Getting Started | Install, load, extract |
| Project Structure | Modules and tree |
| Architecture | Ownership and non-goals |
| GGUF Parsing |
load_gguf, layout, cursor, dequant |
| Tensor and DType | Directory entries and types |
| MoE Extraction | stacked vs per-expert |
| Safetensors | Feature-gated safetensors support (reverses #10) |
| Errors | ParserError |
| Public API | Crate surface |
| Overview | Wiki map |
| Testing | Smoke + pilot tests |
| CI and Quality | GHA, security, Docker |
| MSRV | 1.97.1 policy |
| Ecosystem | cortex-tensor, corinth-canal |
| Glossary | Terms |
cargo fmt --check
cargo clippy --all-targets --all-features -- -D warnings
cargo build --all-features
cargo test --all-featuresDual-licensed under MIT or Apache-2.0 at your option.
Last updated: September 16, 2026
Updated by: KAI
Package tip reference: 3dea2c3 (main)