Skip to content

vllm.config.reasoning

Classes:

ReasoningConfig

Configuration for reasoning models.

Set reasoning_start_str and reasoning_end_str to the strings used to enter and forcibly terminate reasoning. The end string may include a transition phrase before the parser's natural reasoning end marker. Token IDs are derived automatically by initialize_token_ids.

Methods:

Attributes:

_enabled = field(default=False, init=False, repr=False) class-attribute instance-attribute

Private field indicating whether reasoning token IDs have been initialized. Set to True by initialize_token_ids once token IDs are initialized.

_natural_reasoning_end_token_ids = field(default=None, init=False, repr=False) class-attribute instance-attribute

Token IDs that naturally terminate reasoning, as defined by the parser.

_reasoning_end_token_ids = field(default=None, init=False, repr=False) class-attribute instance-attribute

Private backing field for forced reasoning end token IDs.

_reasoning_start_token_ids = field(default=None, init=False, repr=False) class-attribute instance-attribute

Private backing field for reasoning_start_token_ids. Set by initialize_token_ids. Not intended to be configured directly.

enabled property

Returns True if reasoning is enabled (i.e. if token IDs have been initialized), False otherwise.

natural_reasoning_end_token_ids property

Token IDs that indicate the model naturally ended reasoning.

reasoning_end_str = '' class-attribute instance-attribute

String forced when the thinking budget is exhausted.

reasoning_end_token_ids property

Token IDs forced when the thinking budget is exhausted.

reasoning_parser = '' class-attribute instance-attribute

The name of the ReasoningParser to use for this model.

reasoning_start_str = '' class-attribute instance-attribute

String that indicates the start of reasoning.

reasoning_start_token_ids property

Token IDs derived from reasoning_start_str. Set automatically by initialize_token_ids. Not intended to be configured directly.

initialize_token_ids(model_config)

Initialize reasoning token IDs from strings using the tokenizer.