翻篇收录说明
翻篇网页快照

Reasoning - Cerebras Inference

https://inference-docs.cerebras.ai/capabilities/reasoning

最近抓取:2026-12-04 03:13:37(北京时间)

最近内容变化:2026-12-01 00:28:45(北京时间)

这是最近一次有效抓取的文本快照,不含网页脚本、图片和动态交互内容。实际网页可能已更新。

访问原网页

页面简介

Set reasoning effort, choose a response format, and manage reasoning across conversation turns.

正文摘录

Reasoning models generate intermediate thinking tokens before their final answer. Use reasoning_effort to select a model’s reasoning level and reasoning_format to control how the API returns its reasoning. Reasoning tokens count toward max_completion_tokens and the completion-token usage reported by the API. Effort levels select model-specific reasoning modes; they don’t reserve or guarantee an exact token budget. Supported models The following models support reasoning. Select a model to see its supported effort levels and an example request. ModelDefault effortAvailabilityQwen 3.8 27BhighShared and Dedicated InferenceKimi K2.7 CodeNot configurableDedicated InferenceKimi K3maxDedicated InferenceKimi K3.1 PromaxDedicated InferenceGLM 5.3 FlashmaxDedicated InferenceGPT OSS 120BmediumShared and Dedicated InferenceGemma 4 31Bnone (disabled)Dedicated Inference For Shared Inference, use the model ID listed in the model catalog. For Dedicated Inference, use the endpoint ID assigned to your organization as the request’s model value. Send a reasoning request Install the Cerebras Python SDK and set CEREBRAS_API_KEY as described in the Quickstart. This example selects medium effort for GPT OSS 120B and prints the reasoning separately from the final answer. from cerebras.cloud.sdk import Cerebras client = Cerebras() response = client.chat.completions.create( model="gpt-oss-120b", messages=[ {"role": "user", "content": "Review this retry policy: retry failed jobs immediately."} ], reasoning_effort="medium", reasoning_format="parsed", ) print("Reasoning:", response.choices[0].message.reasoning) print("Answer:", response.choices[0].message.content) For streaming responses, read reasoning from choices[0].delta.reasoning and final-answer text from choices[0].delta.content. The remaining Python examples reuse client. In Dedicated Inference examples, replace YOUR_ENDPOINT_ID with your assigned endpoint ID for that model. Reasoning format Use reasoning_format to select how the API returns reasoning. Support varies by model. ValueBehaviorparsedReturns reasoning in choices[0].message.reasoning and the final answer in choices[0].message.contentrawIncludes reasoning in the final-answer content when supportedhiddenOmits reasoning text while still generating and counting reasoning tokensnoneUses the model’s default response format The following table summarizes format support. A value of none for reasoning_format doesn’t disable reasoning. To disable reasoning on a model that supports it, use reasoning_effort="none". ModelDefault response behaviorrawhiddenQwen 3.8 27BReasoning returned separatelyKeeps reasoning separateNot supportedKimi K2.7 CodeparsedSupportedNot supportedKimi K3parsedNot supportedNot supportedKimi K3.1 ProparsedNot supportedNot supportedGLM 5.3 FlashparsedSupportedSupportedGPT OSS 120BparsedSupportedSupportedGemma 4 31BReasoning disabled until enabledNot supportedNot supported Model behavior Each section lists the model’s reasoning effort values, shows an example request, and describes its format restrictions. Qwen 3.8 27B qwen-3.8-27b enables reasoning by default. Use reasoning_effort to select one of the following modes. ValueBehaviornoneDisables reasoninglowSelects Qwen’s low reasoning modemediumSelects Qwen’s medium reasoning modehigh (default)Selects Qwen’s native xhigh reasoning mode This example selects high effort. To disable reasoning, set reasoning_effort to none. response = client.chat.completions.create( model="qwen-3.8-27b", messages=[ {"role": "user", "content": "Review this retry policy: retry failed jobs immediately."} ], reasoning_effort="high", reasoning_format="parsed", ) Response format: Reasoning is returned separately in message.reasoning or streaming delta.reasoning. Setting reasoning_format to raw doesn’t change this behavior. The hidden format isn’t supported. Conversation history: Use clear_thinking to preserve or remove historical assistant reasoning. See Multi-turn reasoning. Do not send Qwen-native parameters such as disable_reasoning, enable_thinking, preserve_thinking, or thinking_budget. Use reasoning_effort and clear_thinking instead. Kimi K2.7 Code kimi-k2.7-code always enables reasoning. The API accepts reasoning_effort for client compatibility but ignores its value. ValueBehaviorOmittedKeeps reasoning enabledAny accepted value, including noneKeeps reasoning enabled; doesn’t change reasoning effort This example requests parsed reasoning and omits reasoning_effort because it has no effect. response = client.chat.completions.create( model="YOUR_ENDPOINT_ID", messages=[ {"role": "user", "content": "Review this retry policy: retry failed jobs immediately."} ], reasoning_format="parsed", ) Response format: The default is parsed. The raw format is supported; hidden isn’t supported. Conversation history: clear_thinking isn’t implemented. Do not send it. Do not combine reasoning_format="raw" with response_format types json_object or json_schema for Kimi K2.7 Code. Kimi K3 kimi-k3 always enables reasoning. Use reasoning_effort to select one of the following levels. ValueBehaviorlowSelects low reasoning efforthighSelects high reasoning effortmax (default)Selects maximum reasoning effortmedium, noneNot supported This example selects high effort and parsed reasoning. response = client.chat.completions.create( model="YOUR_ENDPOINT_ID", messages=[ {"role": "user", "content": "Review this retry policy: retry failed jobs immediately."} ], reasoning_effort="high", reasoning_format="parsed", ) Response format: Only parsed is supported. Omit reasoning_format or set it to parsed. Do not send raw or hidden. Conversation history: Replay the complete assistant response, including reasoning and tool calls. Kimi K3 preserves reasoning history. Do not send clear_thinking. Kimi K3.1 Pro kimi-k3.1-pro always enables reasoning. Use reasoning_effort to select one of the following levels. ValueBehaviorlowSelects low reasoning effortmediumSelects medium reasoning efforthighSelects high reasoning effortmax (default)Selects maximum reasoning effortnoneNot supported This example selects medium effort and parsed reasoning. response = client.chat.completions.create( model="YOUR_ENDPOINT_ID", messages=[ {"role": "user", "content": "Review this retry policy: retry failed jobs immediately."} ], reasoning_effort="medium", reasoning_format="parsed", ) Response format: Only parsed is supported. Omit reasoning_format or set it to parsed. Do not send raw or hidden. Conversation history: Replay the complete assistant response, including reasoning and tool calls. Kimi K3.1 Pro preserves reasoning history. Do not send clear_thinking. GLM 5.3 Flash zai-glm-5.3-flash always enables reasoning. Use reasoning_effort to select one of the following levels. ValueBehaviorlowSelects low reasoning efforthighSelects high reasoning effortmax (default)Selects maximum reasoning effortmedium, noneNot supported This example selects high effort and parsed reasoning. response = client.chat.completions.create( model="YOUR_ENDPOINT_ID", messages=[ {"role": "user", "content": "Review this retry policy: retry failed jobs immediately."} ], reasoning_effort="high", reasoning_format="parsed", ) Response format: The default is parsed. Both raw and hidden are supported. The hidden format omits reasoning text while the model still generates and counts reasoning tokens. Conversation history: Use clear_thinking to preserve historical assistant reasoning or remove reasoning before the latest user message. See Multi-turn reasoning. GPT OSS 120B gpt-oss-120b always enables reasoning. Use reasoning_effort to select one of the following levels. ValueBehaviorlowSelects low reasoning effortmedium (default)Selects medium reasoning efforthighSelects high reasoning effortnoneNot supported This example selects medium effort and parsed reasoning. response = client.chat.completions.create( model="gpt-oss-120b", messages=[ {"role": "user", "content": "Review this retry policy: retry failed jobs immediately."} ], reasoning_effort="medium", reasoning_format="parsed", ) Response format: The default is parsed. Both raw and hidden are supported. With raw, reasoning and final-answer content are concatenated without separators. Gemma 4 31B gemma-4-31b disables reasoning by default. Use reasoning_effort to enable or disable reasoning. ValueBehaviornone (default)Disables reasoninglow, medium, highEnables reasoning; all three values behave equivalently This example enables reasoning with medium effort and requests parsed reasoning. response = client.chat.completions.create( model="YOUR_ENDPOINT_ID", messages=[ {"role": "user", "content": "Review this retry policy: retry failed jobs immediately."} ], reasoning_effort="medium", reasoning_format="parsed", ) Response format: The raw and hidden formats aren’t supported. Conversation history: clear_thinking isn’t supported. Do not send it. Multi-turn reasoning and clear_thinking Chat Completions is stateless. Resend conversation history with each request, including any assistant reasoning and tool calls required by the model. For tool calls, include the full assistant response followed by a matching result for each tool-call ID. See Tool Calling. For Qwen 3.8 27B and GLM 5.3 Flash, clear_thinking controls whether the model receives historical assistant reasoning. It doesn’t remove the assistant’s final-answer content. Modelfalse or omitted (default)trueQwen 3.8 27BPreserves historical assistant reasoningRemoves historical assistant reasoningGLM 5.3 FlashPreserves historical assistant reasoningRemoves assistant reasoning before the latest user message This example makes a Qwen request, includes its reasoning in the conversation history, and removes that reasoning from the follow-up prompt with clear_thinking=True. To preserve the reasoning instead, omit clear_thinking or set it to False. messages = [{"role": "user", "content": "Design a retry strategy for a payment queue."}] first = client.chat.completions.create( model="qwen-3.8-27b", mes