Thinking Level
The thinking_level setting is a provider-scoped preference (auto, none, minimal, low, medium, high, xhigh) configured in /config > Models > Text Samplers & Parameters or /personal config. The UI labels xhigh as Extra high. Provider helpers in thinkingControl.ts translate the preference into each API’s fields and accepted values; providers without request-side controls remain unaffected.
Stored in saved_provider_configs.thinking_level and user_saved_provider_configs.thinking_level, the setting defaults to auto and restores automatically when switching active providers.
Shared semantics and overrides
Section titled “Shared semantics and overrides”TomoriBot interprets thinking levels before converting them to vendor fields:
| Level | Intended behavior |
|---|---|
auto | Follows the provider or model default behavior. |
none | Disables thinking if supported; otherwise selects the provider’s lowest safe setting. |
minimal | Requests the lowest enabled reasoning effort. |
low | Requests light reasoning effort. |
medium | Requests balanced reasoning effort. |
high | Requests deep reasoning effort. |
xhigh | Requests effort above high where supported, using the provider’s native name; otherwise retains the existing high ceiling or on/off control. |
Dynamic request overrides
Section titled “Dynamic request overrides”When a turn sets forceReason = true (such as invoking /respond with reasoning enabled), TomoriBot upgrades an effective level of auto or none to high for that individual generation request. The stored configuration row remains unmodified.
Numeric budget defaults
Section titled “Numeric budget defaults”For providers accepting numeric token budgets rather than named effort strings, TomoriBot maps non-empty levels using defaults from src/utils/provider/thinkingControl.ts:
low: 1,024 tokens (DEFAULT_LOW_BUDGET_TOKENS)medium: 4,096 tokens (DEFAULT_MEDIUM_BUDGET_TOKENS)high: 8,192 tokens (DEFAULT_HIGH_BUDGET_TOKENS)
minimal requests one token before model-specific minimums apply. xhigh retains the existing high budget for the Google 2.5 path.
Provider mappings and runtime constraints
Section titled “Provider mappings and runtime constraints”Google / Vertex
Section titled “Google / Vertex”Gemini behavior branches by model family:
- Gemini 2.5: Maps to numeric
thinkingBudget.autosends-1.nonesends0for Flash models and clamps to128for Pro models (which cannot disable thinking). Flash-Lite clamps upward to512. - Gemini 3 / 3.1: Maps to enum
thinkingLevel(MINIMAL,LOW,MEDIUM,HIGH).autoomits the configuration.noneandminimalmap toMINIMALonly for Flash releases known to accept it (an allow-list inthinkingControl.ts) and toLOWeverywhere else, because Pro models and Gemini 3.7 Flash onward rejectMINIMALwhile every Gemini 3 model acceptsLOW. xhighusesHIGHon the Gemini 3 path; no unsupported enum is sent.- Assistant prefill interaction: Gemini suppresses internal thought tags when continuing assistant prefills, emitting reasoning tokens directly into visible response text. The prefill resolver (
resolvePrefillBlockerinsrc/utils/chat/assistantPrefill.ts) permits server prefills on Gemini only when thinking resolves tothinkingBudget: 0orthinkingLevel: MINIMAL.
Anthropic
Section titled “Anthropic”Claude models listed in the profile table in thinkingControl.ts map to adaptive thinking. Each family rejects another family’s off switch with HTTP 400, so an unlisted model receives no thinking fields until its profile is added:
auto:thinking: { type: "adaptive" }low/medium/high:thinking: { type: "adaptive" }paired withoutput_config: { effort }minimaluses low effort.xhighuses the profile’s acceptedoutput_config.effort:xhighon newer families, ormaxon the 4.6 families and Mythos Preview. Anthropic documents different supported effort levels by model; the existing profile table owns this mapping.none:thinking: { type: "disabled" }on most models. Sonnet 5.5 uses{ type: "between_tools" }instead, and Opus 5.5 and Fable cannot stop thinking, so they get adaptive thinking ateffort: "low".temperatureandtop_pare omitted whenever thinking is on. Opus 4.7 and later, Sonnet 5 and later, and Haiku 5.5 reject them in every mode, so those models never receive them.
OpenRouter
Section titled “OpenRouter”Maps directly to OpenRouter’s reasoning effort parameter:
auto: Omitsreasoning.none:reasoning: { effort: "none" }.low/medium/high/xhigh:reasoning: { effort };minimaluses low.
OpenRouter accepts xhigh in its unified reasoning interface. Its routed model and provider determine the available reasoning controls.
DeepSeek
Section titled “DeepSeek”- Expression initialization: Disables thinking so classification output does not compete with reasoning for the response budget.
- Thinking toggle: V4 models (
deepseek-flashand its aliased codenames,deepseek-v4-pro) think at high effort when the switch is omitted, soautokeeps that default andnonesendsthinking: { type: "disabled" }.low,medium, andhighsendthinking: { type: "enabled" }with a matchingreasoning_effort(DeepSeek foldsmediumintohigh). The retireddeepseek-chatanddeepseek-reasonercodenames are sent asdeepseek-flashand follow the same mapping. - Extra-high effort: Sends
reasoning_effort: "max"with thinking enabled. DeepSeek’s effort mapping aliases a nativexhighrequest tohigh, so sendingmaxis required to reach its higher tier.minimaluses low effort. - Tool replay constraint: When thinking is enabled, DeepSeek returns HTTP 400 if a replayed assistant tool-call turn omits
reasoning_content. TomoriBot enforces the presence of this key (requiresReasoningContentReplay), supplying an empty string fallback ("") when no reasoning was captured. - Degradation ladder protection: Parameter degradation lists
thinkinginmandatoryBodyKeysfor DeepSeek, preventing the adapter from dropping thinking while retaining tools (which would produce tool responses that cannot be replayed).
Z.ai / Z.ai Coding
Section titled “Z.ai / Z.ai Coding”Maps to Z.ai’s thinking flag:
auto: Omitsthinking.none:thinking: { type: "disabled" }.minimal/low/medium/high/xhigh:thinking: { type: "enabled" }; these levels do not select distinct budgets.- Temperature and penalty parameters are omitted when thinking is active.
Custom endpoints
Section titled “Custom endpoints”autoomits thinking controls.- Ollama: A hostname containing
ollamaor port11434selects the booleanthinkfield.nonesendsfalse; every other explicit level sendstrue. - Other OpenAI-compatible endpoints, including CLIProxyAPI: Receive
reasoning_effortfor explicit levels.minimalmaps tolow;none,low,medium,high, andxhighpass through. The endpoint must support the requested value; TomoriBot does not infer its upstream model’s effort capabilities.
The streaming and structured-output custom transports use the same helper. CLIProxyAPI model-name overrides such as (medium) take precedence over the body field, so use an unmodified model ID when TomoriBot should control effort.
NVIDIA NIM
Section titled “NVIDIA NIM”NIM serves diverse model families behind one interface. Because different architectures read different parameters, non-auto levels send multi-switch payloads:
chat_template_kwargs: { enable_thinking: boolean, thinking: boolean }reasoning_effort: "low" | "medium" | "high"nonesendsreasoning_effort: "low"rather than"none"because NIM rejects"none"with HTTP 400 on gpt-oss and Llama.minimalmaps to low andxhighmaps to high, retaining this adapter’s supported effort range.
NovelAI
Section titled “NovelAI”The active profile sets the default: GLM 4.6 enables thinking for auto, while Xialong disables it.
none disables thinking on both; minimal, low, medium, high, and xhigh enable it without distinct effort
budgets. The per-request forceReason override also applies.
GLM represents disabled thinking with /nothink and enabled thinking with <think></think> in its
chat template. Xialong appends /nothink to user turns and closes its assistant thinking block when
thinking is disabled; when enabled, it opens <think> for generation. Kayra and Erato use story
templates and ignore the saved thinking level. No NovelAI text model calls tools.
Response parsing and privacy
Section titled “Response parsing and privacy”- Response parsing: For models outputting thinking tokens (such as Gemma 4 on KoboldCPP),
GemmaThinkingParserstrips thought blocks fromdelta.contentand routes them to thoughts before tool parsing runs. - Thought log suppression: Thought logs are suppressed in channels governed by channel rules.
Source pointers
Section titled “Source pointers”src/constants/thinkingLevels.ts: Thinking level values and localization keys.src/utils/provider/thinkingControl.ts: Provider mapping implementations (buildGoogleThinkingConfig,buildAnthropicThinkingRequest).src/utils/chat/assistantPrefill.ts: Assistant prefill gating against thinking states (resolvePrefillBlocker).src/providers/deepseek/deepseekStreamAdapter.ts: replay policy and mandatory thinking field.src/providers/openaiCompatible/openaiCompatibleMessageBuilder.ts:reasoning_contenthistory replay.