[PR #1196] [CLOSED] serve: share the thinking budget with other apps, like max_tokens and… #3302

Closed
opened 2026-11-07 14:40:28 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/1196
Author: @elanonimo832
Created: 10/6/2026
Status: ❌ Closed

Base: main ← Head: feat/shared-thinking-budget-rebased


📝 Commits (1)

  • 65cda1a serve: share the thinking budget with other apps, like max_tokens and the effort

📊 Changes

2 files changed (+25 additions, -2 deletions)

View changed files

📝 serve/server.py (+8 -2)
📝 serve/test_server.py (+17 -0)

📄 Description

… the effort

The Chat settings a client posts to /settings reach every client through shared, and reasoning_effort and max_tokens are among them. The thinking budget (#123) was not, so a client that sets none of its own kept thinking to the ceiling while the Chat settings asked for less.

Two changes make it work like the other shared keys:

  • reasoning_budget_tokens joins SHARED_KEYS, validated as a whole number of tokens. 0 keeps its documented meaning ("no budget"), so it is allowed there where seed and max_tokens require > 0.
  • Service.run reads the budget after sampling_defaults and shared are merged into sampling. It read it before the merge, so no shared key could ever reach it. The request's own value still wins (an explicit reasoning_budget_tokens: 0 keeps turning a shared or configured one off), and the config's reasoning_budget_tokens stays the fallback.

Tests: test_a_shared_budget_reaches_a_request_that_sets_none (fails with "1 != 2" on the engine prompts before the change) and test_a_shared_budget_must_be_a_whole_number_of_tokens, next to the existing budget tests. ThinkingBudget 11/11 pass, SharedSettings 6/6 pass.

Rebased onto the new main after the history cleanup. Replaces #1035.


🔄 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/Niko1221/Strata/pull/1196 **Author:** [@elanonimo832](https://github.com/elanonimo832) **Created:** 10/6/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `feat/shared-thinking-budget-rebased` --- ### 📝 Commits (1) - [`65cda1a`](https://github.com/Niko1221/Strata/commit/65cda1ace3e6bc04192678af3d1a6a1f976a670e) serve: share the thinking budget with other apps, like max_tokens and the effort ### 📊 Changes **2 files changed** (+25 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `serve/server.py` (+8 -2) 📝 `serve/test_server.py` (+17 -0) </details> ### 📄 Description … the effort The Chat settings a client posts to /settings reach every client through `shared`, and `reasoning_effort` and `max_tokens` are among them. The thinking budget (#123) was not, so a client that sets none of its own kept thinking to the ceiling while the Chat settings asked for less. Two changes make it work like the other shared keys: - `reasoning_budget_tokens` joins SHARED_KEYS, validated as a whole number of tokens. 0 keeps its documented meaning ("no budget"), so it is allowed there where seed and max_tokens require > 0. - `Service.run` reads the budget *after* `sampling_defaults` and `shared` are merged into `sampling`. It read it before the merge, so no shared key could ever reach it. The request's own value still wins (an explicit `reasoning_budget_tokens: 0` keeps turning a shared or configured one off), and the config's `reasoning_budget_tokens` stays the fallback. Tests: `test_a_shared_budget_reaches_a_request_that_sets_none` (fails with "1 != 2" on the engine prompts before the change) and `test_a_shared_budget_must_be_a_whole_number_of_tokens`, next to the existing budget tests. ThinkingBudget 11/11 pass, SharedSettings 6/6 pass. Rebased onto the new `main` after the history cleanup. Replaces #1035. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 14:40:28 +07:00
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#3302
No description provided.