Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add application name option for openai serve #277

Merged
merged 7 commits into from
Aug 28, 2024
Merged
Show file tree
Hide file tree
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
11 changes: 9 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,21 @@ 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
Loading