Expand description
§Multi-Model Load Balancer
Weighted round-robin selection of model endpoints with health tracking and automatic failover.
§Selection Algorithm
Uses the smooth weighted round-robin algorithm (Nginx-style):
each endpoint’s current_weight is incremented by its weight on every
call to LoadBalancer::select; the endpoint with the highest
current_weight is chosen and then has total_weight subtracted from
its current_weight.
§Health Tracking
- After 3 consecutive failures an endpoint is marked unhealthy.
- 1 success recovers an endpoint.
- When
failover = trueunhealthy endpoints are skipped during selection.
Structs§
- Balancer
Config - Configuration for the
LoadBalancer. - Endpoint
Stats - Per-endpoint statistics tracked by the
LoadBalancer. - Load
Balancer - Thread-safe weighted round-robin load balancer for model endpoints.
- Load
Balancer Stats - Aggregate statistics for the entire balancer.
- Model
Endpoint - A single model inference endpoint.