#[non_exhaustive]pub struct ModelDir {
pub path: PathBuf,
pub entry: Option<PathBuf>,
pub kind: ModelSourceKind,
pub quantization: Quantization,
}Expand description
Where a resolved model lives on disk.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.path: PathBufRoot directory of the model on disk.
entry: Option<PathBuf>Specific file inside path (e.g. ggml-large-v3.bin for
single-file HF requests). None for whole-repo directories
where the engine picks the right file from the directory
listing. Populated by voxora-hf for 3-segment model ids
(org/repo/file) starting in 0.1.2.
kind: ModelSourceKindWhich source provided this model.
quantization: QuantizationConcrete quantization this model was serialized in.
Implementations§
Source§impl ModelDir
impl ModelDir
Sourcepub fn new(
path: PathBuf,
kind: ModelSourceKind,
quantization: Quantization,
) -> Self
pub fn new( path: PathBuf, kind: ModelSourceKind, quantization: Quantization, ) -> Self
Build a ModelDir from its four fields, with entry left as
None. Whole-repo resolvers should keep using this constructor
so the engine falls back to locate_model_file-style
directory scanning.
Sourcepub fn with_entry(
path: PathBuf,
entry: PathBuf,
kind: ModelSourceKind,
quantization: Quantization,
) -> Self
pub fn with_entry( path: PathBuf, entry: PathBuf, kind: ModelSourceKind, quantization: Quantization, ) -> Self
Build a ModelDir with an explicit entry naming the specific
file inside path. Used by voxora-hf for 3-segment model ids
(org/repo/file) so the engine does not have to lex-sort a
multi-file directory and accidentally pick the wrong file.