Skip to main content
SGLang supports parsing reasoning content out from “normal” content for reasoning models such as DeepSeek R1.

Supported Models & Parsers

ModelReasoning tagsParserNotes
Apertus 2509 models<|inner_prefix|><|inner_suffix|>apertus2509Supports enable_thinking parameter
DeepSeek‑R1 series<think></think>deepseek-r1Supports all variants (R1, R1-0528, R1-Distill)
DeepSeek‑V3 series<think></think>deepseek-v3Including DeepSeek‑V3.2. Supports thinking parameter
Standard Qwen3 models<think></think>qwen3Supports enable_thinking parameter
Qwen3-Thinking models<think></think>qwen3 or qwen3-thinkingAlways generates thinking content
Kimi K2 Thinking◁think▷◁/think▷kimi_k2Uses special thinking delimiters. Also requires --tool-call-parser kimi_k2 for tool use.
GPT OSS&lt;|channel|&gt;analysis&lt;|message|&gt;&lt;|end|&gt;gpt-ossN/A

Model-Specific Behaviors

Apertus 2509:
  • Uses <|inner_prefix|> and <|inner_suffix|> to delimit reasoning content. For agentic tool use, also specify --tool-call-parser apertus2509.
DeepSeek-R1 Family:
  • DeepSeek-R1: No <think> start tag, jumps directly to thinking content
  • DeepSeek-R1-0528: Generates both <think> start and </think> end tags
  • Both are handled by the same deepseek-r1 parser
DeepSeek-V3 Family:
  • DeepSeek-V3.1/V3.2: Hybrid model supporting both thinking and non-thinking modes, use the deepseek-v3 parser and thinking parameter (NOTE: not enable_thinking)
Qwen3 Family:
  • Standard Qwen3 (e.g., Qwen3-2507): Use qwen3 parser, supports enable_thinking in chat templates
  • Qwen3-Thinking (e.g., Qwen3-235B-A22B-Thinking-2507): Use qwen3 or qwen3-thinking parser, always thinks
Kimi K2:
  • Kimi K2 Thinking: Uses special ◁think▷ and ◁/think▷ tags. For agentic tool use, also specify --tool-call-parser kimi_k2.
GPT OSS:
  • GPT OSS: Uses special <|channel|>analysis<|message|> and <|end|> tags

Usage

Launching the Server

Specify the --reasoning-parser option.
Example
Note that --reasoning-parser defines the parser used to interpret responses.

OpenAI Compatible API

Using the OpenAI compatible API, the contract follows the DeepSeek API design established with the release of DeepSeek-R1:
  • reasoning_content: The content of the CoT.
  • content: The content of the final answer.
Example

Non-Streaming Request

Example

Streaming Request

Example
Optionally, you can buffer the reasoning content to the last reasoning chunk (or the first chunk after the reasoning content).
Example
The reasoning separation is enable by default when specify . To disable it, set the separate_reasoning option to False in request.
Example

SGLang Native API

Example
Example

Offline Engine API

Example
Example

Supporting New Reasoning Model Schemas

For future reasoning models, you can implement the reasoning parser as a subclass of BaseReasoningFormatDetector in python/sglang/srt/reasoning_parser.py and specify the reasoning parser for new reasoning model schemas accordingly.