Skip to contents

Every LLM call this package makes is a bounded, structured-extraction task over text already given in the prompt (classify a file, extract a variable's label, list the scales named in ~30 sentences, group files by study) – pattern-matching over given material, not multi-step reasoning (no arithmetic, no multi-hop inference, no planning). A "thinking"/ "reasoning" model spending extra tokens re-deriving what the prompt already states is close to pure overhead here: it inflates cost/latency and eats into the same max_tokens budget as the visible answer, which is a confirmed real cause of truncated structured responses on gpt-oss models via Groq. Minimal reasoning effort is the right DEFAULT for what this package does, not a tradeoff against quality.

Usage

llm_reasoning(effort = NULL)

Arguments

effort

one of "low", "medium", "high", "none", or NULL to read the current value without changing it. Default recommendation for this package's own calls is "low" (or "none" where the model family supports fully disabling reasoning).

Value

the current default reasoning effort (invisibly when setting)

Details

There is no single universal "reasoning" switch across providers – this is genuinely per model family, each verified rather than assumed:

  • openai/gpt-oss-* (Groq or any OpenAI-compatible host): the reasoning_effort chat-completion parameter, accepting "low", "medium", or "high" – "low" is the minimum; there is no full-off option for this family (verified against Groq's own docs).

  • qwen3*-family models: also reasoning_effort, but accepting "none" or "default" – "none" fully disables reasoning tokens, unlike gpt-oss.

  • Mistral's reasoning-capable models (mistral-small-latest, mistral-medium-3-5): also reasoning_effort, but with only TWO values, "high" (full thinking chunk) or "none" (thinking chunk omitted) – verified against Mistral's own docs, a third distinct shape from both gpt-oss and qwen3.

  • Ollama-hosted reasoning models (DeepSeek-R1, Qwen3, ...): the native API's boolean think (llm() already sends this as a /nothink system-prompt prefix over Ollama's native /api/chat endpoint when think = FALSE, since Ollama's OpenAI-compatible /v1/ endpoint ignores it) – a genuinely different mechanism (a flag on the request, not a graded effort level), so llm_reasoning()'s "low"/ "none" both map to think = FALSE for this family; there is no Ollama equivalent of "medium"/"high" to request.

A model family with none of the above (a plain non-reasoning model, or one not yet covered here) is left untouched: llm_reasoning() never forces an unsupported parameter onto a call, since providers vary in whether an unrecognised parameter is silently ignored or rejected outright.

Examples

old <- options(metacheck.llm_reasoning = NULL)
llm_reasoning("low")
llm_reasoning()
#> [1] "low"
options(old)