Skip to content

server: model discovery reports the model's reasoning efforts - #819

Merged
ashhart merged 1 commit into
ashhart:mainfrom
kelchm:models-reply-budget-efforts
Oct 16, 2026
Merged

ashhart merged 1 commit into
ashhart:mainfrom
kelchm:models-reply-budget-efforts

Conversation

@kelchm

@kelchm kelchm commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

What this changes

Following #480 and #483, GET /v1/models now also tells a client which reasoning efforts the model takes, so a coding agent can offer the right effort choices without a per-model table.

Why: I point a coding agent at a TensorFold server whose model changes, and its effort picker has to come from a hand-kept table that goes stale with every swap. The levels can't be guessed from outside: Qwen3.8's template takes xhigh, medium and low, GLM-5.3's takes max, high and low, and other values are rounded to the nearest, so a picker offering seven levels is really offering three or four. The server already knows which.

Each entry for a model that thinks gains an OpenRouter-style reasoning object:

{
  "id": "Qwen3.8-Flash-Next",
  "object": "model",
  ...
  "context_length": 1048576,
  "max_model_len": 1048576,
  "reasoning": {
    "default_enabled": true,
    "supported_efforts": ["xhigh", "medium", "low", "none"]
  }
}
  • default_enabled: thinking is on unless the server was started with --no-thinking.
  • default_effort: the --reasoning-effort level, and left out when there is none, so the template picks.
  • supported_efforts: the levels the template names, highest first, plus none when it has a thinking switch.

These describe chat and Responses requests. A request's own chat_template_kwargs.enable_thinking still wins over its effort, as it does today.

The change is in status_routes.zig, plus one field in Server so init reads the thinking switch with the effort levels and discovery never reads the template. It adds four tests and a README paragraph, and updates the model-list goldens, whose bodies and lengths change as they did in #483.

Codex-style clients read supported_reasoning_levels. Would you rather I use those names, or add them alongside? I left input modalities for #565.

Receipt

  • Environment: c126fe16 plus this commit. Host tests ran on an Apple M5 Max, macOS 26.5. The live check ran on two DGX Sparks, CUDA, Qwen3.8-Flash-Next NVFP4, through the MiaAI-Lab two-Spark kit, which builds the engine at db281878.
  • Exactness: no token, scheduling or arithmetic path changes. On the Sparks the kit's exactness gate gave reply and token hashes identical to the unpatched build (520 drafts accepted). Each supported effort, and none sent, came back in the reply's reasoning_effort and enable_thinking as /v1/models advertised.
  • Decode speed before and after: same request bodies, kit replay client, not tools/bench_openai.py. 61.6 tok/s against 61.2 to 62.6 at one stream, and 312.5 against 313 to 317 at sixteen.
  • Prompt speed before and after: not measured; the prompt path is unchanged.
  • Tests run: zig build test -Dcpu=apple_m1, 1170 passed, 0 failed, 8 skipped. zig build test-golden, 309 of 319 equal and 0 unexpected, as on main. tools/zig/lean_check.py, 538, as on main.
  • Not run: the Metal-backed tests, since the test Mac has no Metal compiler, and CUDA on upstream main, since main does not serve two CUDA ranks yet. The Python server is frozen and unchanged.

Checklist

  • Every token still goes through the lane rounds. No serial path, and nothing that needs drafts off.
  • Drafted output equals "draft": false, a resumed prompt equals a fresh one, and concurrent equals solo.
  • No precision traded for speed. If the bits change, the description says which sums change and why.
  • Prompt processing is no slower than the last release.
  • The description says which platforms I ran, Metal M1 to M5 and CUDA, and which I could not.
  • New tests fail before the change, pass after it, and skip cleanly without their dependency.
  • Comments and docstrings are one line. No measurements or history in the source.
  • No personal data, machine names, internal hosts or local paths. No AI attribution lines.

A /v1/models entry for a model whose template has a thinking switch, names effort levels or has a think close token adds an OpenRouter-style reasoning: default_enabled, default_effort when the server was started with one, and supported_efforts from the template's own levels. Init reads the thinking switch with the levels, so discovery does not read the template per request.
@ashhart
ashhart merged commit 9754f0e into ashhart:main Oct 16, 2026
ashhart added a commit that referenced this pull request Oct 16, 2026
Recall (off unless asked for), model discovery's reasoning efforts (#819), the NVFP4 prompt entries' skip (#764) and Nemotron's CUDA decode router, top-k and add_moe_norm (#833), gated on the candidate before Living Weights' key, snapshot and rollback. Two conflicts: the CHANGELOG's Unreleased list, where both sides' lines are kept in landing order, and the server main's imports, where all four are kept.
ashhart added a commit that referenced this pull request Oct 16, 2026
@ashhart

ashhart commented Oct 16, 2026

Copy link
Copy Markdown
Owner

Thank you, @kelchm. An effort picker that comes from the server is the right fix for a table that goes stale on every model swap, and it changes nothing a reply carries.

It ships in TensorFold 1.0.12 under your name (60f27da01), and your head is merged after it with no change to the tree, so this pull request shows as merged. Our 240f4c447 follows: the README says supported_efforts ends with none when the template has a thinking switch and that a template naming no level leaves the field out, and the new lines wrap at 120 columns.

Your four discovery tests and every model-list golden pass on macOS and Linux. Served, GET /v1/models gives Qwen3.8-27B and Qwen3.8-Flash-Next xhigh, medium, low and none; GLM-5.3-Flash max, high and low, with no none since its template has no thinking switch; Nemotron 3.5 Lightning and Qwen3.5-2B only default_enabled. --no-thinking sets default_enabled false and --reasoning-effort low adds default_effort. Replies were the same tokens as before.

We kept the OpenRouter names as you wrote them. If a client you use needs other names beside them, an issue with an example request would help us test it.

Posted by Ash's AI Assistant Synthena

outcastofmusic added a commit to outcastofmusic/TensorFold that referenced this pull request Oct 16, 2026
A coding agent's effort picker can come from the server. A model whose template switches thinking, names effort
levels or has a </think> token carries an OpenRouter-style `reasoning`: default_enabled, default_effort when the
server was started with --reasoning-effort (in the template's names), and supported_efforts, the levels its template
names highest first, then none when the template switches thinking. On the Spark's checkpoints Qwen3.8 Flash Next
lists xhigh, medium, low and none and GLM-5.3 Flash max, high and low, as upstream TensorFold 1.0.12 (ashhart#819) reports.
The template is read once, at startup. No reply changes.

Tests: tests/test_models_reasoning.py.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
BlivionIaG pushed a commit to BlivionIaG/TensorFold that referenced this pull request Oct 20, 2026
BlivionIaG pushed a commit to BlivionIaG/TensorFold that referenced this pull request Oct 20, 2026
The contributor's commit landed above with the same code; this keeps the PR's head in the history with no change to the tree.
BlivionIaG pushed a commit to BlivionIaG/TensorFold that referenced this pull request Oct 20, 2026
…date

Recall (off unless asked for), model discovery's reasoning efforts (ashhart#819), the NVFP4 prompt entries' skip (ashhart#764) and Nemotron's CUDA decode router, top-k and add_moe_norm (ashhart#833), gated on the candidate before Living Weights' key, snapshot and rollback. Two conflicts: the CHANGELOG's Unreleased list, where both sides' lines are kept in landing order, and the server main's imports, where all four are kept.
BlivionIaG pushed a commit to BlivionIaG/TensorFold that referenced this pull request Oct 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants