Module reasoning_parser

Module reasoning_parser 

Source
Expand description

2026-09-26: Split a model’s completed output into reasoning and answer, per reasoning-block format.

The three <think> formats share one implementation and differ only in name; they assume the prompt already opened the block. Mistral uses the same implementation but expects the model to emit its own [THINK]. Gemma 4 has its own parser. At serve time the format comes from the [reasoning] table of tool_defaults.toml, keyed by model_type, and a thinking-capable model without an entry gets qwen (main_modules/serve_phases/tokenizer_runtime.rs).

Owner: server. Invariants: none beyond the types.

Enums§

ReasoningFormat
2026-09-26: Supported reasoning-block formats; the module doc lists each one’s delimiters.

Traits§

ReasoningParser
2026-09-26: Splits reasoning blocks out of completed model output.