Repository navigation
Description
Context
Maple serves eight chat models through OpenSecret, routed to Tinfoil and Continuum (Privatemode). Most of them reason before answering, and each one takes a different set of thinking controls. Today no client can tell from the catalog which thinking levels a model supports: the only thinking field is capabilities.reasoning: bool. A client that guesses gets an HTTP 400 on some models and silently pays for maximum effort on others. On GLM, a "thinking off" control makes the model's reasoning come back as the answer text.
Maple Agent is adopting Pi's thinking-level model: named levels (off, minimal, low, medium, high, xhigh, max), a per-model map from each level to its wire value, and clamping of unsupported levels to the nearest supported one. To do that cleanly, the backend and SDKs first need to publish and accept levels correctly. This issue is that backend and SDK work. It stands on its own and helps every client, including Research and API users. The Agent's UI and runtime integration are separate and come later.
The work has three parts, in order:
- Verify the findings below live on Dev, and check them against the relevant standards (see Verification).
- Settle the decisions.
- Implement the backend and SDK changes in their own PR.
What we found
Researched on 2026-10-06 from public source: vLLM at each deployed version, Tinfoil's and Privatemode's public deployment repositories, vendor READMEs, vLLM's recipes, and Maple at c61712a. Engine versions were read from public container image metadata. No inference was run, so everything here needs live confirmation. A second review re-derived each model's controls from source and found nothing that changes the approach.
Providers and routing
- Tinfoil serves all eight chat models. Continuum also serves
glm-5-3andglm-5-3-flash, and takes 75% of account buckets for them (provider weight 30 × route weight 700, against 70 × 100). - Routes are sticky per account for an hour, and health checks can move an account to the other provider mid-session. A level must therefore mean the same thing on both providers' builds.
- Auto aliases fall back across model families. Paid Quick falls back from
glm-5-3-flashtodeepseek-v4-1-flash, and paid Powerful fromglm-5-3tokimi-k3. One alias request can land on models with different controls. - Both catalog endpoints are built from the static
MODEL_CONFIGStable. The provider field is single-valued, so it does not describe per-route behavior.
Engines
Every chat model runs on vLLM; none runs on SGLang.
| Model | Provider (share) | vLLM build | Confidence |
|---|---|---|---|
gpt-oss-120b, gpt-oss-safeguard-120b |
Tinfoil | 0.22.0 | High |
gemma4-31b |
Tinfoil | 0.25.1, plus patches | High |
kimi-k3 |
Tinfoil | 0.29.0 | High |
glm-5-3 |
Continuum (75%) / Tinfoil (25%) | 0.28.0 / 0.29.0 | Medium-high / High |
glm-5-3-flash |
Continuum (75%) / Tinfoil (25%) | a fork build, 0.1.dev20051+g487ecf187 / vLLM main at 385dce36 |
Medium / High |
deepseek-v4-1-flash |
Tinfoil | a pre-release build, 0.1.dev20904+g179dd0fa9; behavior inferred from the support that shipped in v0.30.0 |
Medium |
llama3-3-70b |
Tinfoil | 0.22.0 | High |
This assumes the latest Tinfoil release tags and Privatemode v1.58.0 are live; that was not verified. The two Medium builds have source commits that are not in public vLLM refs.
What each model does with each control
vLLM 0.22–0.31 accepts a top-level reasoning_effort of none, minimal, low, medium, high, xhigh or max (protocol). It passes the value to the chat template or renderer. Unless the caller set enable_thinking, it also derives enable_thinking = (reasoning_effort != "none") (build_chat_params). What happens next depends on the model:
| Model | reasoning_effort accepted |
Any other effort | none |
Template switch off (enable_thinking: false or thinking: false) |
Nothing sent |
|---|---|---|---|---|---|
| gpt-oss (Harmony) | low, medium, high |
400 | 400 | ignored | medium |
| Gemma 4 | any value but none turns thinking on; no tiers |
— | off | off | off |
| Kimi K3 | low, high, max |
400 | thinking off | thinking off | on, at max |
| GLM-5.3 and GLM-5.3-Flash | low, high, max |
silently max |
reasoning leaks into content |
leaks | max |
| DeepSeek V4.1 Flash | low, high, xhigh, max (25/50/75/100); also 1–100 through template keywords |
400 | chat mode (off) | chat mode (off) | on, at 50 (high) |
| Llama 3.3 | ignored | — | ignored | ignored | no thinking |
Sources: Harmony rejections, Gemma 4 template, Kimi K3 renderer and Moonshot's README, GLM recipe and Z.ai's README, DeepSeek V4.1 encoding.
- The GLM leak. The GLM-5.3 templates have no thinking switch: they always open
<think>and pick effort from aReasoning Effort:header. The deployedglm45/glm47reasoning parser still trustsenable_thinkingandthinking. Any thinking-off control therefore starts the parser in content mode while the model keeps thinking atmax. The reasoning text and</think>then land incontent(parser).- vLLM fixed this in
d95d1dc(PR #56994, 2026-09-29; issue #54744). - The fix is in no release up to v0.31.0, and in neither provider's build.
- Maple's image describer already works around it by sending
lowfor Flash.
- vLLM fixed this in
- GLM's silent
maxrests on Z.ai's README and vLLM's recipes. The deployed checkpoints' templates live on Hugging Face and were not read. - Hidden reasoning still costs.
include_reasoning: falseonly hides reasoning. The model still generates it, and it is still billed. - Budgets.
thinking_token_budgetis accepted where a reasoning parser is configured, and is a 400 on gpt-oss and Llama. Whether it is honored well with these templates is untested. - Effort scales differ between hosts. DeepSeek's own API maps
low/high/maxto 50/75/100, while vLLM mapslow/high/xhigh/maxto 25/50/75/100 (recipe). Level tables published for hosted APIs do not apply to Maple's deployments.
Reasoning output
- vLLM 0.16 and later return reasoning only in
reasoning, on the message and on each delta. - Privatemode's proxy also copies it into
reasoning_content, a field marked deprecated and slated for removal (proxy).`` A client must acceptreasoningalone and must never concatenate the two fields. - OpenSecret passes Chat Completions bodies and chunks through unchanged, apart from
model, the cache salt andstream_options.include_usage. Its Responses path readsdelta.reasoning, thendelta.reasoning_content. - The typed Rust SDK's
ChatMessagehas onlyreasoning_content, so typed non-streaming calls drop Tinfoil's reasoning. - vLLM builds from 0.28 on report
completion_tokens_details.reasoning_tokenswhen a reasoning parser is configured. The 0.22.0 and 0.25.1 builds do not.
What Maple does today
- Maple Agent sends thinking controls only for Gemma: on for primary turns, off for auxiliary calls. Every other model runs at its default, so GLM and Kimi K3 run at
max, compaction included. - The Responses API (Research) adds per-model template keywords: Gemma on,
clear_thinkingfor GLM,preserve_thinkingfor K3. It has no reasoning parameter, so a client'sreasoning: {effort}is silently dropped. - The image describer sets explicit per-model controls:
lowfor Flash, off for Gemma and K3. - The Maple proxy forwards the caller's body as is.
Pi's level model, the first consumer
- Each model has a
thinkingLevelMap. A string is the wire value, andnullmarks a level as unsupported.xhighandmaxare opt-in: they need an explicit entry. - An unsupported level clamps upward first, then downward. Pi's default level is
medium. - On an OpenAI-compatible endpoint, Pi sends
reasoning_effortwith the mapped value. Foroffit sends the map'soffvalue only if it is a string; otherwise it sends nothing. - Without per-model maps, Pi would send
medium: a 400 on K3 and DeepSeek, and silentlymaxon GLM. Maple has to publish the data that builds these maps. - Pi runs compaction at the session's level, and on this path reasoning shares
max_tokenswith the answer. A small output cap atmaxeffort can end before the answer.
Requirements
- Discoverable levels.
- The catalog states, for each model:
- which levels it supports;
- what it does when nothing is sent;
- the wire value of each level, where it differs from the level's name.
- Aliases state which levels they accept.
- The catalog also publishes each model's maximum output tokens.
capabilities.reasoningstays for older clients.
- The catalog states, for each model:
- One request control. Top-level
reasoning_efforton Chat Completions, andreasoning.efforton Responses, are the supported ways to choose a level. Template keywords such asenable_thinkingandthinkingare not part of the contract. - Validated per resolved model and route. OpenSecret checks the level after alias resolution, against every route that may serve it. A level then means the same thing on both providers and across Auto fallbacks.
- Safe on GLM. No thinking-off control reaches a GLM build without the parser fix.
- Consistent output. Reasoning comes back in a documented field, and Continuum's duplicate
reasoning_contentis handled on purpose. - SDKs. The Rust and TypeScript SDKs model the new catalog fields, and the Rust
ChatMessagereadsreasoning. Both SDKs are released. - Standard where a standard exists.
- Request, response and error shapes follow OpenAI's API wherever OpenAI defines them.
- Anything Maple adds is documented as an extension, citing prior art where it exists.
- Verified live. Every model, route and level is verified on Dev before release, and again after.
Likely approach
To confirm through verification:
| Model | Levels to publish | Default when nothing is sent | Wire values |
|---|---|---|---|
| gpt-oss, gpt-oss-safeguard | low, medium, high |
medium |
the level names |
| Gemma 4 | off and on | off | off → none, on → high |
| Kimi K3 | low, high, max; off is decision 2 |
max |
the level names; off → none if exposed |
| GLM-5.3, GLM-5.3-Flash | low, high, max; no off |
max |
the level names |
| DeepSeek V4.1 Flash | off, low, high, xhigh, max |
high (effort 50) |
the level names; off → none |
| Llama 3.3 | none (reasoning: false) |
— | — |
auto:quick and auto:powerful (paid) |
low, high, max |
— | translated per resolved model |
auto:quick (free) |
low, medium, high |
medium |
the level names |
Every wire value equals its level's name, except off → none. A possible catalog shape, with field names still open:
{
"id": "glm-5-3",
"capabilities": { "chat": true, "vision": false, "reasoning": true, "tool_use": true },
"max_output_tokens": 131072, // illustrative value
"thinking": {
"levels": ["low", "high", "max"], // ordered from lowest to highest
"default": "max", // what the model does when nothing is sent
"parameter": "reasoning_effort",
"values": { "low": "low", "high": "high", "max": "max" },
"response_field": "reasoning"
}
}What likely works:
- top-level
reasoning_effort, the one control every deployed build honors; - one catalog entry per model, carrying its levels;
- validation in OpenSecret per resolved model and route;
- aliases that publish only the levels all their possible targets support.
What likely doesn't work:
- Template keywords as the client contract (
chat_template_kwargs.enable_thinking,thinking). They trigger the GLM leak, and gpt-oss ignores them. - DeepSeek- and Z.ai-style
thinking: {type: ...}objects. vLLM ignores them. include_reasoning: falseto save cost. It only hides the reasoning.- Separate thinking and non-thinking model IDs.
- A level change would become a model change.
- Each ID would need its own routes.
- Pi turns reasoning from a different model into plain text.
- Token budgets. They are untested; leave them out until verified.
- Hosted-API level tables (DeepSeek's API, Fireworks, Baseten). Their mappings differ from Maple's deployments.
Decisions to make
The recommendations below are open to change from the verification results.
- An unsupported level on an explicit model: reject or clamp?
- Recommendation: reject with a 400, as OpenAI does for unsupported values; the standards check should confirm this. Pi clamps on the client, so the Agent never sends one.
- For Auto aliases, translate to the resolved model's nearest supported level, so a fallback never fails mid-task.
- Kimi K3's off. Recommendation: leave it out of the catalog, since Moonshot documents K3 as always thinking. Maple's own side calls may still use it, as the image describer does.
- Defaults. Publish each model's own default. Whether to also publish a Maple-recommended level per model is an open product question.
- The duplicate
reasoning_content. Pass it through as is, or normalize responses toreasoningonly. - Per-route engine metadata.
- Record each route's engine, version, checkpoint and last verification date, so drift is visible. Tinfoil ships new model releases without any Maple change.
- Optionally, a route that lacks a requested level drops out of eligibility.
- Levels in the Research UI. A follow-up issue, once Responses accepts
reasoning.effort.
Verification
Two independent agents should do this before the decisions are locked, and post their reports on this issue or commit them with the PR.
A. Live verification against Dev
Call the real API on Dev, never production, and record what actually happens.
- Matrix. Cover every combination of:
- every chat model, and each GLM model on both providers;
- every control: nothing sent, each of the seven
reasoning_effortvalues, and both template switches off; - streaming and non-streaming;
- at least one turn with a tool call, and one multi-turn case that replays earlier reasoning.
- Record per cell:
- the HTTP status and the error body's shape;
- which fields carry reasoning:
reasoning,reasoning_contentorcontent; - whether reasoning text or
</think>appears incontent; usage.completion_tokensandcompletion_tokens_details.reasoning_tokens;finish_reasonunder a smallmax_completion_tokens, since reasoning counts against it.
- Also check:
- which levels survive an Auto fallback;
- whether each model accepts the
developerrole; - whether
thinking_token_budgetis accepted, and whether it actually bounds reasoning; reasoning.efforton the Responses API, which is expected to be dropped today;- which provider releases are live. Tinfoil's router publishes each model's release tag at
/.well-known/tinfoil-proxy; Privatemode's is its release version.
- Routes. The GLM models must be exercised on both providers. Find a safe way to reach each route, for example test accounts in different routing buckets. Do not add a route override reachable in production without review.
- Hygiene.
- Use synthetic prompts only.
- Record statuses, field presence and token counts, not full responses.
- Never record keys, tokens or account identifiers.
- Keep token use small.
- Re-run the same matrix on Dev after the change lands.
B. Standards check
Compare every field Maple sends, returns or publishes against the published specifications:
- OpenAI Chat Completions:
reasoning_effort: its values, per-model support, and the error for an unsupported value;max_completion_tokens;- the
developerrole; usage.completion_tokens_details.reasoning_tokens.
- OpenAI Responses:
reasoning.effortandreasoning.summary;- reasoning output items and their streaming events;
usage.output_tokens_details.reasoning_tokens.
- The error format for unsupported parameters and values.
- Reasoning text from OpenAI-compatible servers, which OpenAI does not define: vLLM's
reasoning, DeepSeek'sreasoning_content, OpenRouter'sreasoning, and any others in common use. - Model-capability metadata:
- what OpenAI's
/v1/modelsexposes; - prior art for publishing supported levels, such as OpenRouter's
supported_parameters.
- what OpenAI's
The output is a table of every field: whether it is an OpenAI standard, a de-facto convention or a Maple extension, with a source link and a recommendation. Flag every place where this issue's proposal invents a shape that a standard or common convention already covers.
Acceptance criteria
- Report A (live verification) and report B (standards) are posted, and the decisions above are recorded.
- Catalog:
- Each model publishes its thinking metadata and maximum output tokens, generated from one per-model table.
- Each alias publishes only the levels all its possible targets support.
-
capabilities.reasoningis unchanged.
- Chat Completions:
-
reasoning_effortis validated per resolved model and route, with the agreed reject or clamp behavior. - Thinking-off controls never reach GLM.
- Tests cover every model's accepted and rejected values, and alias fallback.
-
- Responses: accepts
reasoning.effort, validates it the same way and passes it into the built request, with tests. - Reasoning output: the field is documented, and the
reasoning_contentdecision is implemented. - SDKs:
- The Rust SDK gains the catalog types and
ChatMessage.reasoning. - The TypeScript SDK gains the catalog types.
- Both SDKs are released, or their releases are prepared.
- The Rust SDK gains the catalog types and
- Docs: the API documentation covers thinking levels.
- Re-verification: the live matrix is re-run on Dev after the change.
Non-goals
- Maple Agent's thinking UI and its runtime integration. Those are separate and come later.
- Thinking controls in the Research UI (a follow-up).
- Token budgets (
thinking_token_budget), until they are verified. - Changing provider weights, routing or the order of Auto candidates.
- Separate thinking and non-thinking model IDs.
- Upgrading providers' vLLM builds. Asking Tinfoil and Edgeless to pick up vLLM
d95d1dcis worth doing, but is tracked outside this issue.
Current implementation references
Line references are at c61712a; re-check them on current master.
- Catalog:
- Routing:
- Chat Completions forwarding:
web/openai.rs. - Responses:
- the per-model template keywords;
ResponsesCreateRequest;``- the image describer's controls.``
- SDKs:
- Rust
CatalogModelandChatMessage; - TypeScript
ModelCatalogItem.
- Rust
- Maple Agent today:
- the Gemma-only toggle;``
- it pins
maple-sdk = "=4.0.1". Bumping the pin belongs to the Agent work.
Activity
Publish and validate per-model thinking levels
Publish and validate per-model thinking levels (#1087) (#1089)