@@ -98,33 +98,25 @@ def _check_conditional_args(
9898 Check for conditional args and raise an error if they are not set.
9999 """
100100
101- # Endpoint and output format checks
102- if args .service_kind == "openai" :
103- if args .endpoint_type is None :
104- parser .error (
105- "The --endpoint-type option is required when using the 'openai' service-kind."
106- )
107- else :
108- if args .endpoint_type == "chat" :
109- args .output_format = OutputFormat .OPENAI_CHAT_COMPLETIONS
110- elif args .endpoint_type == "completions" :
111- args .output_format = OutputFormat .OPENAI_COMPLETIONS
112- elif args .endpoint_type == "generate" :
113- args .output_format = OutputFormat .TRITON_GENERATE
114-
115- if args .endpoint is not None :
116- args .endpoint = args .endpoint .lstrip (" /" )
117- else :
118- args .endpoint = _endpoint_type_map [args .endpoint_type ].format (MODEL_NAME = args .model )
119- elif args .endpoint_type is not None :
120- parser .error (
121- "The --endpoint-type option should only be used when using the 'openai' service-kind."
122- )
123-
124- if args .service_kind == "triton" :
101+ if args .endpoint_type == "chat" :
102+ args .output_format = OutputFormat .OPENAI_CHAT_COMPLETIONS
103+ args .service_kind = "openai"
104+ elif args .endpoint_type == "completions" :
105+ args .output_format = OutputFormat .OPENAI_COMPLETIONS
106+ args .service_kind = "openai"
107+ elif args .endpoint_type == "generate" :
108+ args .output_format = OutputFormat .TRITON_GENERATE
109+ args .service_kind = "openai"
110+ elif args .endpoint_type == "kserve" :
111+ args .service_kind = "triton"
125112 args = _convert_str_to_enum_entry (args , "backend" , OutputFormat )
126113 args .output_format = args .backend
127114
115+ if args .endpoint is not None :
116+ args .endpoint = args .endpoint .lstrip (" /" )
117+ else :
118+ args .endpoint = _endpoint_type_map [args .endpoint_type ].format (MODEL_NAME = args .model )
119+
128120 # Output token distribution checks
129121 if args .output_tokens_mean == LlmInputs .DEFAULT_OUTPUT_TOKENS_MEAN :
130122 if args .output_tokens_stddev != LlmInputs .DEFAULT_OUTPUT_TOKENS_STDDEV :
@@ -402,23 +394,12 @@ def _add_endpoint_args(parser):
402394 endpoint_group .add_argument (
403395 "--endpoint-type" ,
404396 type = str ,
405- choices = ["chat" , "completions" , "generate" ],
397+ choices = ["chat" , "completions" , "generate" , "kserve" ],
398+ default = "kserve" ,
406399 required = False ,
407- help = f"The endpoint-type to send requests to on the "
408- 'server. This is only used with the "openai" service-kind.' ,
400+ help = f"The endpoint-type for requests. Inputs will be formatted according to endpoint-type." ,
409401 )
410-
411- endpoint_group .add_argument (
412- "--service-kind" ,
413- type = str ,
414- choices = ["triton" , "openai" ],
415- default = "triton" ,
416- required = False ,
417- help = "The kind of service perf_analyzer will "
418- 'generate load for. In order to use "openai", '
419- "you must specify an api via --endpoint-type." ,
420- )
421-
402+
422403 endpoint_group .add_argument (
423404 "--streaming" ,
424405 action = "store_true" ,
0 commit comments