Repository navigation
server: POST /v1/images/generations for an engine with an image capability (#1573) - #2253
Draft
devopsfortunato wants to merge 2 commits into
Draft
devopsfortunato wants to merge 2 commits into
devopsfortunato wants to merge 2 commits into
Conversation
devopsfortunato
force-pushed
the
task/Tensorfold-Contribut+t-mw2m47ye-s9riow-route
branch
from
November 5, 2026 13:34
8526a54 to
3bbf90e
Compare
5 tasks done
devopsfortunato
force-pushed
the
task/Tensorfold-Contribut+t-mw2m47ye-s9riow-route
branch
from
November 5, 2026 22:37
3bbf90e to
e92ce5e
Compare
devopsfortunato
force-pushed
the
task/Tensorfold-Contribut+t-mw2m47ye-s9riow-route
branch
from
November 5, 2026 22:58
e92ce5e to
95aebb7
Compare
4 tasks done
Contributor
Author
|
CI note: the runs for the rebased head |
Owner
|
Thanks @devopsfortunato. The route reads well: every check happens before the engine is called, a client that
|
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.
What this changes
d00584834), which addsInfo.image,VTable.submit_imageandEngine.submitImage.atc overlap --json(on head3bbf90e78, basecde4fe7d9):complete: false(pullFilesUnavailable,timeLimit), 11 changed files because this branch carries engine api: an optional image capability beside speech (#1573) #2248's commit. A 3-way merge of each shared file against the open PRs that touch it is clean exceptCHANGELOG.md: Clef-Flash: joint-schema decisions on /v1/systemone (HIP) #2048 sharesdocs/api.md,root.zigandCHANGELOG.md— the two code files merge with no conflict markers and both sides' lines kept, and only the top## Unreleasedanchor conflicts, resolved by keeping both bullets; Unlimited-OCR-2 on native Metal: the publisher's BF16 release, page images to structured text #2074 shares onlyCHANGELOG.md, the same additive-bullet resolution; ricursive: Ripple-65B-Preview on native Metal (NVFP4 and bf16 releases) #2231 and Nemotron Parse on HIP: NVIDIA's checkpoint, token-exact against its HF example #1941 share onlyzig/src/core/engine_api.zig(inherited from engine api: an optional image capability beside speech (#1573) #2248), and each merges with no conflict markers. Nothing else overlaps.Before: an engine can state an image capability, but the server has no route that asks it for a picture —
POST /v1/images/generationsanswers the unknown-path 404 even on an engine that serves images. After: an engine whoseInfo.imageis set is served atPOST /v1/images/generations— one picture a request as a base64 PNG, in the shape agreed on the issue:n1 only,b64_jsononly, every unknown field refused by name, the pipeline's own options at their defaults (negative_prompt,seed,steps,guidance), the API's limits enforced here and tightened by the host's ownImageInfo(1536 a side, 1,572,864 pixels, 1 to 200 steps, a 16 KiB prompt and the host's token cap), nothing written to the connection before the engine'sfinishedevent, and a client that leaves cancelled through the existingsettlepath. An engine without the capability is unchanged (404), and a text engine's routes are untouched.The route follows
/v1/audio/speech's pattern for a model that is not a token family, in the maintainer's shape:n1 only;b64_jsononly; unknown fields refused by name; an image capability besideSpeechInfo; one request at a time; every text-engine option refused for the checkpoint. Capacity is a 503 withRetry-After; a refusal is a 400 in the API'sinvalid_request_errorshape; a failed pass is a 500 carrying the engine's own message (copied into the request arena before the mailbox is freed).Checks on this head
3bbf90e78(parentd00584834from engine api: an optional image capability beside speech (#1573) #2248, on maincde4fe7d9)python3 tools/zig/lean_check.py, on the base (cde4fe7d9, 5520 files) and on this head (5524 files): 425 and 425 problems, 0 new findings..zig-version:zig build test— exit 0,Build Summary: 545/545 steps succeeded; 6101/6137 tests passed (36 skipped)zig build test-golden— exit 0,5/5 steps succeededzig build test-server-security test-pull-security— exit 0,14/14 steps succeeded; 29/29 tests passedzig build test-kernel-contract— exit 0,22/22 steps succeeded; 180/180 tests passedzig fmt --check build.zig zig— exit 0zig/src/server/images_generations_test.zig, over a Unix socket pair against a stub image engine (the harnessspeech_stream_test.ziguses): an accepted request reaches the engine once with the parsed fields and the reply'sdata[0].b64_jsondecodes to the stub's PNG; defaults 42/50/3/empty/1024x1024; a 17-row refusal table each a 400invalid_request_errornaming the field or limit and never reaching the engine (n2 and 0, sizes 1000x1024 / 2048x2048 / 1552x1024 / 1536x1040,response_formaturl,steps0 and 201,guidance0.5 and 1e300,quality/style/user, an unknown key, an empty prompt, an unserved model); a prompt past 16 KiB; anegative_promptpast 16 KiB or the token cap; a failed pass as a 500 with the engine's message; a text route on an image engine as a 400 naming this route; this route on a text engine as the 404;error.Busyas a 503 withRetry-After;error.InvalidRequestas a 400; and nothing on the wire beforefinished.zig build testexits 1 and 9 of the 11 fail (the two that stay green assert route-level refusals that do not depend on dispatch); restored, exit 0.3bbf90e78: green as a draft —zig18m14s,zig-windows23m23s,zig-macos-dev-tools7m36s,release-paths,fmt16s,benchmark-clientson ubuntu-latest and windows-latest. No failures.Info.image, and this machine has no MOSS-Image checkpoint, so nothing serves a real picture here. Metal, HIP and XPU were not run.Receipt
n/a — this change cannot reach inference on its own: no engine in the tree states an image capability, so no picture is produced. The route and its admission are exercised by the host tests against a stub image engine, and
test-golden's recorded server corpus is unchanged.The MOSS-Image host is outstanding
@BobClawblaw handed both halves over on #1573 and left a reference branch (
BobClawblaw/TensorFold@4f204cf35) withnative/moss_image_host.zig, verified byte-equal againsttf-moss-image-generateon an M5 Ultra. That host is Metal (@import("metal"),mtl.Device) and this machine has no Mac and no MOSS-Image checkpoint, so it cannot be compiled or run here and is not in this pull request. The route is complete and gated without it; the served-PNG equality and the text-family A/B need a Mac with the checkpoint, which is the receipt that would close #1573. The generate tool's own gate (from #1531) is also unfinished per that handoff, and the served PNG has nothing to equal until it runs.Checklist
speech_stream_test.zig).