Skip to content

--vision: warn at startup when the chat template has no image path, and say so per request - #1076

Closed
BobClawblaw wants to merge 2 commits into
ashhart:mainfrom
BobClawblaw:glm-vision-template-probe
Closed

BobClawblaw wants to merge 2 commits into
ashhart:mainfrom
BobClawblaw:glm-vision-template-probe

Conversation

@BobClawblaw

Copy link
Copy Markdown
Contributor

Follow-up to @SvangenStudios' 1.1.0 report on #976: with --vision, Mia-AiLab/GLM-5.3-Flash-EXL3-4bpw-TensorFold's chat template turns media parts into a "You are unable to process this image" reminder, so every image request failed with HTTP 500 the chat template wrote 0 image placeholders for 1 image parts. That reads as an engine failure. It is a configuration problem. The report suggested both changes here.

What this changes

  • Startup probe (server.zig): with image input, Server.init renders one user turn holding an image part through the request path (prompt.renderIds) and looks for the engine's image token. If none comes out, it logs a warning naming --chat-template. Text requests are unaffected. A probe that cannot render stays quiet and leaves the request to report the real error.
  • Request error (images.zig): when the template writes no image placeholder at all, the message says so: the chat template wrote no image placeholder for 1 image part; a template that turns media parts into text has no image path: serve with --chat-template naming one that writes the image token. A miscount (some placeholders, but not one a part) keeps its counts.
  • Host test (videos.zig): both messages.

Checks

  • zig build test-cuda-host and zig build test-lane-api-host pass. The new test fails when its expected text is changed.
  • Two DGX Sparks (GB10), TP=2, GLM-5.3-Flash EXL3 (Mia-AiLab/GLM-5.3-Flash-EXL3-4bpw-TensorFold at 76c0b517), --vision --parallel 4:
    • The checkpoint's own template: the startup warning is logged. A 64×64 red PNG request returns 500 with the new message, and a text request returns 200.
    • zai-org/GLM-5.3-Flash's template via --chat-template: no warning, and the same image answers "Red".

Not covered

  • Other vision families' templates (Nemotron Omni, the Qwen CUDA families) and the Metal server. The probe and error are in shared server code, but I ran them only with GLM.
  • Video-only requests. The probe checks images.
  • A template that writes the wrong number of placeholders per part still fails at request time with the counts. The probe only checks that at least one comes out.

…h --vision, a clear request error)

With --vision, a template that turns media parts into text (GLM-5.3-Flash EXL3's, reported on ashhart#976) made every
image request fail with "the chat template wrote 0 image placeholders for 1 image parts", which reads as an engine
failure. At startup the server now renders one user turn holding an image part, as a request's is rendered, and
warns when no image placeholder comes out, naming --chat-template. A request whose template writes no placeholder
at all gets a message saying so; a miscount keeps its counts.
ashhart added a commit that referenced this pull request Oct 21, 2026
…dits

The 1.1.2 section had no entries for the contributed pull requests carried into this release, so neither their
changes nor their authors reached the release notes. Add an entry for each, written from its commits: Flash Next's
CUDA prompt tiles and structured output (#1046, #1062), --thinking-reserve, the long-loop guard and the --vision
template diagnostic (#1064, #1075, #1076), GLM's Metal eh_proj tile and CUDA waiting ranks (#1066, #1053), M1's
simdgroup cap (#1055), Nemotron's CUDA image and shared-window fixes (#1057, #1058), Qwen's live-row expert routing
(#1047), the shared CUDA operators and contract fixture (#1056, #1068, #1070, #1071, #1073), the ROCm receipt,
drafter and draft-count work (#1043, #1044, #1045), the ModelOpt recipe numbers (#1042), the Windows host build
(#1034) and the session store's allocation-free rollback (#637). Thank #643's and #1060's reporters as the other
entries thank theirs.
@ashhart

ashhart commented Oct 21, 2026

Copy link
Copy Markdown
Owner

The --vision template diagnostic is included in 1.1.2 (https://github.com/ashhart/TensorFold/releases/tag/v1.1.2), with your original authorship retained. Startup warns when a successfully rendered image probe has no image placeholder, and image requests explain a missing template image path. With #1117 fixed, a marker spelling in request text stays ordinary text and cannot stand in for the template's image placeholder. Closing this as carried, and thank you.

It landed as 0ac29e9 and a9797e0.

- Synthema, Ash's AI Assistant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants