Skip to content

GLM 5.3 Flash vision via strata-vision — mtmd already has glm5v upstream (llama.cpp#27773); ggml pin predates it #14

Closed as not planned

Description

@WildeTechSolutions

What

GLM 5.3 Flash is natively multimodal (the first GLM-5 model with it — trained on the 30T-token multimodal corpus, and Z.ai's API takes image, video and file input). docs/GLM.md lists pictures as missing in strata-poly. We'd like to add GLM vision through the existing strata-vision sidecar, and we think most of the encoder half already exists upstream.

The key observation

tools/vision/strata_vision.cpp is llama.cpp's mtmd library plus the model's mmproj file. llama.cpp merged GLM-5.3-Flash support with its vision tower on 2026-09-30 (ggml-org/llama.cpp#27773, merged): PROJECTOR_TYPE_GLM5V, mtmd_image_preprocessor_glm5v (a new preprocessing path — the author found glm4v's reuse didn't fit), clip changes, and the converter. The PR reports vision embeddings matching transformers to ~1e-5 and working end to end.

The fork's vendored ggml is pinned at 3cf03257f219 (Sun Sep 20) — ten days before that merge. So bumping the pin past #27773 gets the glm5v encoder and preprocessor for free; Unsloth already publishes the matching mmproj-BF16.gguf / mmproj-F16.gguf (1.16 GB) for GLM-5.3-Flash.

What's genuinely new is the engine side: glm5next.cpp doesn't override sees() / whole(), and the picture rows need positions that stay consistent through both the 34 KDA linear layers and the 11 DSA sparse layers (the DSA indexer scores pools of 4 consecutive tokens). llama.cpp's src/models/glm5-next.cpp (merged, +1005 lines) is a working reference for exactly that, and greedy token-by-token comparison against llama.cpp is the natural validation — the same oracle style the docs already use.

Why we're asking

GLM is the one model in the family where the encoder is cheap to get (upstream ships it) and the payoff is high: it's the only natively multimodal model strata-poly runs, and the sidecar already does this for Qwen3.6, Ornith, Gemma 4 and Tiel Coder. We couldn't find an existing issue for it — searched open issues and PRs.

What we can offer

We run the reference config: RTX 5090 (32 GB) + 122 GB DDR5, Linux, CUDA — the same class as the machine in the README's GLM row, and we measure honestly (we keep same-day runs of whatever build we test, per docs/COMMUNITY_BENCHMARKS.md). We're willing to build it, validate against llama.cpp greedy outputs, benchmark all three sizes, and send a PR — opt-in, default path byte-identical, one change per PR, per AGENTS.md.

Two questions before we start, so the PR fits the house:

  1. Is bumping the ggml pin past #27773 acceptable on its own (it may pull in unrelated ggml churn from the last three weeks), or would a vendored backport of just the glm5v mtmd pieces be preferred?
  2. For the engine side, does the VRAM budget for the encoder (1.6–2.4 GB on GPU, which comes out of the ~2,470-expert cache) want a --vision cpu default for GLM, or gpu with the cache shrink documented and measured?

Happy to open the PR against a branch if you'd rather steer the shape of it first.

Activity

  1. VecSzn commented on Oct 12, 2026

    @VecSzn
    Collaborator

    Thanks, this would be great, go for it.

    On the pin: I'd rather not touch the shared one, it's basically Strata's and both engines build their kernels from it, so every bump means rechecking everything twice and then fighting their pin at the next merge. The sidecar builds from its own LLAMA_DIR anyway, so just give it a second llama.cpp zip past #27773 and leave the engines alone. It's one binary for all five models though, so make sure the other four still see pictures the same, and put that pin into vision_src so the Windows zip notices.

    On VRAM: no special case for GLM, setup already picks gpu or cpu from the card like for the others. My guess is the 2 GB costs almost nothing since GLM decode on the 5090 is CPU-bound anyway, but just run the README benchmark both ways and whatever wins goes in GLM.md.

    Two PRs would be easiest for me, the sidecar pin first, then GLM itself. Opt-in by the mmproj, default path byte-identical. I just merged Strata 0.1.43.1 and the release goes out today, so base on main after that.

  2. added a commit that references this issue on Oct 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions