PeakRamEstimate

data class PeakRamEstimate(val weightsBytes: Long, val kvCacheBytes: Long, val computeBytes: Long, val overheadBytes: Long)(source)

Pre-load estimate of the peak memory an engine needs for a model, computed from the header only.

All values are estimates for planning (refusing a load on a device that is too small, choosing a context size); the real numbers depend on the backend, its buffer alignment, and runtime options.

Constructors

Link copied to clipboard
constructor(weightsBytes: Long, kvCacheBytes: Long, computeBytes: Long, overheadBytes: Long)

Properties

Link copied to clipboard

scratch / compute graph buffers (heuristic).

Link copied to clipboard

key/value cache (self-attention, plus cross-attention for Whisper).

Link copied to clipboard

fixed context, tokenizer and allocator overhead (heuristic).

Link copied to clipboard

Sum of all components.

Link copied to clipboard

tensor data. With useMmap these pages are file-backed and can be reclaimed by the OS, but they still count toward the resident footprint while the model is used.