Skip to main content

Cache and downloads

The first KittenTTS.create() downloads the model, voices.npz, and CE phonemizer files. Native apps cache under the document directory; web uses Cache API when available and an in-memory fallback otherwise.

Inspect cache

const cached = await KittenTTS.isModelCached({model: KittenModel.NanoInt8});
const info = await KittenTTS.getModelCacheInfo({model: KittenModel.NanoInt8});

console.log(cached, info);

isModelDownloaded() is an app-facing alias for the cache check.

Predownload during onboarding

await KittenTTS.predownload(
{model: KittenModel.NanoInt8},
(progress, info) => updateDownloadUI(progress, info),
);

prewarm() remains as a deprecated alias; use predownload() in new code.

Repair model data

await KittenTTS.redownloadModel(
{model: KittenModel.NanoInt8},
setProgress,
);

Downloads use temporary .download files. Interrupted data is not considered a valid cached model.

Clear one model

await KittenTTS.clearModelCache({model: KittenModel.NanoInt8});

Avoid clearing cache on routine app startup. It forces large downloads and can break offline launches.