Skip to content

Commit

Permalink
[Misc] Disable fastapi docs in runtime default action (#350)
Browse files Browse the repository at this point in the history
* fix: disable fastapi docs in runtime default action

* format
  • Loading branch information
brosoul authored Nov 7, 2024
1 parent 65d3e56 commit aa16fa9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions python/aibrix/aibrix/envs.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ def _parse_int_or_none(value: Optional[str]) -> Optional[int]:

# Runtime Server Config
SERVER_PORT = int(os.getenv("SERVER_PORT", "8080"))
ENABLE_FASTAPI_DOC = _is_true(os.getenv("ENABLE_FASTAPI_DOC", "0"))

# Model Download Related Config

Expand Down
6 changes: 5 additions & 1 deletion python/aibrix/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,11 @@ async def unload_lora_adapter(request: UnloadLoraAdapterRequest, raw_request: Re


def build_app():
app = FastAPI(debug=False)
if envs.ENABLE_FASTAPI_DOC:
app = FastAPI(debug=False)
else:
app = FastAPI(debug=False, openapi_url=None, docs_url=None, redoc_url=None)

INFO_METRICS.info(
{
"version": __version__.__version__,
Expand Down

0 comments on commit aa16fa9

Please sign in to comment.