[Feature][Algo] Add Balancer #42
Closed
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.
Add balancer and the corresponding platform connectors
Add new balancer and connectors from llm-balancer
Balancer [tested]: The high level balancer interface providing configurations & SLO management, request load balancing functions
Request Routers:
Dynamic P/D [tested]: for dynamic P/D role switching base on the configurated SLO and realtime statistics
Connectors:
Batch Routing: Route a collection of tasks once by using greedy local search optimization algo to maximize the load balancing effect, supported by all routers listed above
vllm plugin : A vllm plugin package required for the vllm integrations on KV cache awareness
For the usage examples:
How to create and config Balancer and start a Http proxy server for requests
https://github.com/chickeyton/llm-balancer/blob/workload_router/llm_balancer/api/http/app.py
https://github.com/chickeyton/llm-balancer/tree/workload_router/examples/http/p_d (configs for P/D Disagg)
https://github.com/chickeyton/llm-balancer/tree/workload_router/examples/http/pd (configs for Mixed Mode)
https://github.com/chickeyton/llm-balancer/tree/workload_router/examples/http/dynamic_pd (configs for Dynamic P/D)
https://github.com/chickeyton/llm-balancer/tree/workload_router/examples/http/batched_p_d (configs for Batch Routing)
How to actually handle chat/completions requests with Balancer on P/D disagg(with Dynamic P/D, Batch Routing), Mixed mode (with Batch Routing)
https://github.com/chickeyton/llm-balancer/blob/workload_router/llm_balancer/api/http/pipeline/p_d.py
https://github.com/chickeyton/llm-balancer/blob/workload_router/llm_balancer/api/http/pipeline/pd.py
https://github.com/chickeyton/llm-balancer/blob/workload_router/llm_balancer/api/http/pipeline/utils.py
https://github.com/chickeyton/llm-balancer/blob/workload_router/llm_balancer/api/http/pipeline/pipeline.py
How to implement custom LLM service discovery
https://github.com/chickeyton/llm-balancer/blob/workload_router/examples/balancer/basic_usage.py (RedisEndpointTracker)
How to implement custom KV cache awareness
https://github.com/chickeyton/llm-balancer/blob/workload_router/llm_balancer/connectors/vllm/kv_connector.py
https://github.com/chickeyton/llm-balancer/blob/workload_router/llm_balancer/connectors/vllm/kv_cache_tracker.py
Related Issues
Changes Made
Testing
Test Coverage
Documentation
Checklist
Screenshots/Output
Additional Notes
Reviewer Checklist