Skip to content

Commit

Permalink
add application name argument for openai server
Browse files Browse the repository at this point in the history
Signed-off-by: cheehook <[email protected]>
  • Loading branch information
cheehook committed Aug 23, 2024
1 parent 549658d commit 7d01cd9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 2 additions & 2 deletions llm_on_ray/inference/api_server_openai.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,14 @@ def router_application(deployments, model_list, max_ongoing_requests, max_num_se


def openai_serve_run(
deployments, model_list, host, route_prefix, port, max_ongoing_requests, max_num_seqs
deployments, model_list, host, route_prefix, application_name, port, max_ongoing_requests, max_num_seqs
):
router_app = router_application(deployments, model_list, max_ongoing_requests, max_num_seqs)

serve.start(http_options={"host": host, "port": port})
serve.run(
router_app,
name="router",
name=application_name,
route_prefix=route_prefix,
).options(
stream=True,
Expand Down
7 changes: 7 additions & 0 deletions llm_on_ray/inference/serve.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,12 @@ def main(argv=None):
type=str,
help="The openai_route_prefix must start with a forward slash ('/')",
)
parser.add_argument(
"--openai_application_name",
default="router",
type=str,
help="If not specified, the application name will be 'router'.",
)

# Print help if no arguments were provided
if len(sys.argv) == 1:
Expand Down Expand Up @@ -191,6 +197,7 @@ def main(argv=None):
model_list,
host,
args.openai_route_prefix,
args.openai_application_name,
args.port,
args.max_ongoing_requests,
args.max_num_seqs,
Expand Down

0 comments on commit 7d01cd9

Please sign in to comment.