Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions responses_api_models/vllm_model/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import re
from copy import deepcopy
from time import time
from typing import Any, ClassVar, Dict, List, Optional, Tuple, Union
from uuid import uuid4
Expand Down Expand Up @@ -66,6 +67,8 @@ class VLLMModelConfig(BaseResponsesAPIModelConfig):
uses_reasoning_parser: bool
replace_developer_role_with_system: bool = False

chat_template_kwargs: Optional[Dict[str, Any]] = None

# Corresponds to the extra_body of OpenAI Client.
extra_body: Optional[Dict[str, Any]] = None

Expand Down Expand Up @@ -149,6 +152,9 @@ async def chat_completions(
body_dict = body.model_dump(exclude_unset=True)
body_dict["model"] = self.config.model

if self.config.chat_template_kwargs:
body_dict["chat_template_kwargs"] = deepcopy(self.config.chat_template_kwargs)

session_id = request.session[SESSION_ID_KEY]
if session_id not in self._session_id_to_client:
# There is probably a better way to select the endpoint for this request. But this will do for now.
Expand Down