[GH-ISSUE #123] Feature request: cap on thinking tokens (like llama.cpp's reasoning_budget_tokens) #63

Closed
opened 2026-11-04 01:39:26 +07:00 by bsakaguchi · 5 comments
Owner

Originally created by @joey-j7 on GitHub (Sep 29, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/123

With reasoning_effort medium, Qwen3.8-Flash-Next sometimes thinks past 8k to 12k tokens. Thinking and the answer share max_tokens, so some requests end with reasoning only and empty content, and the client sees no answer.

llama.cpp handles this with reasoning_budget_tokens and reasoning_budget_message: once the budget is spent, the model is told to wrap up, thinking is closed, and it writes the answer. Could Strata offer something similar, either per request or as a server default?

Setup: Linux, RTX 4080 Laptop 12 GB, IQ3_S, engine 0.1.20.

Originally created by @joey-j7 on GitHub (Sep 29, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/123 With `reasoning_effort` medium, Qwen3.8-Flash-Next sometimes thinks past 8k to 12k tokens. Thinking and the answer share `max_tokens`, so some requests end with reasoning only and empty content, and the client sees no answer. llama.cpp handles this with `reasoning_budget_tokens` and `reasoning_budget_message`: once the budget is spent, the model is told to wrap up, thinking is closed, and it writes the answer. Could Strata offer something similar, either per request or as a server default? Setup: Linux, RTX 4080 Laptop 12 GB, IQ3_S, engine 0.1.20.
Author
Owner

@technerd-official commented on GitHub (Sep 29, 2026):

Just found out that you can set "Max tokens" inside the chat window "127.0.0.1:8080" (click on the small gear) right now max tokens is set to "Until done" and also the sampling settings can be adjusted. These carry over to an agent in case you use one.

<!-- gh-comment-id:5887883581 --> @technerd-official commented on GitHub (Sep 29, 2026): Just found out that you can set "Max tokens" inside the chat window "127.0.0.1:8080" (click on the small gear) right now max tokens is set to "Until done" and also the sampling settings can be adjusted. These carry over to an agent in case you use one.
Author
Owner

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

Good idea - planned server-side: when the thinking part reaches the budget, append a short wrap-up and </think>, and continue from there (the prefix is reused, so it costs nothing extra). Keeping this open until it lands.

<!-- gh-comment-id:5887958988 --> @Niko1221 commented on GitHub (Sep 29, 2026): Good idea - planned server-side: when the thinking part reaches the budget, append a short wrap-up and `</think>`, and continue from there (the prefix is reused, so it costs nothing extra). Keeping this open until it lands.
Author
Owner

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

Planned as described: once the thinking reaches the budget, the server appends a short wrap-up and </think> and continues from the reused prefix. Until then, the chat page's max-tokens setting (the gear icon) helps.

<!-- gh-comment-id:5898185047 --> @Niko1221 commented on GitHub (Sep 29, 2026): Planned as described: once the thinking reaches the budget, the server appends a short wrap-up and `</think>` and continues from the reused prefix. Until then, the chat page's max-tokens setting (the gear icon) helps.
Author
Owner

@Niko1221 commented on GitHub (Sep 30, 2026):

Planned for 0.1.31 as an opt-in: a reasoning_budget_tokens request field (and a config default). At the budget the server closes the thinking block and lets the model answer. Off by default.

<!-- gh-comment-id:5917513745 --> @Niko1221 commented on GitHub (Sep 30, 2026): Planned for 0.1.31 as an opt-in: a `reasoning_budget_tokens` request field (and a config default). At the budget the server closes the thinking block and lets the model answer. Off by default.
Author
Owner

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

0.1.31: reasoning_budget_tokens in a request (OpenAI or Anthropic) or as a config default, off by default. At the budget the server closes the thinking block with a short wrap-up and lets the model answer. See docs/DETAILS.md.

<!-- gh-comment-id:5925213286 --> @Niko1221 commented on GitHub (Oct 1, 2026): [0.1.31](https://github.com/Niko1221/Strata/releases/tag/v0.1.31): `reasoning_budget_tokens` in a request (OpenAI or Anthropic) or as a config default, off by default. At the budget the server closes the thinking block with a short wrap-up and lets the model answer. See docs/DETAILS.md.
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#63
No description provided.