-
Notifications
You must be signed in to change notification settings - Fork 240
Open
Labels
enhancementNew feature or requestNew feature or request
Description
π Support for Multiple Endpoints in LitServe
We are introducing support for multiple endpoints in LitServe, which will require minor architectural adjustments to better separate concerns between the core components.
β¨ Proposed Usage
Hereβs an example of what the new API could look like:
api1 = VisionEncoderAPI(batch_size=4, api_path="/ap1")
api2 = TextEncoderAPI(batch_size=8, api_path="/path2)
def resize(...):
...
server = LitServer([
api1,
api2,
{"/random": resize}
])
server.run()
π Design Goals
To cleanly support this functionality, we need to ensure that responsibilities are clearly divided between the two main entities:
LitAPI
- Manages properties that pertain to the logic of individual APIs, such as:
batch_size
loop
stream
api_path
LitServer
- Handles server-level configuration, such as:
- Endpoint routing
Shared Responsibility (LitAPI
+ LitServer
)
- Callback handling
- Streaming functionality
π Action Items
In PR #468, we successfully moved the batch_size
parameter from LitServer
to LitAPI
to align with this separation of concerns. We need to apply a similar refactoring for other attributes:
- Move
loop
fromLitServer
toLitAPI
- move stream, endpoint path, loop to LitAPI initialization Β #512 - Move
stream
argument from LitServer to LitAPI - move stream, endpoint path, loop to LitAPI initialization Β #512 - Move
api_path
- move stream, endpoint path, loop to LitAPI initialization Β #512 - Remove
LitServer
argument fromLitSpec.setup
. Connect the queues and response buffer with a connector instead. - Add multiple LitAPI support - Support multiple LitAPIs for inference process and endpointsΒ #513
- Allow streaming and non-streaming together. - Support stream with non-stream LitAPIsΒ #518
- Scale multiple APIs separately as described here.
- Multiple endpoints with a single LitAPI (shared setup)
msharara1998, bhimrazy, josiahschuller, magicretakes and raulcarlomagno
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request