Skip to main content

Module common

Module common 

Source
Expand description

Helpers shared by more than one model’s CLI module.

Enums§

DtypeArg
Shared --dtype flag. BF16 is deliberately absent: the in-workspace GGUF reader used by every model’s own infer loader handles F32/F16/Q8_0, so a bf16 file would fail to load back through the same model’s infer command. The format-agnostic zsfm convert path supports BF16 for other consumers.

Functions§

delete_cached_model
Delete a model’s cached files (canonical GGUF + config) and optionally an output GGUF. Thin wrapper over zsfm_hub::delete_cached_model so all CLI modules share one import path (crate::common).
inspect_tensors
Shared inspect-tensors implementation: print every tensor’s name, shape, and dtype from a local checkpoint file. Format is auto-detected — works whether the model’s raw download is safetensors (most models), a raw PyTorch pickle .ckpt (lag_llama, tirex), or a GGUF file, via the same format-agnostic loader zsfm convert/zsfm inspect use.
median_index
Index of the median (q0.5) quantile level, with center fallback.
try_recast_from_cache
Return the canonical cache path, recasting from cache when present.