[PR #13838] [MERGED] glm 4.7 flash support on experimental engine #45661

Closed
opened 2026-04-25 01:18:59 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/13838
Author: @pdevine
Created: 1/22/2026
Status: Merged
Merged: 2/2/2026
Merged by: @pdevine

Base: mainHead: pdevine/glm-mlx


📝 Commits (6)

  • 4a07901 x models: add glm 4.7 flash to mlx engine
  • d7151ed add runner to glm 4.7 flash MLX implementation
  • b77939d x/imagegen: simplify weight loading API
  • 05c1ffd add glm4_moe_lite MLA absorption + add mxfp8 quantization
  • 9bb13cc fix quantizations for Q4 and Q8
  • 68fd213 fix unit test

📊 Changes

33 files changed (+3879 additions, -2406 deletions)

View changed files

📝 cmd/cmd_test.go (+2 -2)
📝 runner/runner.go (+6 -6)
📝 server/sched.go (+27 -7)
📝 x/create/client/create.go (+160 -4)
📝 x/create/client/quantize.go (+16 -6)
📝 x/create/create.go (+129 -13)
📝 x/create/create_test.go (+27 -17)
📝 x/create/imagegen.go (+15 -7)
📝 x/imagegen/cache/cache.go (+16 -0)
📝 x/imagegen/manifest.go (+9 -6)
📝 x/imagegen/mlx/mlx.go (+13 -0)
x/imagegen/models/glm4_moe_lite/glm4_moe_lite.go (+840 -0)
x/imagegen/models/glm4_moe_lite/parser.go (+479 -0)
x/imagegen/models/glm4_moe_lite/parser_test.go (+192 -0)
x/imagegen/models/glm4_moe_lite/render.go (+175 -0)
x/imagegen/models/glm4_moe_lite/render_test.go (+205 -0)
📝 x/imagegen/nn/nn.go (+40 -2)
x/imagegen/runner/runner.go (+0 -284)
📝 x/imagegen/safetensors/loader.go (+160 -11)
📝 x/imagegen/safetensors/safetensors.go (+5 -0)

...and 13 more files

📄 Description

This change adds GLM 4.7 Flash to the experimental engine.

To run, clone the GLM 4.7 Flash from Huggingface, and then:

go build -tags mlx -o engine ./x/imagegen/cmd/engine
./engine -model ../GLM-4.7-Flash -prompt "Write pong in html5/javascript. Make it super colorful." -max-tokens 2000

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ollama/ollama/pull/13838 **Author:** [@pdevine](https://github.com/pdevine) **Created:** 1/22/2026 **Status:** ✅ Merged **Merged:** 2/2/2026 **Merged by:** [@pdevine](https://github.com/pdevine) **Base:** `main` ← **Head:** `pdevine/glm-mlx` --- ### 📝 Commits (6) - [`4a07901`](https://github.com/ollama/ollama/commit/4a07901b0ad1e582033f4b3bcf2dc134d9728bbc) x models: add glm 4.7 flash to mlx engine - [`d7151ed`](https://github.com/ollama/ollama/commit/d7151eda21aa6fec32ec9923f8d8483a09e55485) add runner to glm 4.7 flash MLX implementation - [`b77939d`](https://github.com/ollama/ollama/commit/b77939dae56bbecbfb683292addc4b2ba8ffccf0) x/imagegen: simplify weight loading API - [`05c1ffd`](https://github.com/ollama/ollama/commit/05c1ffd169f07b777216e0af5e452c71119b056d) add glm4_moe_lite MLA absorption + add mxfp8 quantization - [`9bb13cc`](https://github.com/ollama/ollama/commit/9bb13cc6ea73f1e16d2ef25be4857daf5c8f0792) fix quantizations for Q4 and Q8 - [`68fd213`](https://github.com/ollama/ollama/commit/68fd213bd8ee5401b0ddfbd6b595b12cb7f0ff33) fix unit test ### 📊 Changes **33 files changed** (+3879 additions, -2406 deletions) <details> <summary>View changed files</summary> 📝 `cmd/cmd_test.go` (+2 -2) 📝 `runner/runner.go` (+6 -6) 📝 `server/sched.go` (+27 -7) 📝 `x/create/client/create.go` (+160 -4) 📝 `x/create/client/quantize.go` (+16 -6) 📝 `x/create/create.go` (+129 -13) 📝 `x/create/create_test.go` (+27 -17) 📝 `x/create/imagegen.go` (+15 -7) 📝 `x/imagegen/cache/cache.go` (+16 -0) 📝 `x/imagegen/manifest.go` (+9 -6) 📝 `x/imagegen/mlx/mlx.go` (+13 -0) ➕ `x/imagegen/models/glm4_moe_lite/glm4_moe_lite.go` (+840 -0) ➕ `x/imagegen/models/glm4_moe_lite/parser.go` (+479 -0) ➕ `x/imagegen/models/glm4_moe_lite/parser_test.go` (+192 -0) ➕ `x/imagegen/models/glm4_moe_lite/render.go` (+175 -0) ➕ `x/imagegen/models/glm4_moe_lite/render_test.go` (+205 -0) 📝 `x/imagegen/nn/nn.go` (+40 -2) ➖ `x/imagegen/runner/runner.go` (+0 -284) 📝 `x/imagegen/safetensors/loader.go` (+160 -11) 📝 `x/imagegen/safetensors/safetensors.go` (+5 -0) _...and 13 more files_ </details> ### 📄 Description This change adds GLM 4.7 Flash to the experimental engine. To run, clone the GLM 4.7 Flash from Huggingface, and then: ``` go build -tags mlx -o engine ./x/imagegen/cmd/engine ./engine -model ../GLM-4.7-Flash -prompt "Write pong in html5/javascript. Make it super colorful." -max-tokens 2000 ``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-25 01:18:59 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#45661