manifest: {
id: "models";
panel: {
developer: false;
entry: "@mlx-bun/module-models/panel";
path: "/models";
tag: "mlx-models-panel";
title: "Models";
};
placement: "app";
requires: readonly ["catalog", "modelHost", "storage", "events"];
routes: readonly [
{
id: "library";
method: "GET";
mount: "root";
path: "/library";
response: "json";
summary: "Every local model with its fit on this machine, which one is served and which are loaded (`refresh=1` re-reads the index)";
},
{
id: "downloads";
method: "GET";
mount: "root";
path: "/downloads";
response: "json";
summary: "Model downloads in progress and the recent finished ones";
},
{
id: "hub-local";
method: "GET";
mount: "root";
path: "/api/hub/local";
response: "json";
summary: "Downloaded models with their fit verdicts, after re-indexing the Hub cache";
},
{
id: "hub-search";
method: "GET";
mount: "root";
path: "/api/hub/search";
response: "json";
summary: "Search Hugging Face for MLX models (`q`); offline is an answer, not an error";
},
{
id: "hub-serve";
method: "POST";
mount: "root";
path: "/api/hub/serve";
response: "json";
summary: "Make a local model the served one (`model`): loaded beside the resident ones when it fits, else in place of the least recently used; a host that serves one model answers with the restart command";
},
{
id: "hub-download";
method: "POST";
mount: "root";
path: "/api/hub/download";
response: "json";
summary: "Start a download that outlives the request (`repo`, `org/name`); a repo already downloading answers 409";
},
{
id: "resolve-folder";
method: "POST";
mount: "root";
path: "/api/model/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: "gc-plan";
method: "GET";
mount: "root";
path: "/api/gc/plan";
response: "json";
summary: "What cleaning the Hub cache would reclaim: superseded snapshots and dead blobs per repo";
},
{
id: "gc-execute";
method: "POST";
mount: "root";
path: "/api/gc/execute";
response: "json";
summary: "Delete what the plan lists (`{ \"yes\": true }`), refusing to prune a snapshot a resident model reads, then re-index";
},
{
id: "adapters-available";
method: "GET";
mount: "root";
path: "/v1/adapters/available";
response: "json";
summary: "Every adapter found on disk with whether it is mounted and whether it fits the served model";
},
{
id: "adapters";
method: "GET";
mount: "root";
path: "/v1/adapters";
response: "json";
summary: "The adapters mounted on the served model, with their size and memory";
},
{
id: "adapter-mount";
method: "POST";
mount: "root";
path: "/v1/adapters";
response: "json";
summary: "Mount an adapter directory on the served model (`id`, `path`) under its execution lease";
},
{
id: "adapter-unmount";
method: "DELETE";
mount: "root";
path: "/v1/adapters/:id";
response: "json";
summary: "Unmount an adapter from the served model";
},
{
id: "adapter-merge";
method: "POST";
mount: "root";
path: "/api/finetune/merge";
response: "json";
summary: "Merge two adapters (`adapter_a`, `adapter_b`, optional `scales`) into a new adapter in the adapters directory, on the served model's execution lease";
},
{
id: "adapter-export";
method: "POST";
mount: "root";
path: "/api/finetune/export";
response: "json";
summary: "Write an export manifest for an adapter (`base_model`, `adapter_path`, optional `method`) into the exports directory";
},
];
storage: readonly [
{
key: "adapters";
kind: "directory";
path: "adapters";
purpose: "Fine-tuned and merged adapters: one directory per run, with checkpoints and metrics";
},
{
key: "exports";
kind: "directory";
path: "exports";
purpose: "Adapter export manifests";
},
];
summary: "Model management over the catalog and the model host: the library and hub (search, download, switch the served model, cache cleanup), adapter mounting, merge and export, and the ls, get, scan, fit, gc and upload verbs.";
title: "Models";
verbs: readonly [
{
name: "get";
options: readonly [
{
name: "revision";
summary: "Git revision [default: main]";
type: "string";
},
];
positional: readonly [
{
name: "org/repo | substring";
required: true;
summary: "The repo to download, or a substring of a downloaded repo to refresh";
},
];
summary: "Download a model from Hugging Face (resumable, verified)";
},
{
name: "ls";
options: readonly [
{
name: "vision";
summary: "Only vision-capable models";
type: "boolean";
},
{
name: "max-size";
summary: "Filter by weight size, e.g. 10GB or 800MB";
type: "string";
},
{
name: "all-revisions";
summary: "Show each snapshot; canonical revision marked *";
type: "boolean";
},
];
positional: readonly [
{ name: "query"; summary: "Only models whose id contains this" },
];
summary: "List downloaded models (one canonical revision per repo)";
},
{
name: "scan";
options: readonly [];
positional: readonly [];
summary: "Re-index the Hugging Face cache without reading tensor bytes";
},
{
name: "fit";
options: readonly [
{
name: "ctx";
summary: "Context tokens [default: 8192; a memory-planning runtime defaults to its own preset]";
type: "string";
},
{
name: "kv-quant";
summary: "KV estimate: 4 | 8 | config | off [default: off]";
type: "string";
},
{
name: "skus";
summary: "Print the Apple Silicon SKU matrix";
type: "boolean";
},
];
positional: readonly [
{ name: "query"; required: true; summary: "A downloaded model" },
];
summary: "Estimate model memory and decode speed on this machine";
},
{
name: "gc";
options: readonly [
{
name: "yes";
summary: "Actually delete the planned snapshots and blobs";
type: "boolean";
},
{
name: "dry-run";
summary: "Never delete, even with --yes";
type: "boolean";
},
{
name: "force";
summary: "Also prune superseded snapshots with otherwise unique files";
type: "boolean";
},
];
positional: readonly [];
summary: "Reclaim superseded snapshots and dead blobs (preview by default)";
},
{
name: "upload";
options: readonly [
{
name: "path";
summary: "Local model directory to upload (required)";
type: "string";
},
{
name: "upload-repo";
summary: "Hub repo id, org/name or bare name (required)";
type: "string";
},
{
name: "private";
summary: "Create the repo as private (mlx-bun extension)";
type: "boolean";
},
];
positional: readonly [];
summary: "Push a local model directory to the Hugging Face Hub (mlx_lm.upload counterpart)";
usage: "usage: mlx-bun upload --path <model-dir> --upload-repo <org/repo> [--private]";
},
];
} = ...
Type Declaration
-
Readonlyid: "models"
-
Readonlypanel: {
developer: false;
entry: "@mlx-bun/module-models/panel";
path: "/models";
tag: "mlx-models-panel";
title: "Models";
}
-
Readonlyplacement: "app"
-
Readonlyrequires: readonly ["catalog", "modelHost", "storage", "events"]
-
Readonlyroutes: readonly [
{
id: "library";
method: "GET";
mount: "root";
path: "/library";
response: "json";
summary: "Every local model with its fit on this machine, which one is served and which are loaded (`refresh=1` re-reads the index)";
},
{
id: "downloads";
method: "GET";
mount: "root";
path: "/downloads";
response: "json";
summary: "Model downloads in progress and the recent finished ones";
},
{
id: "hub-local";
method: "GET";
mount: "root";
path: "/api/hub/local";
response: "json";
summary: "Downloaded models with their fit verdicts, after re-indexing the Hub cache";
},
{
id: "hub-search";
method: "GET";
mount: "root";
path: "/api/hub/search";
response: "json";
summary: "Search Hugging Face for MLX models (`q`); offline is an answer, not an error";
},
{
id: "hub-serve";
method: "POST";
mount: "root";
path: "/api/hub/serve";
response: "json";
summary: "Make a local model the served one (`model`): loaded beside the resident ones when it fits, else in place of the least recently used; a host that serves one model answers with the restart command";
},
{
id: "hub-download";
method: "POST";
mount: "root";
path: "/api/hub/download";
response: "json";
summary: "Start a download that outlives the request (`repo`, `org/name`); a repo already downloading answers 409";
},
{
id: "resolve-folder";
method: "POST";
mount: "root";
path: "/api/model/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: "gc-plan";
method: "GET";
mount: "root";
path: "/api/gc/plan";
response: "json";
summary: "What cleaning the Hub cache would reclaim: superseded snapshots and dead blobs per repo";
},
{
id: "gc-execute";
method: "POST";
mount: "root";
path: "/api/gc/execute";
response: "json";
summary: "Delete what the plan lists (`{ \"yes\": true }`), refusing to prune a snapshot a resident model reads, then re-index";
},
{
id: "adapters-available";
method: "GET";
mount: "root";
path: "/v1/adapters/available";
response: "json";
summary: "Every adapter found on disk with whether it is mounted and whether it fits the served model";
},
{
id: "adapters";
method: "GET";
mount: "root";
path: "/v1/adapters";
response: "json";
summary: "The adapters mounted on the served model, with their size and memory";
},
{
id: "adapter-mount";
method: "POST";
mount: "root";
path: "/v1/adapters";
response: "json";
summary: "Mount an adapter directory on the served model (`id`, `path`) under its execution lease";
},
{
id: "adapter-unmount";
method: "DELETE";
mount: "root";
path: "/v1/adapters/:id";
response: "json";
summary: "Unmount an adapter from the served model";
},
{
id: "adapter-merge";
method: "POST";
mount: "root";
path: "/api/finetune/merge";
response: "json";
summary: "Merge two adapters (`adapter_a`, `adapter_b`, optional `scales`) into a new adapter in the adapters directory, on the served model's execution lease";
},
{
id: "adapter-export";
method: "POST";
mount: "root";
path: "/api/finetune/export";
response: "json";
summary: "Write an export manifest for an adapter (`base_model`, `adapter_path`, optional `method`) into the exports directory";
},
]
-
Readonlystorage: readonly [
{
key: "adapters";
kind: "directory";
path: "adapters";
purpose: "Fine-tuned and merged adapters: one directory per run, with checkpoints and metrics";
},
{
key: "exports";
kind: "directory";
path: "exports";
purpose: "Adapter export manifests";
},
]
-
Readonlysummary: "Model management over the catalog and the model host: the library and hub (search, download, switch the served model, cache cleanup), adapter mounting, merge and export, and the ls, get, scan, fit, gc and upload verbs."
-
Readonlytitle: "Models"
-
Readonlyverbs: readonly [
{
name: "get";
options: readonly [
{
name: "revision";
summary: "Git revision [default: main]";
type: "string";
},
];
positional: readonly [
{
name: "org/repo | substring";
required: true;
summary: "The repo to download, or a substring of a downloaded repo to refresh";
},
];
summary: "Download a model from Hugging Face (resumable, verified)";
},
{
name: "ls";
options: readonly [
{
name: "vision";
summary: "Only vision-capable models";
type: "boolean";
},
{
name: "max-size";
summary: "Filter by weight size, e.g. 10GB or 800MB";
type: "string";
},
{
name: "all-revisions";
summary: "Show each snapshot; canonical revision marked *";
type: "boolean";
},
];
positional: readonly [
{ name: "query"; summary: "Only models whose id contains this" },
];
summary: "List downloaded models (one canonical revision per repo)";
},
{
name: "scan";
options: readonly [];
positional: readonly [];
summary: "Re-index the Hugging Face cache without reading tensor bytes";
},
{
name: "fit";
options: readonly [
{
name: "ctx";
summary: "Context tokens [default: 8192; a memory-planning runtime defaults to its own preset]";
type: "string";
},
{
name: "kv-quant";
summary: "KV estimate: 4 | 8 | config | off [default: off]";
type: "string";
},
{
name: "skus";
summary: "Print the Apple Silicon SKU matrix";
type: "boolean";
},
];
positional: readonly [
{ name: "query"; required: true; summary: "A downloaded model" },
];
summary: "Estimate model memory and decode speed on this machine";
},
{
name: "gc";
options: readonly [
{
name: "yes";
summary: "Actually delete the planned snapshots and blobs";
type: "boolean";
},
{
name: "dry-run";
summary: "Never delete, even with --yes";
type: "boolean";
},
{
name: "force";
summary: "Also prune superseded snapshots with otherwise unique files";
type: "boolean";
},
];
positional: readonly [];
summary: "Reclaim superseded snapshots and dead blobs (preview by default)";
},
{
name: "upload";
options: readonly [
{
name: "path";
summary: "Local model directory to upload (required)";
type: "string";
},
{
name: "upload-repo";
summary: "Hub repo id, org/name or bare name (required)";
type: "string";
},
{
name: "private";
summary: "Create the repo as private (mlx-bun extension)";
type: "boolean";
},
];
positional: readonly [];
summary: "Push a local model directory to the Hugging Face Hub (mlx_lm.upload counterpart)";
usage: "usage: mlx-bun upload --path <model-dir> --upload-repo <org/repo> [--private]";
},
]