Repository navigation
Conversation
thefallentree
added a commit
to thefallentree/llama.cpp-gp100
that referenced
this pull request
Nov 14, 2026
…nd in the parsed output Input: the server tokenized the rendered chat prompt as one string with parse_special, so a file the agent read and sent back as a tool result turned "</think>", "<tool_call>", "<|im_end|>" into the special tokens. llama_tokenize_with_literals() takes byte ranges in which no special token is matched, not even a user-defined one (Qwen's <think> and <tool_call> are USER_DEFINED and match even with parse_special = false). The text runs between real special tokens are still tokenized as a whole, so the tokens across the part borders are those of the whole text. The jinja input marking (ggml-org#30389) gives the ranges; tokenize_chat_prompt() follows the shape of the open upstream PR ggml-org#32033 (--chat-input-special / --no-chat-input-special), also for the count-tokens endpoints and mtmd (mtmd_tokenize_from_parts joins adjacent text parts and passes the literal ranges). Fork default: disabled, client text is text; a request may set "chat_input_special". Output: with the vocab's special token table, a PEG literal or until delimiter that names a special token matches only that token id in the generated tokens (ggml-org#29876), so "</think>" or "<tool_call>" written as ordinary tokens in reasoning or content no longer cuts it. A small stand-in for the token-aware parsing of the open upstream PR ggml-org#29307. Text without tokens parses as before. Refs: mkyt docs/decisions.md P6-50, P6-51; ggml-org#28249, ggml-org#32033, ggml-org#29307, ggml-org#29876, ggml-org#30389, ggml-org#28250. Co-Authored-By: Claude Opus 5.5 <[email protected]>
thefallentree
added a commit
to thefallentree/llama.cpp-gp100
that referenced
this pull request
Nov 17, 2026
…nd in the parsed output Input: the server tokenized the rendered chat prompt as one string with parse_special, so a file the agent read and sent back as a tool result turned "</think>", "<tool_call>", "<|im_end|>" into the special tokens. llama_tokenize_with_literals() takes byte ranges in which no special token is matched, not even a user-defined one (Qwen's <think> and <tool_call> are USER_DEFINED and match even with parse_special = false). The text runs between real special tokens are still tokenized as a whole, so the tokens across the part borders are those of the whole text. The jinja input marking (ggml-org#30389) gives the ranges; tokenize_chat_prompt() follows the shape of the open upstream PR ggml-org#32033 (--chat-input-special / --no-chat-input-special), also for the count-tokens endpoints and mtmd (mtmd_tokenize_from_parts joins adjacent text parts and passes the literal ranges). Fork default: disabled, client text is text; a request may set "chat_input_special". Output: with the vocab's special token table, a PEG literal or until delimiter that names a special token matches only that token id in the generated tokens (ggml-org#29876), so "</think>" or "<tool_call>" written as ordinary tokens in reasoning or content no longer cuts it. A small stand-in for the token-aware parsing of the open upstream PR ggml-org#29307. Text without tokens parses as before. Refs: mkyt docs/decisions.md P6-50, P6-51; ggml-org#28249, ggml-org#32033, ggml-org#29307, ggml-org#29876, ggml-org#30389, ggml-org#28250. Co-Authored-By: Claude Opus 5.5 <[email protected]>
thefallentree
added a commit
to thefallentree/llama.cpp-gp100
that referenced
this pull request
Nov 19, 2026
…nd in the parsed output Input: the server tokenized the rendered chat prompt as one string with parse_special, so a file the agent read and sent back as a tool result turned "</think>", "<tool_call>", "<|im_end|>" into the special tokens. llama_tokenize_with_literals() takes byte ranges in which no special token is matched, not even a user-defined one (Qwen's <think> and <tool_call> are USER_DEFINED and match even with parse_special = false). The text runs between real special tokens are still tokenized as a whole, so the tokens across the part borders are those of the whole text. The jinja input marking (ggml-org#30389) gives the ranges; tokenize_chat_prompt() follows the shape of the open upstream PR ggml-org#32033 (--chat-input-special / --no-chat-input-special), also for the count-tokens endpoints and mtmd (mtmd_tokenize_from_parts joins adjacent text parts and passes the literal ranges). Fork default: disabled, client text is text; a request may set "chat_input_special". Output: with the vocab's special token table, a PEG literal or until delimiter that names a special token matches only that token id in the generated tokens (ggml-org#29876), so "</think>" or "<tool_call>" written as ordinary tokens in reasoning or content no longer cuts it. A small stand-in for the token-aware parsing of the open upstream PR ggml-org#29307. Text without tokens parses as before. Refs: mkyt docs/decisions.md P6-50, P6-51; ggml-org#28249, ggml-org#32033, ggml-org#29307, ggml-org#29876, ggml-org#30389, ggml-org#28250. Co-Authored-By: Claude Opus 5.5 <[email protected]>
thefallentree
added a commit
to thefallentree/llama.cpp-gp100
that referenced
this pull request
Nov 19, 2026
…nd in the parsed output Input: the server tokenized the rendered chat prompt as one string with parse_special, so a file the agent read and sent back as a tool result turned "</think>", "<tool_call>", "<|im_end|>" into the special tokens. llama_tokenize_with_literals() takes byte ranges in which no special token is matched, not even a user-defined one (Qwen's <think> and <tool_call> are USER_DEFINED and match even with parse_special = false). The text runs between real special tokens are still tokenized as a whole, so the tokens across the part borders are those of the whole text. The jinja input marking (ggml-org#30389) gives the ranges; tokenize_chat_prompt() follows the shape of the open upstream PR ggml-org#32033 (--chat-input-special / --no-chat-input-special), also for the count-tokens endpoints and mtmd (mtmd_tokenize_from_parts joins adjacent text parts and passes the literal ranges). Fork default: disabled, client text is text; a request may set "chat_input_special". Output: with the vocab's special token table, a PEG literal or until delimiter that names a special token matches only that token id in the generated tokens (ggml-org#29876), so "</think>" or "<tool_call>" written as ordinary tokens in reasoning or content no longer cuts it. A small stand-in for the token-aware parsing of the open upstream PR ggml-org#29307. Text without tokens parses as before. Refs: mkyt docs/decisions.md P6-50, P6-51; ggml-org#28249, ggml-org#32033, ggml-org#29307, ggml-org#29876, ggml-org#30389, ggml-org#28250. Co-Authored-By: Claude Opus 5.5 <[email protected]>
thefallentree
added a commit
to thefallentree/llama.cpp-gp100
that referenced
this pull request
Nov 20, 2026
…nd in the parsed output Input: the server tokenized the rendered chat prompt as one string with parse_special, so a file the agent read and sent back as a tool result turned "</think>", "<tool_call>", "<|im_end|>" into the special tokens. llama_tokenize_with_literals() takes byte ranges in which no special token is matched, not even a user-defined one (Qwen's <think> and <tool_call> are USER_DEFINED and match even with parse_special = false). The text runs between real special tokens are still tokenized as a whole, so the tokens across the part borders are those of the whole text. The jinja input marking (ggml-org#30389) gives the ranges; tokenize_chat_prompt() follows the shape of the open upstream PR ggml-org#32033 (--chat-input-special / --no-chat-input-special), also for the count-tokens endpoints and mtmd (mtmd_tokenize_from_parts joins adjacent text parts and passes the literal ranges). Fork default: disabled, client text is text; a request may set "chat_input_special". Output: with the vocab's special token table, a PEG literal or until delimiter that names a special token matches only that token id in the generated tokens (ggml-org#29876), so "</think>" or "<tool_call>" written as ordinary tokens in reasoning or content no longer cuts it. A small stand-in for the token-aware parsing of the open upstream PR ggml-org#29307. Text without tokens parses as before. Refs: mkyt docs/decisions.md P6-50, P6-51; ggml-org#28249, ggml-org#32033, ggml-org#29307, ggml-org#29876, ggml-org#30389, ggml-org#28250. Co-Authored-By: Claude Opus 5.5 <[email protected]>
x1250
added a commit
to x1250/llama.cpp
that referenced
this pull request
Nov 22, 2026
…s session Section 9.6, the registry and CLAUDE.md called upstream ggml-org#28249 a pull request. It is the maintainer's tracking issue (input marking); its pull request is ggml-org#32033, a draft that still splits the prompt on the published media marker, so it does not replace the request-scoped marker. The defect recorded next to the media marker is no longer only measured on a synthetic message: the tool result that carried the marker in the Director's session carries the chat template too, 26 strings of its 12 control tokens, and the later replies of that session were generated with them as control tokens in the prompt. Counted with session_tags.py (counts only) and reproduced without slots by special_in_text.py (a /props dump in a tool result: 4036 tokens, 4345 as text).
…erver # Conflicts: # tools/server/server.cpp # tools/server/tests/utils.py
This branch has not been deployed
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.
Overview
Resolve #28249
Adding
--no-chat-input-specialwhich allows entering special tokens via chat endpoints, and the special tokens won't be parsed as specialThis doesn't work correctly on all model, very dependent on the template itself. May need to have a validation logic to maybe reject or show warnings on template that doesn't work correctly
Requirements