Repository navigation
Conversation
ashhart
force-pushed
the
lead/logprobs-tools-stop-responses
branch
2 times, most recently
from
November 14, 2026 02:29
0644bf7 to
aabf8ec
Compare
…s API Chat completions serve logprobs with tools, stop strings, structured output and a thinking budget, from the rows the engine already returns: prose, reasoning and each tool call get their own entries, a stop string trims the entries with the text, and a token the text shows only part of keeps its row with the bytes it shows and its token_id. A stream without tools sends each entry with the chunk that completes its token; with tools the entries follow once the calls are parsed. The Responses API carries them in its output items and delta events. Text and tokens are the same with logprobs on or off. Fixes #3186
After the rebase, a /v1/responses logprobs ask on an engine without rows was refused by the chat plan's writer, which omits the param and code fields the route's own refusals carry. Refuse in the turn before the chat runs, through the route's writer, with main's message; include alone still serves without rows, as before.
ashhart
force-pushed
the
lead/logprobs-tools-stop-responses
branch
from
November 14, 2026 04:48
aabf8ec to
566e933
Compare
ashhart
added a commit
that referenced
this pull request
Nov 14, 2026
…elf, which its landing missed); #3206's changelog line
Owner
Author
|
This landed on main as 56166e8, 9144f4e and 3d83e77 (your head 566e933, rebased), but by a mistake on our side: it went in with #3298 instead of through the landing train. Its own CI was green (zig, zig-windows, pytest), and the changelog line is now on main through #3300. The device check it skipped (Qwen3.8-27B on an M5 and on a GB10, main before it against main with it) is running now. If it comes back red, we revert and land it again through the train.
|
This was referenced Nov 14, 2026
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.
Chat completions now serve
logprobstogether with tools, stop strings, structured output and a thinking budget, and the Responses API serves them too. Until now each of these was refused with HTTP 400.What changed
logprobs.contentcovers the prose,logprobs.reasoning_contentthe reasoning, andlogprobs.tool_callsholds one{index, content}group a call with the entries of the markup the model wrote. A call dropped byparallel_tool_calls: falsegets none and is not read as prose.token_id.top_logprobsorinclude: ["message.output_text.logprobs"]filloutput_text.logprobsand the delta and done events, with extensions on reasoning parts and function-call items.includealone on an engine without logprobs answers as before, without them.Why text and tokens are unchanged: the engine's request differs only in asking for rows, as a plain logprobs request already does; sampling, grammar masks, drafts, stops and the tool parser run unchanged, and the projection only reads the finished tokens and rows. With logprobs off nothing new runs per token. Host tests check, for each combination, that the message and
token_idsare identical with logprobs on and off, and that every entry equals the same token's entry in a plain request.Tests
zig build test-logprob-offers-host: 38 pass, including new tests for tools, stops inside a token and across rounds, thinking budgets, dropped calls, structured output and Responses, whole and streamed.zig build test-server-cpu: 1352 pass, 7 skipped.test-tool-parse-hostandtest-cuda-hostpass.zig fmt --check,git diff --check, and the lean check with no new findings.Still owed: a live check on a served model (chat and Responses, whole and streamed, with tools, stops and a thinking budget), comparing text, token ids and entries with logprobs on and off, and decode speed with logprobs off.
Fixes #3186