MLX memory
Serving Qwen3 8B, Quail's MLX engine grew to 30 GB and never gave it back, where oMLX peaked at 9 GB.
Why
MLX keeps the GPU memory a finished calculation frees, so it can hand it out again without asking macOS. Quail never limited that cache. MLX's default lets it grow to nearly all of the Mac's memory, and Quail emptied it only when it unloaded a model.
What changed
- The cache is capped at a sixteenth of the memory the GPU is recommended to use, between 512 MB and 2 GB.
- It's emptied every 512 decoding steps, and eight steps after each request finishes.
- Not at once: it waits those eight steps because oMLX found that emptying it the moment a request finished could make macOS panic.
Result
Qwen3 8B's peak fell from 32.5 GB to 10.4 GB on 4,096-token prompts, and from 28.2 GB to 12.5 GB with 8 requests at once, with no loss of speed. Quail's MLX engine now peaks below Rapid-MLX's on every model measured. (#137, #143)