import type { ServedBackend } from "./modelBackend.js"; import { type ModelKind } from "./modelKind.js"; /** MLX models live under `/mlx/--/`. */ export declare const MLX_SUBDIR = "mlx"; /** The folder under the models directory that each served backend * downloads into. Diffusers models live under * `/diffusers/--/`, with the same record. */ export declare const SUBDIR_FOR_BACKEND: Record; /** The per-model record: which revision the files came from and how much of * each file is on disk. Written by the downloader, read by `list`, `serve`, * and `remove`. */ export declare const RECORD_FILE = ".agency-model.json"; export type MlxFileRecord = { size: number; sha256?: string; complete: boolean; /** Indexes of the chunks already written, for a file still downloading. */ chunks?: number[]; }; export type MlxModelRecord = { repo: string; revision: string; files: Record; /** What the model takes and returns, written when the download finished. * Absent in records written before kinds existed, and for a directory * whose files matched no rule; readers infer it then. */ kind?: ModelKind; }; export declare function mlxModelDirName(repo: string): string; export declare function servedModelDir(cacheDir: string, backend: ServedBackend, repo: string): string; /** The record in `dir`, or null when it is missing or not a valid record. */ export declare function readMlxModelRecord(dir: string): MlxModelRecord | null; /** Replaces the file through a temp file and a rename, so a crash mid-write * leaves the previous record. */ export declare function writeMlxModelRecord(dir: string, record: MlxModelRecord): void; export declare function isMlxModelComplete(record: MlxModelRecord): boolean;