[PR #1274] [CLOSED] setup: --thinking / --instruct set the sampling every client gets (#1129) #3352

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

📋 Pull Request Information

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

Base: main ← Head: feature/sampling-presets-1129


📝 Commits (1)

  • 2875571 setup, serve: the model card's sampling presets, opt-in (#1129)

📊 Changes

13 files changed (+682 additions, -40 deletions)

View changed files

📝 .gitignore (+1 -0)
📝 docs/AI_SETUP.md (+1 -0)
📝 docs/DETAILS.md (+25 -6)
📝 docs/INSTALL.md (+24 -0)
📝 docs/INTEL.md (+6 -1)
📝 serve/runconfig.py (+39 -0)
📝 serve/server.py (+37 -5)
📝 serve/test_runconfig.py (+62 -1)
📝 setup.py (+139 -22)
📝 sycl/setup_intel.py (+12 -3)
📝 tools/test_setup_config.py (+5 -2)
➕ tools/test_setup_sampling.py (+248 -0)
📝 tools/test_setup_sycl.py (+83 -0)

📄 Description

--thinking / --instruct on setup (or at the start of an installed model, like
--vram-reserve-mib) writes one of the two sampling sets the Qwen3.8-Flash-Next card
recommends into the model's strata-.json "sampling" block. A client that sends
no sampling parameters of its own then gets those numbers instead of silently decoding
greedy.

  • the point: traceability - the numbers in use are written down and named, instead of
    an unnamed "default" the way it was

  • fewer doom loops blamed on the engine: a request that sent no parameters decoded
    greedy (temperature=0) - the most repetition-prone setting - and nothing said so;
    the thinking preset removes that when a flag asks for it, and the numbers are
    visible when a loop still happens

  • writing the block is opt-in (per @DDK00011's review point 1): a run that names no
    flag writes no block, so the default path stays greedy and byte-identical to the
    last release; hand-written numbers are kept unless a flag names otherwise

  • the instruct set's presence_penalty is a no-op inside batch windows
    (docs/BATCHING.md, "Limits (for now)"); the --instruct help and INSTALL.md /
    DETAILS.md say so (review point 2)

  • a start that replaces the block keeps the file as strata-.json.bak; a no-op
    start writes nothing

  • setup's Settings line and the server's start line print the numbers and name the
    preset; a config without the block says requests decode greedily

  • greedy escape hatch: sampling.temperature = 0

  • a "sampling" that is not a set of numbers (a name, a list, a bare value) stops the
    start with a message naming it; a setup run that names a flag replaces such a block
    and says what it replaced, and a run that names no flag says it left it there

  • the Intel Arc path takes it too. sycl/setup_intel.py re-runs setup and then
    rewrites the config for its container paths, and it carried the earlier config's
    sampling back over whatever this run chose: the block setup wrote now wins, and a
    block the new config does not have is still carried.

  • an Intel start runs its own run-<model>.sh with os.execv, so setup's start()
    never ran there and the flags were dropped. The three writes start() makes become
    save_start_settings(cfg_path, cfg, keep), which both call: --thinking /
    --instruct now reach an Intel config, and so do the #179 / #493 keys it saves
    anyway (--host, --api-key, --vram-reserve-mib, --draft-vocab, --no-browser).

Tests: every tools/test_setup_*.py green (test_setup_sampling.py 18,
test_setup_sycl.py 20) except test_setup_engine_hash.py, which fails the same way
on plain main and is fixed in #1510. serve/ unittest discover: 695 run, OK,
11 skipped. No GPU, no network, no model download.


🔄 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/1274 **Author:** [@victorgabr](https://github.com/victorgabr) **Created:** 10/6/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `feature/sampling-presets-1129` --- ### 📝 Commits (1) - [`2875571`](https://github.com/Niko1221/Strata/commit/2875571bd5b7bc14aef12a90debdae63f6ccfa0a) setup, serve: the model card's sampling presets, opt-in (#1129) ### 📊 Changes **13 files changed** (+682 additions, -40 deletions) <details> <summary>View changed files</summary> 📝 `.gitignore` (+1 -0) 📝 `docs/AI_SETUP.md` (+1 -0) 📝 `docs/DETAILS.md` (+25 -6) 📝 `docs/INSTALL.md` (+24 -0) 📝 `docs/INTEL.md` (+6 -1) 📝 `serve/runconfig.py` (+39 -0) 📝 `serve/server.py` (+37 -5) 📝 `serve/test_runconfig.py` (+62 -1) 📝 `setup.py` (+139 -22) 📝 `sycl/setup_intel.py` (+12 -3) 📝 `tools/test_setup_config.py` (+5 -2) ➕ `tools/test_setup_sampling.py` (+248 -0) 📝 `tools/test_setup_sycl.py` (+83 -0) </details> ### 📄 Description `--thinking` / `--instruct` on setup (or at the start of an installed model, like `--vram-reserve-mib`) writes one of the two sampling sets the Qwen3.8-Flash-Next card recommends into the model's strata-<model>.json "sampling" block. A client that sends no sampling parameters of its own then gets those numbers instead of silently decoding greedy. - the point: traceability - the numbers in use are written down and named, instead of an unnamed "default" the way it was - fewer doom loops blamed on the engine: a request that sent no parameters decoded greedy (temperature=0) - the most repetition-prone setting - and nothing said so; the thinking preset removes that when a flag asks for it, and the numbers are visible when a loop still happens - writing the block is opt-in (per @DDK00011's review point 1): a run that names no flag writes no block, so the default path stays greedy and byte-identical to the last release; hand-written numbers are kept unless a flag names otherwise - the instruct set's `presence_penalty` is a no-op inside batch windows (docs/BATCHING.md, "Limits (for now)"); the `--instruct` help and INSTALL.md / DETAILS.md say so (review point 2) - a start that replaces the block keeps the file as strata-<model>.json.bak; a no-op start writes nothing - setup's Settings line and the server's start line print the numbers and name the preset; a config without the block says requests decode greedily - greedy escape hatch: sampling.temperature = 0 - a "sampling" that is not a set of numbers (a name, a list, a bare value) stops the start with a message naming it; a setup run that names a flag replaces such a block and says what it replaced, and a run that names no flag says it left it there - the Intel Arc path takes it too. `sycl/setup_intel.py` re-runs setup and then rewrites the config for its container paths, and it carried the earlier config's `sampling` back over whatever this run chose: the block setup wrote now wins, and a block the new config does not have is still carried. - an Intel start runs its own `run-<model>.sh` with `os.execv`, so setup's `start()` never ran there and the flags were dropped. The three writes `start()` makes become `save_start_settings(cfg_path, cfg, keep)`, which both call: `--thinking` / `--instruct` now reach an Intel config, and so do the #179 / #493 keys it saves anyway (`--host`, `--api-key`, `--vram-reserve-mib`, `--draft-vocab`, `--no-browser`). Tests: every `tools/test_setup_*.py` green (`test_setup_sampling.py` 18, `test_setup_sycl.py` 20) except `test_setup_engine_hash.py`, which fails the same way on plain main and is fixed in #1510. `serve/` unittest discover: 695 run, OK, 11 skipped. No GPU, no network, no model download. --- <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:52 +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#3352
No description provided.