vllm.config.reasoning ¶
Classes:
-
ReasoningConfig–Configuration for reasoning models.
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:
-
initialize_token_ids–Initialize reasoning token IDs from strings using the tokenizer.
Attributes:
-
enabled(bool) –Returns True if reasoning is enabled (i.e. if token IDs have been
-
natural_reasoning_end_token_ids(list[int] | None) –Token IDs that indicate the model naturally ended reasoning.
-
reasoning_end_str(str) –String forced when the thinking budget is exhausted.
-
reasoning_end_token_ids(list[int] | None) –Token IDs forced when the thinking budget is exhausted.
-
reasoning_parser(str) –The name of the ReasoningParser to use for this model.
-
reasoning_start_str(str) –String that indicates the start of reasoning.
-
reasoning_start_token_ids(list[int] | None) –Token IDs derived from
reasoning_start_str. Set automatically by
Source code in vllm/config/reasoning.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 | |
_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.