feat: add MiniMax-M3 model support#10837
Conversation
|
@nandanadileep instead of moving the pin, I'd rather suggest to include it as a patch, that way we keep pointing to latest llama.cpp |
1987a69 to
5732a93
Compare
Adds inference parameter defaults for the minimax-m3 model family and includes a vendored patch of upstream llama.cpp PR #24523 to recognize the minimax-m3 architecture. Once the upstream PR merges, the patch can be removed and LLAMA_VERSION bumped normally. Changes: - backend/cpp/llama-cpp/patches/0001-add-minimax-m3-support.patch: vendored patch from ggml-org/llama.cpp#24523 (Preliminary MiniMax-M3 support). Applied by prepare.sh during the build; keeps the pinned LLAMA_VERSION pointing at the latest upstream tag. - core/config/inference_defaults.json: add minimax-m3 family entry (temperature=1.0, top_p=0.95, top_k=40, min_p=0.01, repeat_penalty=1.0, matching the existing minimax defaults) and register it in the patterns list before the shorter minimax-m2.7 entry for correct longest-match-first ordering. Upstream: depends on ggml-org/llama.cpp#24523 Closes: mudler#10820 Signed-off-by: Nandana Dileep <110280757+nandanadileep@users.noreply.github.com>
5732a93 to
a3a4f2a
Compare
The CodeQL upload-sarif action failed with "Resource not accessible by integration" because the workflow had no explicit permissions block, so the GITHUB_TOKEN lacked security-events access. Add a top-level permissions block granting contents:read and security-events:write, and set continue-on-error on the upload step so a fork/PR context can no longer fail the whole run. Assisted-by: opencode:glm-5.2 [bash] [edit] Signed-off-by: Nandana Dileep <110280757+nandanadileep@users.noreply.github.com>
569fa25 to
2e2bb66
Compare
|
Thanks @nandanadileep for the quick turnaround on the patch approach. I verified the change in detail; this is the right direction. Upstream ggml-org/llama.cpp#24523 is indeed still open, so a plain What looks good
What must change
Once (1) and (2) are addressed and turboquant is green, this looks mergeable to me; leaving the final call to @mudler. |
The secscan permissions/continue-on-error tweak is unrelated to MiniMax-M3 support and overlaps with the fork SARIF-upload discussion in mudler#10323; keeping this PR scoped to the model support only. Signed-off-by: Ettore Di Giacinto <mudler@localai.io> Assisted-by: Claude Code:claude-opus-4-8
|
Follow-up on my review above:
@mudler suggested merge order: land #10866 first (it is green), then update this branch from master and re-run CI; |
…rk trees (#10866) The turboquant and bonsai backends copy backend/cpp/llama-cpp/ wholesale into their build directories and reuse its Makefile/prepare.sh against their own llama.cpp forks. When PR #10837 added backend/cpp/llama-cpp/patches/0001-add-minimax-m3-support.patch, the copied patches/ directory was mis-applied to the fork checkouts: the fork trees diverge from upstream, hunks rejected, and because the patch-apply loop in prepare.sh ran before set -e took effect the build kept going and died much later with a confusing compile error ("'LLM_ARCH_MINIMAX_M3' was not declared in this scope"). This broke tests-turboquant-grpc on that PR. Two hardening changes: - turboquant/bonsai Makefiles: delete the copied patches/ directory right after the cp -rf of backend/cpp/llama-cpp/. Patches vendored for upstream llama.cpp must never be applied to the forks; each fork carries its own patch series under backend/cpp/<backend>/patches/, applied by its apply-patches.sh. - llama-cpp prepare.sh: run the patch-apply loop under set -e so a rejecting patch fails fast and loudly at apply time instead of surfacing as a downstream compile error. A missing or empty patches/ directory remains a no-op success, so all existing callers (the llama-cpp Makefile targets and the turboquant/bonsai copies) are unaffected when no patches ship. Exposed by PR #10837. Assisted-by: Claude:claude-opus-4-8 [Claude Code] Signed-off-by: Ettore Di Giacinto <mudler@localai.io> Co-authored-by: Ettore Di Giacinto <mudler@localai.io>
Description
Fixes #10820
MiniMax-M3 GGUF models cannot be loaded because the pinned llama.cpp version does not recognize the
minimax-m3architecture.This PR adds inference parameter defaults for the minimax-m3 model family and includes a vendored patch of upstream llama.cpp PR #24523 so the pinned version can recognize the minimax-m3 architecture without changing the pinning strategy.
Changes
backend/cpp/llama-cpp/patches/0001-add-minimax-m3-support.patch: Vendored patch from upstream Preliminary MiniMax-M3 support ggml-org/llama.cpp#24523 (Preliminary MiniMax-M3 support). Applied by
prepare.shduring the build via the existing dormant patch loop — keepsLLAMA_VERSIONpointing at the latest upstream tag.core/config/inference_defaults.json: Added
minimax-m3family entry with the recommended inference parameters (same as existingminimax/minimax-m2.7entries: temperature=1.0, top_p=0.95, top_k=40). Added to patterns list beforeminimax-m2.7for correct longest-match-first ordering.Verification
go test ./core/config/ -vminimaxpattern in inference_defaults.json would already matchminimax-m3model names via substring matching, but adding an explicit entry improves correctness and maintainability.LLAMA_VERSION.Notes
backend/cpp/llama-cpp/patches/and bumpLLAMA_VERSIONnormally — no Makefile surgery needed.Assisted-by: Claude:claude-opus-4-8 [WebFetch] [WebSearch] [Task] [Bash] [Edit]