Skip to content

Commit

Permalink
[misc][frontend] log all available endpoints (vllm-project#6195)
Browse files Browse the repository at this point in the history
Co-authored-by: Cody Yu <[email protected]>
  • Loading branch information
youkaichao and comaniac authored Jul 7, 2024
1 parent abfe705 commit 3b08fe2
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
11 changes: 11 additions & 0 deletions vllm/entrypoints/api_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,13 @@

from vllm.engine.arg_utils import AsyncEngineArgs
from vllm.engine.async_llm_engine import AsyncLLMEngine
from vllm.logger import init_logger
from vllm.sampling_params import SamplingParams
from vllm.usage.usage_lib import UsageContext
from vllm.utils import FlexibleArgumentParser, random_uuid

logger = init_logger("vllm.entrypoints.api_server")

TIMEOUT_KEEP_ALIVE = 5 # seconds.
app = FastAPI()
engine = None
Expand Down Expand Up @@ -107,6 +110,14 @@ async def stream_results() -> AsyncGenerator[bytes, None]:
engine_args, usage_context=UsageContext.API_SERVER)

app.root_path = args.root_path

logger.info("Available routes are:")
for route in app.routes:
if not hasattr(route, 'methods'):
continue
methods = ', '.join(route.methods)
logger.info("Route: %s, Methods: %s", route.path, methods)

uvicorn.run(app,
host=args.host,
port=args.port,
Expand Down
8 changes: 8 additions & 0 deletions vllm/entrypoints/openai/api_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,14 @@ async def authentication(request: Request, call_next):
openai_serving_embedding = OpenAIServingEmbedding(engine, model_config,
served_model_names)
app.root_path = args.root_path

logger.info("Available routes are:")
for route in app.routes:
if not hasattr(route, 'methods'):
continue
methods = ', '.join(route.methods)
logger.info("Route: %s, Methods: %s", route.path, methods)

uvicorn.run(app,
host=args.host,
port=args.port,
Expand Down

0 comments on commit 3b08fe2

Please sign in to comment.