[RFC]: Add support for WebSocketSpec#467
[RFC]: Add support for WebSocketSpec#467bhimrazy wants to merge 15 commits intoLightning-AI:mainfrom
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #467 +/- ##
===================================
- Coverage 89% 87% -2%
===================================
Files 37 39 +2
Lines 2158 2227 +69
===================================
+ Hits 1913 1932 +19
- Misses 245 295 +50 🚀 New features to boost your workflow:
|
for more information, see https://pre-commit.ci
…e into feat/add-websocket-spec
|
Hey @bhimrazy, great work adding WebSocket support! 🙌 That said, I noticed that the current implementation still follows the same old flow: Right now, we’re still treating the WebSocket like a regular HTTP call, just over a different pipe. It works, but we’re not unlocking the real benefits yet. |
|
Thanks for the thoughtful feedback, @aniketmaurya ! 🙏 |
|
closing this for now due to inactivity. please feel free to reopen. |
What does this PR do?
This PR introduces an experimental
WebSocketSpecfor enabling communication using WebSockets in LitServe.It aims to address the limitation of current server-sent events (SSE)-based streaming by supporting streaming input and output, which is critical for real-time AI use cases such as:
etc
This PR sets the foundation for broader real-time interaction patterns in LitServe, inspired by community discussions in #320.
Fixes #320
Before submitting
🔧 Usage
Here’s how to use
WebSocketSpecfor real-time object detection with an RFDETR model.Click to expand: Object Detection Example
Install requirements
🖥️
server.py📡
client.py⚡ Benchmarks
I performed a basic performance comparison between
WebSocketSpecand existing HTTP-based inferencing methods on a video inference workload.Details:
rfdetr)1. Using HTTP Requests
Start the server
Script
2. Using Websocket Requests
Start the server from usage section using
WebSocketSpec.Script
🎥 Output Video
output_ws.mp4
PR review
Community feedback is welcome! This is an experimental addition and we’d love help shaping it to best serve real-time ML use cases.
Did you have fun?
Yes 😄 — and more to come!