Lightning-AI / LitServe

Lightning-fast serving engine for AI models. Flexible. Easy. Enterprise-scale.
https://lightning.ai/docs/litserve
Apache License 2.0
2.06k stars 128 forks source link

Feature Request: Customize FastAPI Metadata #270

Open bhimrazy opened 1 week ago

bhimrazy commented 1 week ago

Feature Request: Customize FastAPI Metadata

Description

Add a way to change FastAPI metadata (like title, description, license info, contact details, etc) and control the visibility of documentation URLs through the app_config parameter in LitServer.

Motivation

It would be helpful to easily customize API documentation details and hide docs URLs if needed, to keep things private or more tailored to specific needs.

Proposal

Update LitServer to accept an app_config dictionary for metadata settings:

server = LitServer(..., app_config={
    "title": "Lit API",
    "description": "Lit API Description",
    "license_info": {"name": "MIT", "url": "https://opensource.org/licenses/MIT"},

    # "docs_url": None,  # to Hide docs URL
    ...
})

In server.py, apply these settings to FastAPI:

self.app = FastAPI(lifespan=self.lifespan, **app_config)

Alternatives

Additional Context

ankitsharma07 commented 1 week ago

Hi @bhimrazy I can take this up

bhimrazy commented 1 week ago

Hi @ankitsharma07,

Thanks for your interest! Let’s wait to hear feedback from the maintainers first, and once we have their feedback, feel free to proceed.

cc: @aniketmaurya @lantiga