Repository navigation
server: a raw completions prompt list gets one choice a prompt, each the reply that prompt gets alone - #3194
Merged
Merged
Conversation
ashhart
force-pushed
the
lead/completions-prompt-list
branch
2 times, most recently
from
November 14, 2026 07:28
25e9629 to
202d83e
Compare
5 tasks done
ashhart
added a commit
that referenced
this pull request
Nov 17, 2026
…back under 600 (#3194) On main 3f1290f the prompt-list route takes zig/src/server/openai.zig to 601 lines even with three blank lines removed. legacyPrompt and its helpers (promptId, allInts, promptText), main's reading of a raw completion's prompt, move unchanged to completion_prompt.zig, and the three blank lines come back: openai.zig is 562 lines.
ashhart
force-pushed
the
lead/completions-prompt-list
branch
from
November 17, 2026 06:04
202d83e to
4259f39
Compare
This was referenced Nov 17, 2026
…rompt A /v1/completions prompt of two to 64 strings was joined with newlines into one prompt. Each string now runs as its own request with the body's other fields and the replies merge into one: choice i is prompt i's own text, stop and tensorfold block, usage sums them, and a stream sends each prompt's chunks with its index, then the finishes in order. Up to eight run at once; under --max-inflight or --max-inflight-per-key they take turns in the request's one place. A string, a one-string list and the token-id forms are unchanged; n must still be 1. The strings golden now has two choices. Issue #3171.
…back under 600 (#3194) On main 3f1290f the prompt-list route takes zig/src/server/openai.zig to 601 lines even with three blank lines removed. legacyPrompt and its helpers (promptId, allInts, promptText), main's reading of a raw completion's prompt, move unchanged to completion_prompt.zig, and the three blank lines come back: openai.zig is 562 lines.
ashhart
force-pushed
the
lead/completions-prompt-list
branch
from
November 17, 2026 14:31
4259f39 to
2a2350f
Compare
ashhart
added a commit
that referenced
this pull request
Nov 17, 2026
…back under 600 (#3194) On main 3f1290f the prompt-list route takes zig/src/server/openai.zig to 601 lines even with three blank lines removed. legacyPrompt and its helpers (promptId, allInts, promptText), main's reading of a raw completion's prompt, move unchanged to completion_prompt.zig, and the three blank lines come back: openai.zig is 562 lines.
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.
A
/v1/completionsrequest whosepromptis a list of strings used to be joined with newlines and served as one prompt with one choice. Now each string runs as its own request and the server merges the replies into one.max_tokens,seed,stopand the rest) as it would if it were the only prompt.choices[i]is prompt i's choice withindexi, its own stop and its owntensorfoldblock, which also carries that prompt'scached_tokens.usagesums every prompt's and every reply's tokens.index, then the finishes in list order, then one usage chunk whenstream_options.include_usageis set, then one[DONE]. Withoutinclude_usagethe last finish carries the summed usage.--max-inflightor--max-inflight-per-keythe request still holds one place, so its prompts run one at a time.Single prompts don't change. Only a list of two or more strings takes the new path. A string, a one-string list, a token-id list, a list of token-id lists and a mixed list build the same single prompt as before.
nmust still be 1 for a list, as for one prompt;nper prompt follows #3148'snchoices, and whichever of the two lands second shares one fan-out module.Tests on the fake engine, in
prompt_list_test.zig:token_shaof each prompt sent alone, whole and streamed, and usage is their sum.limit pins:case.n: 2is refused for a list as for one prompt, andmax_tokens: 1stops every prompt at its first token, as it does alone.--max-inflightno two prompts of a list are in the engine at once.Six of the seven fail on main; the token-id case passes on both. The
stringscompletions golden now has two choices.test-server-cpupasses 1350 with 7 skipped, andtest-golden,test-limit-pins-host,test-admission-host,test-server-securityandtest-request-seeds-hostpass.Part of #3171 (the rest is
nper prompt, after #3148).