Skip to main content

cherenkov/model/
format.rs

1use serde::{Deserialize, Serialize};
2
3/// Container layout and the conventions used to interpret tensor names and encodings.
4#[derive(Debug, Clone, Serialize, Deserialize)]
5pub struct CheckpointFormat {
6    /// Physical container format.
7    pub container: ContainerFormat,
8    /// Naming and quantization conventions recognized by an adapter.
9    pub conventions: CheckpointConventions,
10}
11
12/// On-disk container family, including Cherenkov's prepared format.
13#[derive(Debug, Clone, Serialize, Deserialize)]
14#[serde(tag = "kind", rename_all = "snake_case")]
15pub enum ContainerFormat {
16    Safetensors,
17    Gguf { version: u32 },
18    CherenkovPacked { version: u32 },
19    Opaque { name: String },
20}
21
22/// Recognized naming and encoding conventions within a container.
23#[derive(Debug, Clone, Serialize, Deserialize)]
24#[serde(tag = "kind", rename_all = "snake_case")]
25pub enum CheckpointConventions {
26    Qwen4ExpHuggingFace,
27    Qwen4ExpMlx,
28    MlxAffine,
29    Qwen4ExpCherenkov,
30    Gguf,
31    Opaque { name: String },
32}