Repository navigation
Add Mellum 2.1 support - #697
Merged
Merged
Conversation
davidkoski
approved these changes
Oct 16, 2026
davidkoski
left a comment
Member
There was a problem hiding this comment.
Change looks good, thank you!
wballard
added a commit
to swissarmyhammer/mlx-swift-lm-old
that referenced
this pull request
Oct 23, 2026
Apply the upstream commits 6e338e5..d02948b as a 3-way patch. CLAUDE.md is excluded. - 1dc19ef fix(fusion): Preserve scaled NVFP4 projections (ml-explore#705) - 11b2eda Add Mellum 2.1 support (ml-explore#697) - 48114ee Read transformers 5 keys in LFM2-VL configs (ml-explore#695) - bb0d5b0 fix loratrain for tiny prompts (ml-explore#683) - d02948b Generate JSON properties in the schema's declared order (ml-explore#718) No conflicts. Mellum makes only KV and sliding-window caches, so the post-merge ArraysCache.advance checks do not apply. Tests: MLXLMTests 874 XCTest and 1717 Swift Testing tests pass. MLXGuidedGenerationTests 70, MLXFoundationModelsTests 374, CXGrammarTests 7, MLXHuggingFaceMacrosTests 5 pass. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ximyro
pushed a commit
to ximyro/mlx-swift-lm
that referenced
this pull request
Nov 4, 2026
Brings in ml-explore#622 (exact prefix rewinds in rotating KV caches), ml-explore#619 (streaming detokenizers), ml-explore#698, ml-explore#699, ml-explore#700, ml-explore#701, ml-explore#705, ml-explore#697 and ml-explore#695. Conflicts: AttentionUtils.swift keeps TurboKV telemetry next to upstream's SharedAttentionKVCache; KVCache.swift takes upstream's serialization and rotating-cache view/trim while keeping the fork's TurboQuant state, public cache fields and temporallyOrdered. Follow-ups for upstream behavior the fork had changed: the Qwen2VL audio placeholder no longer indexes content.count - 1 when a tool-call message has no text part, and Gemma4MessageGenerator uses content parts for every non-system role. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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.
Proposed changes
This adds support for JetBrains Mellum 2.1 , a 12B-total / 2.5B-active MoE model built for coding agents. It mixes full-attention and sliding-window layers, and dense and sparse feed-forward layers.
Shared change (
QuantizedVocabularyProjection.swift)Qwen3PrefillLogitsTestsnow also covers 6 bits.Performance
Tested on a MacBook Pro M4 Pro with 24 GB, macOS 26.6.2, on AC power, at commit
d7f68bc. The model is [mlx-community/Mellum2.1-12B-A2.5B-Thinking-6bit](https://huggingface.co/mlx-community/Mellum2.1-12B-A2.5B-Thinking-6bit), built in Release. Prompts are real Swift source from this repo. Each run uses greedy decoding for 256 tokens on a fresh cache, after one warm-up. Each figure is the median of 3 runs.These use the default
GenerateParameters, which prefill in 512-token chunks. Settingparameters.prefill.stepSize = 2048makes prefill about 2–6% faster at 1k–4k tokens (1,291 and 1,170 tok/s) and cuts time to first token to 0.79 s and 3.50 s. The 128-token prompt is not affected.Loading from the page cache takes about 2 s, and the weights occupy 9.9 GB once loaded.
Youtube Video showcasing the model
Checklist
Put an
xin the boxes that apply.pre-commit run --all-filesto format my code / installed pre-commit prior to committing changesAI usage
accurately describes the code changes.