Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
change
sglang
Commits
886454e8
Unverified
Commit
886454e8
authored
Aug 18, 2025
by
Keyang Ru
Committed by
GitHub
Aug 18, 2025
Browse files
[MISC] use dynamic choices for tool-call-parser argument (#9316)
parent
0cf3fbeb
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
13 deletions
+4
-13
python/sglang/srt/server_args.py
python/sglang/srt/server_args.py
+4
-13
No files found.
python/sglang/srt/server_args.py
View file @
886454e8
...
@@ -23,6 +23,7 @@ import sys
...
@@ -23,6 +23,7 @@ import sys
import
tempfile
import
tempfile
from
typing
import
List
,
Literal
,
Optional
,
Union
from
typing
import
List
,
Literal
,
Optional
,
Union
from
sglang.srt.function_call.function_call_parser
import
FunctionCallParser
from
sglang.srt.hf_transformers_utils
import
check_gguf_file
,
get_config
from
sglang.srt.hf_transformers_utils
import
check_gguf_file
,
get_config
from
sglang.srt.layers.utils
import
is_sm90_supported
,
is_sm100_supported
from
sglang.srt.layers.utils
import
is_sm90_supported
,
is_sm100_supported
from
sglang.srt.lora.lora_registry
import
LoRARef
from
sglang.srt.lora.lora_registry
import
LoRARef
...
@@ -1231,23 +1232,13 @@ class ServerArgs:
...
@@ -1231,23 +1232,13 @@ class ServerArgs:
default
=
ServerArgs
.
reasoning_parser
,
default
=
ServerArgs
.
reasoning_parser
,
help
=
f
"Specify the parser for reasoning models, supported parsers are:
{
list
(
ReasoningParser
.
DetectorMap
.
keys
())
}
."
,
help
=
f
"Specify the parser for reasoning models, supported parsers are:
{
list
(
ReasoningParser
.
DetectorMap
.
keys
())
}
."
,
)
)
tool_call_parser_choices
=
list
(
FunctionCallParser
.
ToolCallParserEnum
.
keys
())
parser
.
add_argument
(
parser
.
add_argument
(
"--tool-call-parser"
,
"--tool-call-parser"
,
type
=
str
,
type
=
str
,
choices
=
[
# TODO: use FunctionCallParser.DetectorMap.keys()
choices
=
tool_call_parser_choices
,
"qwen25"
,
"mistral"
,
"llama3"
,
"deepseekv3"
,
"pythonic"
,
"kimi_k2"
,
"qwen3_coder"
,
"glm45"
,
"step3"
,
"gpt-oss"
,
],
default
=
ServerArgs
.
tool_call_parser
,
default
=
ServerArgs
.
tool_call_parser
,
help
=
"Specify the parser for handling tool-call interactions. Options include:
'qwen25', 'mistral', 'llama3', 'deepseekv3', 'pyt
ho
n
ic
', 'kimi_k2', 'qwen3_coder', 'glm45', and 'step3'
."
,
help
=
f
"Specify the parser for handling tool-call interactions. Options include:
{
tool_call_parser_c
hoic
es
}
."
,
)
)
parser
.
add_argument
(
parser
.
add_argument
(
"--tool-server"
,
"--tool-server"
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment