manifest: {
id: "quantize";
jobs: readonly [
{ gpu: "exclusive"; isolation: "process"; kind: "quantize" },
];
panel: {
entry: "@mlx-bun/module-quantize/panel";
framed: false;
path: "/quantize";
tag: "mlx-quantize-panel";
title: "Quantize";
};
requires: readonly ["jobs", "storage", "catalog"];
routes: readonly [
{
id: "inspect";
method: "POST";
path: "/inspect";
response: "json";
summary: "Whether a model is quantizable and its on-disk size, from its configuration alone";
},
{
id: "resolve-folder";
method: "POST";
path: "/resolve-folder";
response: "json";
summary: "Locate a folder picked in the browser on disk (hub snapshot, the app's models directory, or an indexed model)";
},
{
id: "submit";
method: "POST";
path: "/submit";
response: "json";
summary: "Queue a quantize job into the app's models directory; answers with the job id and output directory";
},
];
storage: readonly [
{
key: "models";
kind: "directory";
path: "models";
purpose: "Quantized and converted models: plain model directories, indexed beside the hub cache";
},
];
summary: "Quantize or convert a local MLX checkpoint: the managed quantize job, its web routes, and the convert verb.";
title: "Quantize";
verbs: readonly [
{
name: "convert";
options: readonly [
{
name: "hf-path";
summary: "Source model: local path, downloaded model, or HF repo id (fetched first); --model and the positional are aliases";
type: "string";
},
{ name: "model"; summary: "Alias for --hf-path"; type: "string" },
{
name: "mlx-path";
summary: "Output directory; must not already exist [default: ~/.mlx-bun/models/<model>-<bits>bit]";
type: "string";
},
{
name: "quantize";
short: "q";
summary: "Quantize the model (uniform affine); without -q or --target-bpw the model is rewritten with --dtype and/or -d only";
type: "boolean";
},
{
name: "q-bits";
summary: "Bits per weight: 4 or 8 [default: 4]";
type: "string";
},
{
name: "q-group-size";
summary: "Quantization group size: 32 or 64 [default: 64]";
type: "string";
},
{
missingValue: "--upload-repo expects a repo id (org/name)";
name: "upload-repo";
summary: "Push the converted model to this Hugging Face repo afterwards (write token checked first)";
type: "string";
},
{
name: "target-bpw";
summary: "Mixed precision target bits-per-weight, e.g. 4.5: OptiQ sensitivity sweep + per-layer knapsack; implies -q";
type: "string";
},
{
name: "candidate-bits";
summary: "Comma list the knapsack may pick from [default: 4,8]";
type: "string";
},
{
name: "calibration-mix";
summary: "\"optiq\" or a JSONL path [default: optiq]";
type: "string";
},
{
name: "n-calibration";
summary: "Calibration samples [default: 2]";
type: "string";
},
{
name: "rotate-weights";
summary: "Fold the model's offline TurboQuant rotation before quantization (auto-detects Llama/Qwen3.5/Qwen MTP)";
type: "boolean";
},
{
name: "rotation-seed";
summary: "Deterministic rotation seed [default: 42]";
type: "string";
},
{
name: "q-mode";
summary: "Quantization mode: affine, or trellis for packed Trellis (TCQ) MLP tensors of an HF-layout Qwen3.5-family model (rotation fold implied; implies -q) [default: affine]";
type: "string";
},
{
name: "trellis-bits";
summary: "--q-mode trellis: bits per coded weight, 1-8 [default: 3]";
type: "string";
},
{
name: "trellis-k-map";
summary: "--q-mode trellis: allocation JSON with per-tensor bits (budgets[--trellis-k-budget].kmap, optional affine_map)";
type: "string";
},
{
name: "trellis-k-budget";
summary: "--q-mode trellis: budget key inside --trellis-k-map [default: 3.00]";
type: "string";
},
{
name: "trellis-ldlq";
summary: "--q-mode trellis: directory of per-layer Hessian factors (layer-NNN-mlp|down.safetensors) enabling BlockLDLQ error feedback";
type: "string";
},
{
name: "trellis-reuse";
summary: "--q-mode trellis: comma list of packed artifacts to copy unchanged-geometry tensors from instead of re-encoding";
type: "string";
},
{
name: "trellis-down-axis";
summary: "--q-mode trellis: dim of down_proj the trellis runs along, out (rotated dim) or in [default: out]";
type: "string";
},
{
name: "trellis-interleave";
summary: "--q-mode trellis: reorder eligible 3-bit axis-0 codes into the two-block scatter layout";
type: "boolean";
},
{
name: "trellis-layers";
summary: "--q-mode trellis: trellis-code only the first N decoder layers (the rest ride the 3-bit affine base tier)";
type: "string";
},
{
name: "dtype";
summary: "Dtype of the non-quantized tensors and of the quantization scales/biases: float16 | bfloat16 | float32 [default: bf16 scales/biases, other tensors unchanged]";
type: "string";
},
{
name: "dequantize";
short: "d";
summary: "Dequantize a quantized model to dense weights (not with -q)";
type: "boolean";
},
{
name: "quant-predicate";
summary: "Not supported (mlx-lm's mixed_* recipes need 2/3/6-bit); use --target-bpw for mixed precision";
type: "string";
},
];
positional: readonly [
{
name: "repo-or-path";
summary: "The source model: a local path, a downloaded model, or an HF repo id";
},
];
summary: "Quantize an HF model into a local MLX snapshot (mlx_lm.convert counterpart)";
},
];
} = ...
Type Declaration
-
Readonlyid: "quantize"
-
Readonlyjobs: readonly [{ gpu: "exclusive"; isolation: "process"; kind: "quantize" }]
-
Readonlypanel: {
entry: "@mlx-bun/module-quantize/panel";
framed: false;
path: "/quantize";
tag: "mlx-quantize-panel";
title: "Quantize";
}
-
Readonlyrequires: readonly ["jobs", "storage", "catalog"]
-
Readonlyroutes: readonly [
{
id: "inspect";
method: "POST";
path: "/inspect";
response: "json";
summary: "Whether a model is quantizable and its on-disk size, from its configuration alone";
},
{
id: "resolve-folder";
method: "POST";
path: "/resolve-folder";
response: "json";
summary: "Locate a folder picked in the browser on disk (hub snapshot, the app's models directory, or an indexed model)";
},
{
id: "submit";
method: "POST";
path: "/submit";
response: "json";
summary: "Queue a quantize job into the app's models directory; answers with the job id and output directory";
},
]
-
Readonlystorage: readonly [
{
key: "models";
kind: "directory";
path: "models";
purpose: "Quantized and converted models: plain model directories, indexed beside the hub cache";
},
]
-
Readonlysummary: "Quantize or convert a local MLX checkpoint: the managed quantize job, its web routes, and the convert verb."
-
Readonlytitle: "Quantize"
-
Readonlyverbs: readonly [
{
name: "convert";
options: readonly [
{
name: "hf-path";
summary: "Source model: local path, downloaded model, or HF repo id (fetched first); --model and the positional are aliases";
type: "string";
},
{ name: "model"; summary: "Alias for --hf-path"; type: "string" },
{
name: "mlx-path";
summary: "Output directory; must not already exist [default: ~/.mlx-bun/models/<model>-<bits>bit]";
type: "string";
},
{
name: "quantize";
short: "q";
summary: "Quantize the model (uniform affine); without -q or --target-bpw the model is rewritten with --dtype and/or -d only";
type: "boolean";
},
{
name: "q-bits";
summary: "Bits per weight: 4 or 8 [default: 4]";
type: "string";
},
{
name: "q-group-size";
summary: "Quantization group size: 32 or 64 [default: 64]";
type: "string";
},
{
missingValue: "--upload-repo expects a repo id (org/name)";
name: "upload-repo";
summary: "Push the converted model to this Hugging Face repo afterwards (write token checked first)";
type: "string";
},
{
name: "target-bpw";
summary: "Mixed precision target bits-per-weight, e.g. 4.5: OptiQ sensitivity sweep + per-layer knapsack; implies -q";
type: "string";
},
{
name: "candidate-bits";
summary: "Comma list the knapsack may pick from [default: 4,8]";
type: "string";
},
{
name: "calibration-mix";
summary: "\"optiq\" or a JSONL path [default: optiq]";
type: "string";
},
{
name: "n-calibration";
summary: "Calibration samples [default: 2]";
type: "string";
},
{
name: "rotate-weights";
summary: "Fold the model's offline TurboQuant rotation before quantization (auto-detects Llama/Qwen3.5/Qwen MTP)";
type: "boolean";
},
{
name: "rotation-seed";
summary: "Deterministic rotation seed [default: 42]";
type: "string";
},
{
name: "q-mode";
summary: "Quantization mode: affine, or trellis for packed Trellis (TCQ) MLP tensors of an HF-layout Qwen3.5-family model (rotation fold implied; implies -q) [default: affine]";
type: "string";
},
{
name: "trellis-bits";
summary: "--q-mode trellis: bits per coded weight, 1-8 [default: 3]";
type: "string";
},
{
name: "trellis-k-map";
summary: "--q-mode trellis: allocation JSON with per-tensor bits (budgets[--trellis-k-budget].kmap, optional affine_map)";
type: "string";
},
{
name: "trellis-k-budget";
summary: "--q-mode trellis: budget key inside --trellis-k-map [default: 3.00]";
type: "string";
},
{
name: "trellis-ldlq";
summary: "--q-mode trellis: directory of per-layer Hessian factors (layer-NNN-mlp|down.safetensors) enabling BlockLDLQ error feedback";
type: "string";
},
{
name: "trellis-reuse";
summary: "--q-mode trellis: comma list of packed artifacts to copy unchanged-geometry tensors from instead of re-encoding";
type: "string";
},
{
name: "trellis-down-axis";
summary: "--q-mode trellis: dim of down_proj the trellis runs along, out (rotated dim) or in [default: out]";
type: "string";
},
{
name: "trellis-interleave";
summary: "--q-mode trellis: reorder eligible 3-bit axis-0 codes into the two-block scatter layout";
type: "boolean";
},
{
name: "trellis-layers";
summary: "--q-mode trellis: trellis-code only the first N decoder layers (the rest ride the 3-bit affine base tier)";
type: "string";
},
{
name: "dtype";
summary: "Dtype of the non-quantized tensors and of the quantization scales/biases: float16 | bfloat16 | float32 [default: bf16 scales/biases, other tensors unchanged]";
type: "string";
},
{
name: "dequantize";
short: "d";
summary: "Dequantize a quantized model to dense weights (not with -q)";
type: "boolean";
},
{
name: "quant-predicate";
summary: "Not supported (mlx-lm's mixed_* recipes need 2/3/6-bit); use --target-bpw for mixed precision";
type: "string";
},
];
positional: readonly [
{
name: "repo-or-path";
summary: "The source model: a local path, a downloaded model, or an HF repo id";
},
];
summary: "Quantize an HF model into a local MLX snapshot (mlx_lm.convert counterpart)";
},
]