pub enum ModelFormat {
Show 23 variants
Safetensors,
GGUF,
PyTorch,
TensorRT,
ONNX,
MLX,
CoreML,
TorchScript,
TFLite,
TensorFlow,
Keras,
OpenVINO,
TVM,
NCNN,
MNN,
RKNN,
Caffe,
MXNet,
Darknet,
HDF5,
Pickle,
NumPy,
Custom(String),
}Expand description
Supported AI model formats
Variants§
Safetensors
Safetensors (.safetensors) - HuggingFace default for Transformers
GGUF
GGUF (.gguf) - Quantized LLM format (llama.cpp, LM Studio, Ollama)
PyTorch
PyTorch weights (.pt, .pth, .bin) - Classic state_dict files
TensorRT
TensorRT Engine (.plan) - NVIDIA compiled engines
ONNX
ONNX (.onnx) - Interchange/serving format
MLX
MLX (.npz) - Apple Silicon optimized format
CoreML
Core ML (.mlmodel) - iOS/macOS on-device inference
TorchScript
TorchScript (.pt traced/scripted) - PyTorch serialization
TFLite
TensorFlow Lite (.tflite) - Mobile/edge deployment
TensorFlow
TensorFlow SavedModel - TensorFlow serving format
Keras
Keras (.h5, .keras) - Keras model format
OpenVINO
OpenVINO IR (.xml + .bin) - Intel optimization format
TVM
TVM compiled artifacts
NCNN
NCNN (.param + .bin) - Mobile-optimized format
MNN
MNN (.mnn) - Mobile Neural Network format
RKNN
RKNN (.rknn) - Rockchip NPU format
Caffe
Caffe (.caffemodel) - Legacy Caffe format
MXNet
MXNet (.params) - Apache MXNet format
Darknet
Darknet (.weights) - YOLO/Darknet format
HDF5
HDF5 (.h5, .hdf5) - Hierarchical data format
Pickle
Pickle (.pkl) - Python pickle format
NumPy
NumPy (.npy, .npz) - NumPy array format
Custom(String)
Custom/Unknown format
Implementations§
Source§impl ModelFormat
impl ModelFormat
Sourcepub fn from_extension(ext: &str) -> Self
pub fn from_extension(ext: &str) -> Self
Detect format from file extension
Sourcepub fn from_name(name: &str) -> Option<Self>
pub fn from_name(name: &str) -> Option<Self>
Parse a format from its display name, case- and
space-insensitively ("Core ML", "coreml", "CORE ML" all match).
Sourcepub fn from_stored(value: &str) -> Self
pub fn from_stored(value: &str) -> Self
Parse a format string that may be either a display name or a file extension.
Version records persist format.name() (e.g. "PyTorch"), which
from_extension does not recognise — it would
silently yield Custom("pytorch") and break conversion-path lookup and
tensor-level diffing. Use this whenever the input came from storage.
Sourcepub fn telemetry_name(&self) -> &'static str
pub fn telemetry_name(&self) -> &'static str
Format label safe to report in telemetry.
name returns the caller’s own string for
ModelFormat::Custom, which is free-form user input — a model name,
a path fragment, anything they typed. Reporting it would break the
guarantee that telemetry carries no user-supplied text, so this
collapses every Custom to the literal "custom" and is otherwise a
fixed set of &'static str.
Trait Implementations§
Source§impl Clone for ModelFormat
impl Clone for ModelFormat
Source§impl Debug for ModelFormat
impl Debug for ModelFormat
Source§impl<'de> Deserialize<'de> for ModelFormat
impl<'de> Deserialize<'de> for ModelFormat
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>,
Source§impl Display for ModelFormat
impl Display for ModelFormat
impl Eq for ModelFormat
Source§impl Hash for ModelFormat
impl Hash for ModelFormat
Source§impl PartialEq for ModelFormat
impl PartialEq for ModelFormat
Source§impl Serialize for ModelFormat
impl Serialize for ModelFormat
impl StructuralPartialEq for ModelFormat
Auto Trait Implementations§
impl Freeze for ModelFormat
impl RefUnwindSafe for ModelFormat
impl Send for ModelFormat
impl Sync for ModelFormat
impl Unpin for ModelFormat
impl UnsafeUnpin for ModelFormat
impl UnwindSafe for ModelFormat
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<D> DeserializeWith<JsonFormat> for Dwhere
D: DeserializeOwned,
impl<D> DeserializeWith<JsonFormat> for Dwhere
D: DeserializeOwned,
Source§fn deserialize_with(body: ResponseBody) -> Result<D, Error>
fn deserialize_with(body: ResponseBody) -> Result<D, Error>
Source§impl<D> DeserializeWith<XmlFormat> for Dwhere
D: DeserializeOwned,
impl<D> DeserializeWith<XmlFormat> for Dwhere
D: DeserializeOwned,
Source§fn deserialize_with(body: ResponseBody) -> Result<D, Error>
fn deserialize_with(body: ResponseBody) -> Result<D, Error>
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request