diff --git a/python/sglang/multimodal_gen/runtime/entrypoints/http_server.py b/python/sglang/multimodal_gen/runtime/entrypoints/http_server.py index ac880aeca..25d5e8fc4 100644 --- a/python/sglang/multimodal_gen/runtime/entrypoints/http_server.py +++ b/python/sglang/multimodal_gen/runtime/entrypoints/http_server.py @@ -3,7 +3,7 @@ import asyncio from contextlib import asynccontextmanager -from fastapi import FastAPI +from fastapi import APIRouter, FastAPI from sglang.multimodal_gen.runtime.entrypoints.openai import image_api, video_api from sglang.multimodal_gen.runtime.server_args import ServerArgs, prepare_server_args @@ -32,13 +32,32 @@ async def lifespan(app: FastAPI): scheduler_client.close() +# Health router +health_router = APIRouter() + + +@health_router.get("/health") +async def health(): + return {"status": "ok"} + + +@health_router.get("/health_generate") +async def health_generate(): + # TODO : health generate endpoint + return {"status": "ok"} + + def create_app(server_args: ServerArgs): """ Create and configure the FastAPI application instance. """ app = FastAPI(lifespan=lifespan) + + app.include_router(health_router) + app.include_router(image_api.router) app.include_router(video_api.router) + app.state.server_args = server_args return app diff --git a/python/sglang/multimodal_gen/test/server/perf_baselines.json b/python/sglang/multimodal_gen/test/server/perf_baselines.json index 4b301a5ad..f05fbf7cf 100644 --- a/python/sglang/multimodal_gen/test/server/perf_baselines.json +++ b/python/sglang/multimodal_gen/test/server/perf_baselines.json @@ -58,7 +58,7 @@ "expected_median_denoise_ms": 718.0, "stages_ms": { "InputValidationStage": 14, - "ImageEncodingStage": 990.0, + "ImageEncodingStage": 1400.0, "ImageVAEEncodingStage": 252.76, "ConditioningStage": 0.13, "TimestepPreparationStage": 13.78,