mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #4137] [Engine] OutputParser prematurely terminates stream on prose words matching tool prefix heuristics #1814
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#1814
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @jlhs5 on GitHub (Oct 25, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/4137
Problem:
In DeepSeek-V4.1 with reasoning disabled (
reasoning_effort: "none"), prompts requesting log analysis with fields like "severidad, tecnica MITRE y recomendacion" trigger a premature termination (finish_reason: "stop") at token 19 or right at---\n\n## 3. Recom.Conversely, when asking the model to replace the term with "pasos de mitigacion" or when prompting for unrelated headings like
## Recuperación del Sistema, generation completes fully but finishes withfinish_reason: "length"while emitting the raw<|end▁of▁sentence|>token as plaintext.Environment:
Reproduce:
Execute the following curl request without declaring any tools:
curl -s http://127.0.0.1:18000/v1/chat/completions
-H "Content-Type: application/json"
-H "Authorization: Bearer <API_KEY>"
-d '{
"model": "DeepSeek-V4.1-Flash",
"messages": [
{
"role": "user",
"content": "Analiza este log: 2026-10-25T03:14:22Z sshd[4821]: Failed password for invalid user admin from 185.220.101.47 port 55221 ssh2. Da severidad, tecnica MITRE y recomendacion."
}
],
"reasoning_effort": "none",
"max_tokens": 2048,
"temperature": 0.2
}'
Expected:
The model generates the full response (~500 tokens) and halts cleanly upon reaching the EOS token without emitting raw delimiter text.
Actual:
The stream halts abruptly at completion token 19 with finish_reason: "stop":
{
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "# Análisis del evento de seguridad\n\n## 1. Datos del evento\n\n"
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 62,
"completion_tokens": 19,
"total_tokens": 81
}
}
Evidence:
## Recuperación del Sistemaalso complete without halting, but both successful completions finish withfinish_reason: "length"and end with the literal glyph<|end▁of▁sentence|>.self.stop_idsdoes not include the exact token ID corresponding to<|end▁of▁sentence|>(with the U+2581 glyph), whileOutputParserin serve/frontend.py enters an early stop state on specific output prefixes when parsing chat completions without declared tools.Reproduction status:
reproduced locally
@github-actions[bot] commented on GitHub (Oct 25, 2026):
Thanks for the issue. To keep the tracker readable, every item needs an area prefix in the title and the parts of the issue form filled in. This one is missing:
Edit the issue (title and description) and this note goes away on its own. If it is still missing parts in 5 days it will be closed, which is not a rejection: fix it and comment
/reopen.Details: CONTRIBUTING.md
@github-actions[bot] commented on GitHub (Oct 25, 2026):
Thanks, this follows the format now.
@aniya105 commented on GitHub (Oct 29, 2026):
Hello, may I ask what the output speed would be for the L20(48G) x 2 deployment of deepseek v4.1 flash?
@jlhs5 commented on GitHub (Oct 29, 2026):
Performance & Compatibility Notes
I feel like something might be missing or suboptimal in this setup. For comparison, with Qwen 3.8 Flash Next, I achieve 180 to 200 tokens per second, with peaks reaching up to 270 tokens per second. Additionally, while Qwen works seamlessly with the Web GUI, this DeepSeek deployment currently only functions through direct API calls and fails to work properly with the Web UI interface.
@Niko1221 commented on GitHub (Oct 29, 2026):
The engine is fine; the gateway config is the cause. Without
"arch": "deepseek41"the server gives DeepSeek the Qwen stop ids (<|im_end|>,<|endoftext|>). DeepSeek's tokenizer cuts those strings into pieces, so a|or>in a reply ends it, and the real end token (id 1) is not a stop id, so it prints as text. On two A6000 with your request: 730 to 1161 tokens with the arch, 192 to 436 without it.Until the next engine, add
"arch": "deepseek41"to the gateway config. Fixed on our side; the fix ships in the next update (0.2.8). With noarchnamed, the server now reads the pack's tokenizer and serves it as deepseek41.strata launchsets the arch, so Terminal and app users do not hit this.@Niko1221 commented on GitHub (Oct 29, 2026):
Fixed in 0.2.8: with no
archin the gateway config, the server reads the pack's tokenizer and serves it as deepseek41, and the real end token now ends the reply.strata launchalready sets the arch. Runstrata update. Closing.@aniya105 commented on GitHub (Oct 30, 2026):
Thank you very much for your reply. It is very useful to me.