[GH-ISSUE #4576] [Engine] Turn ends whenever the model tries to write "Nerazim" #2069

Closed
opened 2026-11-04 01:56:24 +07:00 by bsakaguchi · 3 comments
Owner

Originally created by @cmedinasoriano1 on GitHub (Oct 29, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/4576

Problem:
The Strata dsv41 engine (DeepSeek-V4.1-Flash) hard-stops the turn mid-generation, writing only "Neraz" when asked to use the name "Nerazim" in a sentence. Any string matching /\b\w+zim\b/i triggers the same stop. The same shards do not break in llama.cpp.

Environment:

  • Engine: strata 0.2.7 / build 0.1.52 (linux-x86_64-cuda-cuda13), /data/strata/engine-dsv41/0.1.52-linux-x86_64-cuda-cuda13/strata-dsv41
  • OS: Ubuntu
  • GPU/VRAM: NVIDIA RTX 5090, 32.6 GiB (GPU0, CUDA 13)
  • Model/quant: DeepSeek-V4.1-Flash-1017 GSQ-RCO IQ2_XS (2.25 bpw) — reproduces on BOTH the Strata-downloaded shards (original 4-shard Strata layout) and the fresh 6-shard vendor pack built via pack_gguf.py from the vendor's 6-shard llama.cpp GGUF set (48824 tensors; Engram IQ4_NL, DSpark Q8_0 drafter, mmproj BF16 tower)
  • Relevant settings: --pack /data/Strata-data/packs/deepseek-v4.1-flash-ist-das-2.25bpw-6shard --max-context 262144 --eos 1 --vision on --dspark auto --dspark-conf 0.65 --mmap-experts auto, TP=1, parallel 1, serving on :8000

Reproduce:

  1. Launch DeepSeek-V4.1-Flash on the Strata engine.
  2. Ask the model to use the name "Nerazim" in a sentence (any string matching /\b\w+zim\b/i triggers it).

Expected:
The turn completes with the word written in full — the same shards serve it normally in llama.cpp.

Actual:
The turn ends after writing only "Neraz" (the word truncated mid-generation); hard stop, no further tokens, no error in the response.

Evidence:

  • Client-side capture of the failed response: the turn ends after writing only "Neraz".
    Image

  • Engine log (aggregate only — it records token counts, never prompt/response text): the request read 3961 prompt tokens and generated only 12 before stopping: prompt 3961 tokens = 0 reused + 3961 read in 52275 ms (75.8 tok/s), 12 generated in 4458 ms (2.69 tok/s).

Reproduction status: Reproduced locally

Originally created by @cmedinasoriano1 on GitHub (Oct 29, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/4576 Problem: The Strata dsv41 engine (DeepSeek-V4.1-Flash) hard-stops the turn mid-generation, writing only "Neraz" when asked to use the name "Nerazim" in a sentence. Any string matching `/\b\w+zim\b/i` triggers the same stop. The same shards do not break in llama.cpp. Environment: - Engine: strata 0.2.7 / build 0.1.52 (linux-x86_64-cuda-cuda13), /data/strata/engine-dsv41/0.1.52-linux-x86_64-cuda-cuda13/strata-dsv41 - OS: Ubuntu - GPU/VRAM: NVIDIA RTX 5090, 32.6 GiB (GPU0, CUDA 13) - Model/quant: DeepSeek-V4.1-Flash-1017 GSQ-RCO IQ2_XS (2.25 bpw) — reproduces on BOTH the Strata-downloaded shards (original 4-shard Strata layout) and the fresh 6-shard vendor pack built via pack_gguf.py from the vendor's 6-shard llama.cpp GGUF set (48824 tensors; Engram IQ4_NL, DSpark Q8_0 drafter, mmproj BF16 tower) - Relevant settings: --pack /data/Strata-data/packs/deepseek-v4.1-flash-ist-das-2.25bpw-6shard --max-context 262144 --eos 1 --vision on --dspark auto --dspark-conf 0.65 --mmap-experts auto, TP=1, parallel 1, serving on :8000 Reproduce: 1. Launch DeepSeek-V4.1-Flash on the Strata engine. 2. Ask the model to use the name "Nerazim" in a sentence (any string matching `/\b\w+zim\b/i` triggers it). Expected: The turn completes with the word written in full — the same shards serve it normally in llama.cpp. Actual: The turn ends after writing only "Neraz" (the word truncated mid-generation); hard stop, no further tokens, no error in the response. Evidence: - Client-side capture of the failed response: the turn ends after writing only "Neraz". <img width="2293" height="701" alt="Image" src="https://github.com/user-attachments/assets/47a94015-8713-4d1f-8da4-03a267aefd45" /> - Engine log (aggregate only — it records token counts, never prompt/response text): the request read 3961 prompt tokens and generated only 12 before stopping: prompt 3961 tokens = 0 reused + 3961 read in 52275 ms (75.8 tok/s), 12 generated in 4458 ms (2.69 tok/s). Reproduction status: Reproduced locally
Author
Owner

@Niko1221 commented on GitHub (Oct 29, 2026):

Thanks, this one is on our side and the word does not matter.

The server ended the reply on the token im. Strata's server stops a reply on the ids of Qwen's <|im_end|> and <|endoftext|> unless the config says it is serving DeepSeek ("arch": "deepseek41"). DeepSeek's tokenizer has no such tokens and writes them as pieces, so <, |, >, end, of, text and im all counted as "stop here". "Nerazim" is N er az im; the model wrote the im, we treated it as the end and dropped it, which is why you got "Neraz". "Kazim" does the same, and so does any reply that runs into a | or >. The engine's 12 generated tokens include that dropped im. It is not the model or the quant, and it is why llama.cpp is fine.

I reproduced it on 2 x A6000 with the IQ2_XS pack: with "arch": "deepseek41" in the config every Nerazim and Kazim case comes out whole, without it they stop at "Neraz" and "Kaz".

Until the fix is out: add "arch": "deepseek41" to your config (a config started with strata launch already has it). The fix, for the next build, serves DeepSeek as DeepSeek when the config names no family and the tokenizer is DeepSeek's, and a stop id is now only ever a marker that is one token, so pieces of <|im_end|> can never end a reply.

Could you paste the top of your config (without keys)? If it had no arch that confirms it, and if it did, we have something else to look for.

<!-- gh-comment-id:6497260273 --> @Niko1221 commented on GitHub (Oct 29, 2026): Thanks, this one is on our side and the word does not matter. The server ended the reply on the token `im`. Strata's server stops a reply on the ids of Qwen's `<|im_end|>` and `<|endoftext|>` unless the config says it is serving DeepSeek (`"arch": "deepseek41"`). DeepSeek's tokenizer has no such tokens and writes them as pieces, so `<`, `|`, `>`, `end`, `of`, `text` and `im` all counted as "stop here". "Nerazim" is `N` `er` `az` `im`; the model wrote the `im`, we treated it as the end and dropped it, which is why you got "Neraz". "Kazim" does the same, and so does any reply that runs into a `|` or `>`. The engine's 12 generated tokens include that dropped `im`. It is not the model or the quant, and it is why llama.cpp is fine. I reproduced it on 2 x A6000 with the IQ2_XS pack: with `"arch": "deepseek41"` in the config every Nerazim and Kazim case comes out whole, without it they stop at "Neraz" and "Kaz". Until the fix is out: add `"arch": "deepseek41"` to your config (a config started with `strata launch` already has it). The fix, for the next build, serves DeepSeek as DeepSeek when the config names no family and the tokenizer is DeepSeek's, and a stop id is now only ever a marker that is one token, so pieces of `<|im_end|>` can never end a reply. Could you paste the top of your config (without keys)? If it had no `arch` that confirms it, and if it did, we have something else to look for.
Author
Owner

@cmedinasoriano1 commented on GitHub (Oct 29, 2026):

Yeah, I was experimenting more in the morning and it happens when token "im" (328) is used.

Your arch suggestion fixes it! Thanks for your quick response!

<!-- gh-comment-id:6497620883 --> @cmedinasoriano1 commented on GitHub (Oct 29, 2026): Yeah, I was experimenting more in the morning and it happens when token "im" (328) is used. Your arch suggestion fixes it! Thanks for your quick response!
Author
Owner

@Niko1221 commented on GitHub (Oct 29, 2026):

This one was on our side, and the word did not matter. The server stopped a reply on the ids of Qwen's <|im_end|> and <|endoftext|> unless the config said DeepSeek, so pieces such as im, | and > ended it ("Neraz" for "Nerazim"). Fixed in 0.2.8: a config with no arch but DeepSeek's tokenizer is served as DeepSeek, and a stop id is now only a marker that is a single token. Run strata update. Closing; reopen if a word still gets cut.

<!-- gh-comment-id:6510324139 --> @Niko1221 commented on GitHub (Oct 29, 2026): This one was on our side, and the word did not matter. The server stopped a reply on the ids of Qwen's `<|im_end|>` and `<|endoftext|>` unless the config said DeepSeek, so pieces such as `im`, `|` and `>` ended it ("Neraz" for "Nerazim"). Fixed in 0.2.8: a config with no arch but DeepSeek's tokenizer is served as DeepSeek, and a stop id is now only a marker that is a single token. Run `strata update`. Closing; reopen if a word still gets cut.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#2069
No description provided.