Repository navigation
feat: server side streaming rather than a single response - #10
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces support for streaming inference responses, allowing clients to receive results incrementally from the server. It updates the gRPC API, client, worker, and proxy to handle streaming requests and responses, while maintaining backward compatibility with the existing unary
Predictendpoint.Streaming Inference Support
proto/inference.proto: Added a newPredictStreamRPC toInferenceServiceand defined theStreamChunkmessage for streaming tensor data and signaling the end of the stream.src/bin/client.rs: Updated the client to use the newpredict_streammethod, processing and printing streamed chunks as they arrive.src/bin/worker.rs: Implemented thepredict_streamhandler inGpuWorker, which splits input data into chunks, processes them, and streams results back to the client with anis_finalflag.Proxy and Load Balancing Enhancements
src/proxy/server.rs,src/proxy/mod.rs,src/main.rs: Updated the proxy to forward streaming requests directly to backend workers, using round-robin load balancing across available worker clients. The proxy now supports both unary and streaming inference endpoints.Dependency Updates
Cargo.toml: Added thetokio-streamdependency to support streaming response handling.