pub struct ExpertIndex {
pub version: u32,
pub num_moe_layers: u32,
pub num_experts: u32,
pub inter: u64,
pub hidden: u64,
pub group_size: u64,
pub sub_align: u64,
pub fs_block_size: u64,
pub record_stride: u64,
pub record_raw_bytes: u64,
pub file_template: String,
pub moe_layer_to_model_layer: Vec<u32>,
}Expand description
2026-09-25: The store manifest, manifest.json beside the per-layer
files: the geometry a reader needs to rebuild the spec and layout and open
the files.
Fields§
§version: u322026-09-25: Must equal ExpertRecordHeader::VERSION for a reader to
accept the store.
num_moe_layers: u32§num_experts: u32§inter: u64§group_size: u64§sub_align: u64§fs_block_size: u64§record_stride: u64§record_raw_bytes: u64§file_template: String2026-09-25: Set to FILE_TEMPLATE by new; file_name does not read
it.
moe_layer_to_model_layer: Vec<u32>2026-09-25: Dense MoE-layer index → model layer index; new sets
num_moe_layers to its length.
Implementations§
Source§impl ExpertIndex
impl ExpertIndex
pub const FILE_TEMPLATE: &'static str = "experts_{:05}.xpr"
pub const MANIFEST_NAME: &'static str = "manifest.json"
pub fn new( inter: u64, hidden: u64, group_size: u64, sub_align: u64, fs_block_size: u64, moe_layer_to_model_layer: Vec<u32>, num_experts: u32, ) -> Self
Sourcepub fn load(dir: &Path) -> Result<Self>
pub fn load(dir: &Path) -> Result<Self>
2026-09-25: Read and version-check manifest.json from dir, without
opening the layer files.
pub fn spec(&self) -> ExpertRecordSpec
pub fn layout(&self) -> ExpertLayout
Sourcepub fn file_name(&self, moe_layer: u32) -> String
pub fn file_name(&self, moe_layer: u32) -> String
2026-09-25: experts_{moe_layer:05}.xpr, whatever file_template holds.
Sourcepub fn total_bytes(&self) -> u64
pub fn total_bytes(&self) -> u64
2026-09-25: Bytes of all layer files together.
Trait Implementations§
Source§impl Clone for ExpertIndex
impl Clone for ExpertIndex
Source§fn clone(&self) -> ExpertIndex
fn clone(&self) -> ExpertIndex
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ExpertIndex
impl Debug for ExpertIndex
Source§impl<'de> Deserialize<'de> for ExpertIndex
impl<'de> Deserialize<'de> for ExpertIndex
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for ExpertIndex
impl PartialEq for ExpertIndex
Source§impl Serialize for ExpertIndex
impl Serialize for ExpertIndex
impl StructuralPartialEq for ExpertIndex
Auto Trait Implementations§
impl Freeze for ExpertIndex
impl RefUnwindSafe for ExpertIndex
impl Send for ExpertIndex
impl Sync for ExpertIndex
impl Unpin for ExpertIndex
impl UnwindSafe for ExpertIndex
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more