Skip to content
Raul Cardenas Montoya edited this page Sep 17, 2026 · 3 revisions

Errors

Wiki hero

Hand-rolled in src/error.rs — no thiserror / anyhow.

pub enum ParserError {
    Io { path, source },
    UnsupportedFormat { path, reason },
    MissingTensor { name, path },
    InvalidLayout { path, reason },
    ExpertOutOfRange { block, expert, available },
    DuplicateTensorOwnership { name, shards, path },
    MissingShard { shard, path },
}
pub type Result<T> = std::result::Result<T, ParserError>;
Variant When
Io File read failure
UnsupportedFormat Bad magic, wrong version, unknown value types, sanity limits
MissingTensor Lookup / no projections for expert
InvalidLayout EOF overrun, stride not divisible, rank errors
ExpertOutOfRange Expert index ≥ stacked expert count
DuplicateTensorOwnership Safetensors: one tensor maps to multiple / conflicting shards
MissingShard Safetensors: index references a shard that does not exist

Implements Display + std::error::Error (source only for Io).


Last updated: September 16, 2026 Updated by: KAI Package tip reference: 3dea2c3 (main)

Clone this wiki locally