Skip to main content

engram_parser/analysis/moe/
mod.rs

1// SPDX-License-Identifier: MIT OR Apache-2.0
2
3//! Mixture-of-Experts weight extraction (GGUF-specific).
4//!
5//! Locates MoE expert tensors inside a parsed [`GgufLayout`](crate::gguf::GgufLayout)
6//! and returns raw per-expert byte buffers. Performs no neural-network
7//! math — callers receive `Vec<u8>` + shape/dtype metadata and are
8//! responsible for any downstream compute.
9//!
10//! # Scope
11//!
12//! This is a model-analysis specialization, not part of the core
13//! checkpoint contract: [`extract_expert`] and [`list_experts`] take a
14//! concrete `&GgufLayout`, and [`RawTensor`] carries the GGUF-specific
15//! [`DType`](crate::gguf::DType) / `ggml_type` fields of its source
16//! tensor. It does not accept [`Checkpoint`](crate::checkpoint::Checkpoint)
17//! — a format-independent MoE/topology layer is planned v0.4 work.
18//!
19//! Safetensors has its own candidate-discovery surface (the
20//! feature-gated `safetensors` module); the two paths are not yet one
21//! generic MoE API.
22//!
23//! # Compatibility
24//!
25//! This is the canonical MoE namespace as of v0.3. The legacy
26//! [`crate::moe`] module and the crate-root re-exports
27//! ([`crate::extract_expert`], [`crate::list_experts`],
28//! [`crate::MoeExpertWeights`], [`crate::RawTensor`]) re-export this
29//! same implementation and continue to compile.
30
31mod expert;
32mod extract;
33
34pub use expert::{MoeExpertWeights, RawTensor};
35pub use extract::{extract_expert, list_experts};