Skip to content
AIBRAINWORX / OpenSourceCoder.comLOCAL-FIRST. BUILT IN THE OPEN.
Open Source

Ollama 0.40.19 trims the storage retained by Engram history tails

A targeted MLX cache change prevents a small retained history slice from keeping an entire input chunk alive. It is not a general promise of smaller model weights.

Listen to this articleBrowser Voice
Ready
Original explanatory diagram of a history view retaining a backing allocation versus a compact tail; schematic sizes, not a measured memory chart.
Original explanatory diagram of a history view retaining a backing allocation versus a compact tail; schematic sizes, not a measured memory chart. · Official project mark retained for editorial identification without implied endorsement.
Event / context: 2026-11-26. Source check: Nov 28, 2026.

Ollama 0.40.19, published November 26, includes a targeted correction to how an MLX Engram cache retains its recent history. The change addresses the backing storage held by a slice, rather than reducing a model's parameter count or increasing its supported context length.

A small view can retain a large allocation

The included Engram-buffer change modifies the helper that combines prior history with new values and keeps the needed tail. A slice can describe only that tail while still retaining the larger allocation from which it came.

In the tagged implementation, the returned slice is made contiguous so the tail does not keep the full chunk's backing storage. The relevant code belongs to the experimental Qwen MLX model path. It should not be described as a fix applied identically to every model architecture or backend that Ollama supports.

The associated tests inspect live state, direct snapshots and scheduled snapshots across float32 and bfloat16 cases. They also exercise restoring an earlier boundary and continuing from it. Those are upstream test cases we read, not tests we executed or memory figures we measured on a Mac.

Separate cache retention from decoding speed

The same release includes an Inkling optimization for short attention histories, draft proposals and convolution snapshots. Its description says histories below 1,024 keys use Metal split-attention kernels already used for longer histories, avoiding a wider intermediate history and a dense mask in that path.

That is a different change with a different scope. Its authors report prompt-specific throughput improvements; this article does not turn those measurements into a speed claim for every computer. The pull request explicitly says other backends are unchanged. Draft-proposal handling and the request's verification/sampling settings also remain distinct.

Our analysis

The Engram change illustrates why logical cache size and actual retained memory are different measurements. Reporting only the number of history elements can miss a larger allocation kept alive by a view. Conversely, fixing that retention does not make weight memory, runtime overhead and all other caches disappear.

For developers evaluating a runtime update, the useful question is whether their model uses the changed path and whether retained storage behaves as expected across long chunks, snapshots and restores. A point release alone is not evidence that a particular workload now fits a smaller device.

Our existing Ollama repository profile links the MIT-licensed runtime. Model weights keep their own licenses. We reviewed the release, tagged cache source and included pull requests without installing Ollama, changing our shared VPS inference service, loading a model or running the upstream tests.

EXPLORE THE SOURCE

GitHub repositories

Original primary-source review. No model weights/data downloaded, speech or upstream tests executed, software installed, server changed or benchmark independently reproduced.

Follow your curiosity.

Pass the signal.