mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #1627] [Feature]: logit_bias on /v1/chat/completions (accepted today, but has no effect) #653
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#653
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 @lukassbartik on GitHub (Oct 8, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/1627
What I would like
logit_biason/v1/chat/completions, at least the "never pick this token" case:falsein llama.cpp's form[[id, false]], or-100in 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
你好:The answer is
你好with and withoutlogit_bias, in both forms. The full 103,215-token list is accepted too, and你好andПриветstill come out. I found nologit_biasinserve/or in docs/DETAILS.md.Possibly useful
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.
@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.
@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.