[GH-ISSUE #1627] [Feature]: logit_bias on /v1/chat/completions (accepted today, but has no effect) #653

Closed
opened 2026-11-04 01:44:49 +07:00 by bsakaguchi · 2 comments
Owner

Originally created by @lukassbartik on GitHub (Oct 8, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/1627

What I would like
logit_bias on /v1/chat/completions, at least the "never pick this token" case: false in llama.cpp's form [[id, false]], or -100 in OpenAI's form {"id": -100}.

Why
I use Qwen3.8-Flash-Next IQ3_XXS in English and Czech. Now and then it switches to Chinese or Cyrillic in the middle of a sentence. With llama.cpp my app prevents this by sending every token that holds a letter outside Latin and Greek as false: 103,215 of the 248,320 tokens (control tokens are never in the list). With Strata the list has no effect, so these letters still get through.

What happens today (Strata 0.1.41, Windows 11, this model)
The field is accepted (HTTP 200) but ignored. Token 109266 is 你好:

curl http://127.0.0.1:8090/v1/chat/completions -H "Content-Type: application/json" -d '{
  "model": "qwen3.8-flash-next-iq3_xxs",
  "messages": [{"role": "user", "content": "Write the Chinese word for hello. Only the word."}],
  "max_tokens": 10, "temperature": 0, "reasoning_effort": "none",
  "logit_bias": [[109266, false]]
}'

The answer is 你好 with and without logit_bias, in both forms. The full 103,215-token list is accepted too, and 你好 and Привет still come out. I found no logit_bias in serve/ or in docs/DETAILS.md.

Possibly useful

  • The list does not change during an answer, so unlike the grammar mask in #1328 it might not need single-token windows.
  • Because the list is long, a way to give it once would work for me too, for example a file of token ids named on the server's command line and applied to every request.

Workaround today
None that holds. My app can only cut the answer when a banned letter appears and ask again from the start.

I searched the issues and pull requests for logit_bias, logit, ban, script, Chinese and Cyrillic and found no earlier request.

Originally created by @lukassbartik on GitHub (Oct 8, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/1627 **What I would like** `logit_bias` on `/v1/chat/completions`, at least the "never pick this token" case: `false` in llama.cpp's form `[[id, false]]`, or `-100` in OpenAI's form `{"id": -100}`. **Why** I use Qwen3.8-Flash-Next IQ3_XXS in English and Czech. Now and then it switches to Chinese or Cyrillic in the middle of a sentence. With llama.cpp my app prevents this by sending every token that holds a letter outside Latin and Greek as `false`: 103,215 of the 248,320 tokens (control tokens are never in the list). With Strata the list has no effect, so these letters still get through. **What happens today** (Strata 0.1.41, Windows 11, this model) The field is accepted (HTTP 200) but ignored. Token 109266 is `你好`: ``` curl http://127.0.0.1:8090/v1/chat/completions -H "Content-Type: application/json" -d '{ "model": "qwen3.8-flash-next-iq3_xxs", "messages": [{"role": "user", "content": "Write the Chinese word for hello. Only the word."}], "max_tokens": 10, "temperature": 0, "reasoning_effort": "none", "logit_bias": [[109266, false]] }' ``` The answer is `你好` with and without `logit_bias`, in both forms. The full 103,215-token list is accepted too, and `你好` and `Привет` still come out. I found no `logit_bias` in `serve/` or in docs/DETAILS.md. **Possibly useful** - The list does not change during an answer, so unlike the grammar mask in #1328 it might not need single-token windows. - Because the list is long, a way to give it once would work for me too, for example a file of token ids named on the server's command line and applied to every request. **Workaround today** None that holds. My app can only cut the answer when a banned letter appears and ask again from the start. I searched the issues and pull requests for logit_bias, logit, ban, script, Chinese and Cyrillic and found no earlier request.
Author
Owner

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

Update: logit_bias is applied in v0.1.42. PR #1646 (David) applies the request's biases in CUDA and HIP sampling before the token is chosen; only requests that send logit_bias are affected. A value of -100 is a hard ban (as with llama.cpp's false; OpenAI documents it as a near-ban), a positive value pushes a token up, and a value outside the allowed range or an id outside the vocabulary is a 400. We checked it on 2 RTX A4000 with a Q2_0 pack (no bias, a ban of one id, a +50 on another id, and a sampled run with a ban), and the unit test bans 103,215 ids. We did not check the SYCL or CPU-only engines. Please try your Latin and Greek ban list on v0.1.42 and tell us if it does what you wanted.

<!-- gh-comment-id:6099641997 --> @Niko1221 commented on GitHub (Oct 10, 2026): Update: logit_bias is applied in v0.1.42. PR #1646 (David) applies the request's biases in CUDA and HIP sampling before the token is chosen; only requests that send logit_bias are affected. A value of -100 is a hard ban (as with llama.cpp's false; OpenAI documents it as a near-ban), a positive value pushes a token up, and a value outside the allowed range or an id outside the vocabulary is a 400. We checked it on 2 RTX A4000 with a Q2_0 pack (no bias, a ban of one id, a +50 on another id, and a sampled run with a ban), and the unit test bans 103,215 ids. We did not check the SYCL or CPU-only engines. Please try your Latin and Greek ban list on v0.1.42 and tell us if it does what you wanted.
Author
Owner

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

Thanks for the report. To keep the tracker current we are closing issues older than three days: 0.1.44 is out with a long list of fixes, and many older reports are covered by it or by 0.1.43.1.

If this still happens on 0.1.44, please leave a comment here with your engine log (and the version line it prints), and we will reopen it. A new issue that links this one works too.

<!-- gh-comment-id:6156163692 --> @Niko1221 commented on GitHub (Oct 13, 2026): Thanks for the report. To keep the tracker current we are closing issues older than three days: [0.1.44](https://github.com/Niko1221/Strata/releases/tag/v0.1.44) is out with a long list of fixes, and many older reports are covered by it or by 0.1.43.1. If this still happens on 0.1.44, please leave a comment here with your engine log (and the version line it prints), and we will reopen it. A new issue that links this one works too.
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#653
No description provided.