[PR #34] [MERGED] Thinking budget leaves room for the answer #291

Closed
opened 2026-10-29 21:23:52 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/mw00/project-maya/pull/34
Author: @ksanislo
Created: 10/9/2026
Status: ✅ Merged
Merged: 10/9/2026
Merged by: @mw00

Base: main ← Head: think-reserve


📝 Commits (1)

  • 8e71ec4 serve: the thinking budget leaves room for the answer (STRATA_GLM_THINK_RESERVE, at least 1024 tokens or a quarter of max_tokens)

📊 Changes

2 files changed (+11 additions, -3 deletions)

View changed files

📝 README.md (+1 -0)
📝 serve/server.py (+10 -3)

📄 Description

thinking_budget (32768) ignores the request's max_tokens. A client with max_tokens 8192, or no max_tokens at the default 32K context, can run out while still thinking: no answer at all.

  • Per request the budget becomes min(thinking_budget, max_tokens - max(STRATA_GLM_THINK_RESERVE, max_tokens/4)), reserve default 1024. Larger max_tokens: unchanged.
  • README: Tuning row.

Measured - Maya-M, max_tokens 2000, high effort: thinking closed at 976 tokens, complete answer, finish_reason: stop (before: length, no content). Server tests pass.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/mw00/project-maya/pull/34 **Author:** [@ksanislo](https://github.com/ksanislo) **Created:** 10/9/2026 **Status:** ✅ Merged **Merged:** 10/9/2026 **Merged by:** [@mw00](https://github.com/mw00) **Base:** `main` ← **Head:** `think-reserve` --- ### 📝 Commits (1) - [`8e71ec4`](https://github.com/mw00/project-maya/commit/8e71ec4bfde70116e0281154b5608f63cda52769) serve: the thinking budget leaves room for the answer (STRATA_GLM_THINK_RESERVE, at least 1024 tokens or a quarter of max_tokens) ### 📊 Changes **2 files changed** (+11 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `README.md` (+1 -0) 📝 `serve/server.py` (+10 -3) </details> ### 📄 Description `thinking_budget` (32768) ignores the request's `max_tokens`. A client with `max_tokens` 8192, or no `max_tokens` at the default 32K context, can run out while still thinking: no answer at all. - Per request the budget becomes `min(thinking_budget, max_tokens - max(STRATA_GLM_THINK_RESERVE, max_tokens/4))`, reserve default 1024. Larger `max_tokens`: unchanged. - README: Tuning row. **Measured** - Maya-M, `max_tokens` 2000, high effort: thinking closed at 976 tokens, complete answer, `finish_reason: stop` (before: `length`, no content). Server tests pass. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-29 21:23:52 +07:00
Sign in to join this conversation.
No labels
pull-request
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
mw00/project-maya#291
No description provided.