mlx-bun library API
    Preparing search index...
    Index
    • Dispose + evict one cached tensor so its materialized bytes are freed mid-walk. Streaming whole-model transforms (fold/quantize at 27B scale) MUST release each source tensor after its consumer evaluates, or the cache accumulates the entire model in RAM. Safe to call for names never accessed; the next tensor(name) call re-opens it from the map.

      Parameters

      • name: string

      Returns void

    • Free one shard's native map AND every cached tensor from it, releasing all bytes materialized while consuming that shard. The shard transparently re-opens on the next tensor() touching it (header parse only — lazy). Required by streaming whole-model transforms at 27B scale: the native map retains every evaluated source array, so per-tensor dispose alone frees nothing — the whole model accumulates in RAM (2026-08-18 fold OOM).

      Parameters

      • file: string

      Returns void