Skip to content

Commit 5266d5c

Browse files
Integrate Hermes tool parser with test infrastructure
- Add HermesToolParser to __init__.py exports for proper module integration - Update test configuration to support 'hermes' tool call parser option - Add hermes parser support to infer_test_environment() and infer_test_model_repository() - Enables testing hermes tool calling functionality via TEST_TOOL_CALL_PARSER=hermes This allows the hermes parser to be tested alongside existing llama3 and mistral parsers through the established OpenAI test suite infrastructure.
1 parent 2ea2c29 commit 5266d5c

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

python/openai/openai_frontend/engine/utils/tool_call_parsers/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,15 @@
2828
# https://github.com/vllm-project/vllm/blob/main/vllm/entrypoints/openai/tool_parsers/__init__.py
2929
# Copyright 2024 The vLLM team.
3030

31+
from .hermes_tool_call_parser import HermesToolParser
3132
from .llama_tool_call_parser import Llama3JsonToolParser
3233
from .mistral_tool_call_parser import MistralToolParser
3334
from .tool_call_parser import ToolCallParser, ToolParserManager
3435

3536
__all__ = [
3637
"ToolCallParser",
3738
"ToolParserManager",
39+
"HermesToolParser",
3840
"Llama3JsonToolParser",
3941
"MistralToolParser",
4042
]

python/openai/tests/conftest.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ def infer_test_environment(tool_call_parser):
4141
backend = "vllm"
4242
if tool_call_parser == "mistral":
4343
model = "mistral-nemo-instruct-2407"
44+
elif tool_call_parser == "hermes":
45+
model = "llama-3.1-8b-instruct" # Use llama model for hermes testing
4446
else:
4547
model = "llama-3.1-8b-instruct"
4648
return backend, model
@@ -62,6 +64,10 @@ def infer_test_environment(tool_call_parser):
6264
def infer_test_model_repository(backend, tool_call_parser):
6365
if tool_call_parser == "mistral":
6466
model_repository = str(Path(__file__).parent / f"{backend}_mistral_models")
67+
elif tool_call_parser == "hermes":
68+
model_repository = str(
69+
Path(__file__).parent / f"{backend}_models"
70+
) # Use default models for hermes
6571
else:
6672
model_repository = str(Path(__file__).parent / f"{backend}_models")
6773
return model_repository

0 commit comments

Comments
 (0)