Reasoning models on Infercom
The following models support reasoning. Always check Supported models for current availability and regions.reasoning_effortadjusts how muchgpt-oss-120breasons. It cannot switch reasoning off.enable_thinkingturns reasoning on or off forgemma-4-31B-it, which does not reason unless you ask it to.
How reasoning appears in the response
Reasoning-capable models return their chain of thought in a dedicatedreasoning field on the message, separate from the final answer in content:
reasoning for transparency or debugging, and content for the answer you show to users.
content back into the message history - do not feed previous reasoning back into the next turn.Budgeting tokens for reasoning
This is the single most common source of “empty” or “broken” responses from reasoning models. Because the chain of thought is generated first and counts against your token limit, a lowmax_tokens value is consumed by reasoning before any answer is produced.
As a rule of thumb, allow several hundred to a few thousand tokens of headroom beyond the length of the answer you expect, depending on task complexity. For hard math, coding, or planning tasks, reasoning can be long - budget accordingly.
Controlling reasoning
Models with reasoning_effort
gpt-oss-120b accepts a reasoning_effort parameter (low, medium, high) that trades latency and token usage for answer quality. If you omit it, the model uses medium.
gpt-oss-120b. low is the minimum and still produces a short chain of thought. Values such as "none" or "off" are rejected with a 400. If you need a model that answers without reasoning, use gemma-4-31B-it, which has thinking off by default.Models with configurable thinking (enable_thinking)
gemma-4-31B-it has a configurable thinking mode that you turn on or off via chat_template_kwargs. Set enable_thinking to true to have the model reason before answering, or false for a direct answer.
Thinking is off by default. If you omit enable_thinking, the model answers directly and the reasoning field comes back empty - omitting it behaves exactly like setting it to false. You must pass true to get a chain of thought.
chat_template_kwargs inside extra_body, as shown above. When calling the API directly (cURL), include chat_template_kwargs at the top level of the request body.Models that reason by default
MiniMax-M2.7 and the DeepSeek models reason by default - no extra parameter is required. Just send your request and read the reasoning and content fields from the response.
These models do not expose a control for how much they reason. They accept reasoning_effort for OpenAI compatibility, but it does not change their behavior. Budget max_tokens generously instead, as described above.
Troubleshooting: empty or truncated responses
If a reasoning model returns an emptycontent, a response that cuts off mid-sentence, or what looks like raw thinking in the output, the usual cause is an insufficient token budget - not a model defect. A second, less obvious cause is a temperature set well below the publisher’s recommended value, which can send the model into a repetition loop.
Check finish_reason
choices[0].finish_reason in the response. A value of "length" means the model hit your max_tokens limit before it finished. "stop" means it completed normally.Raise max_tokens
finish_reason is "length", increase max_tokens (or max_completion_tokens) and retry. Give the model enough room for both its reasoning and the final answer.Check your temperature if raising max_tokens does not help
usage.completion_tokens_details.reasoning_tokens with your max_tokens. If the reasoning consumes the entire budget again at a higher limit, you are likely in a repetition loop. Raise the temperature towards the value the publisher recommends for that model.Verify the reasoning and content fields
reasoning contains the chain of thought and content contains the final answer. With an adequate budget and a sensible temperature, the two are cleanly separated.Prompting reasoning models
- Keep system prompts minimal. Excessive instructions can constrain the model’s reasoning scope and reduce quality.
- Avoid adding your own “think step by step” chain-of-thought prompting - the model already reasons internally. Use clear, zero-shot or single-instruction prompts.
- Use the sampling parameters the model publisher recommends. They differ per model and are listed under Recommended sampling parameters. For
MiniMax-M2.7the publisher recommendstemperature1.0,top_p0.95, andtop_k40. temperature=1.0does not mean “maximum randomness”. It means the model’s probability distribution is used exactly as trained. Values below 1.0 sharpen it, values above 1.0 flatten it. The Infercom API accepts values from 0 to 2.
Use cases
Report generation
Reasoning models are well suited to processing unstructured information - legal contracts, financial statements, or scientific papers - recognizing patterns across multiple facets of the input before distilling it into a comprehensive summary.Planning for workflows and agents
Reasoning models excel at ambiguous, complex tasks. They can break down intricate problems, strategize solutions, and make decisions over large volumes of uncertain information - making them effective planners and orchestrators in agentic systems.Coding and mathematics
These models are effective at reviewing and improving code, catching subtle issues a quick read might miss, and breaking down math problems into verifiable steps.Best practices
Budget tokens for reasoning
Budget tokens for reasoning
max_tokens. Set the limit high enough for both the chain of thought and the final answer. If responses come back empty or truncated, check finish_reason - a value of "length" means you need to raise max_tokens.Latency and cost
Latency and cost
Streaming
Streaming
stream=True to your request to display tokens as they become available.FAQs
Why do I get an empty or truncated response with finish_reason: length?
Why do I get an empty or truncated response with finish_reason: length?
max_tokens, so the budget can be consumed before any visible answer is produced - raise max_tokens. Second, at a low temperature the model can enter a repetition loop that never terminates - raising max_tokens will not help, and you should move the temperature towards the value the publisher recommends for that model.To tell them apart, check usage.completion_tokens_details.reasoning_tokens. If it exactly equals your max_tokens no matter how high you set the limit, suspect a loop.Which temperature and top_p should I use?
Which temperature and top_p should I use?
temperature=1.0 means the model’s distribution is used exactly as trained rather than “maximum randomness”.What is the difference between reasoning_effort and enable_thinking?
What is the difference between reasoning_effort and enable_thinking?
gpt-oss-120b uses reasoning_effort (low/medium/high) to dial how much it reasons; it defaults to medium and cannot be turned off. gemma-4-31B-it uses chat_template_kwargs: {"enable_thinking": true/false} to turn reasoning on or off; it is off by default. Setting either parameter on a model that does not implement it is accepted and silently ignored, so check the table above before relying on one.How do I turn reasoning off completely?
How do I turn reasoning off completely?
gemma-4-31B-it can answer without reasoning - and it already does so by default, since enable_thinking is off unless you set it. Reasoning cannot be disabled on gpt-oss-120b, MiniMax-M2.7, or the DeepSeek models; reasoning_effort: "none" is not a valid value and returns a 400. The lowest setting available anywhere is reasoning_effort: "low" on gpt-oss-120b, which still produces a short chain of thought.I got a 400 error about maximum context length. Where can I check the limit?
I got a 400 error about maximum context length. Where can I check the limit?
Where are these models hosted?
Where are these models hosted?