v0.4 — ModelPool (multi-model + LRU + pin)#27
Merged
magicnight merged 6 commits intomainfrom Apr 24, 2026
Merged
Conversation
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…lPool Single active model is still the UX default — currentModelID is the one shown in the toolbar + menu bar. But previously-loaded models now stay resident in the pool until LRU evicts, so the next switch-back skips disk read. Engines spawn via an injected factory so tests can stub.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Second of three v0.4.0 engine-parity sub-features.
ModelPoolactor: holds multipleInferenceEngineinstances, LRU-evicts under a byte budget, respects pinned entries, deduplicates concurrent loads of the same IDEngineCoordinatordelegatesload/unload/generate/clearPromptCachethrough the pool (public API unchanged —activeEngineis now async)User-visible win
External API cold-swap no longer unloads the GUI's current model. Multi-context workflows ("Claude Code uses small-fast, Cursor uses big-smart") keep both resident.
MVP scope
Test plan
swift build+swift test— 93/93xcodebuild -scheme macMLX -configuration Debug build— SUCCEEDED🤖 Generated with Claude Code