[feature] Support latency-aware routing across providers serving the same model

Đang mở
#1,383 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
18/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
rust

Hướng nghiên cứu

Start with the rate-limit fallback config documented in docs/reference/toml_schema.md (lines 47-61) and the route configuration it describes, then read the provider-selection path that consumes those candidate lists. PR #162 removed the earlier latency-aware router and issue #1307 is the related experiment on inference-serving signals, so read both before proposing a design. Done means an opt-in TOML policy naming a preferred endpoint, eligible alternatives and a latency threshold, with defined hysteresis for returning traffic, leaving existing routes unchanged by default.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

enhancement

Problem

A gateway may serve the same model through multiple providers. For example, it may prefer Claude on Google Vertex AI and use Claude on AWS Bedrock as a fallback. The preferred provider can keep returning successful responses even as its queue grows and response times increase.

Switchyard can try another configured candidate after rate-limit retries are exhausted. Operators also need a way to shift new requests when a provider is still available but consistently slow.

Proposed solution

Add an opt-in latency-aware policy for routes with multiple provider endpoints serving the same model. In the route configuration, let operators specify the preferred endpoint, eligible alternatives, and a latency threshold.

Use recent endpoint measurements to steer new requests to an eligible alternative when the preferred endpoint is consistently above the threshold. For streaming, time to first token is a useful starting signal. Use provider-reported queue time where available. Define when traffic can return to the preferred endpoint so that a single slow or fast request does not cause repeated switching.

Alternatives considered

  • Ordered fallback on rate limits or errors. This handles failed requests. A latency policy would also handle requests that succeed slowly.
  • A separate upstream load balancer. This is the approach recommended in the changelog after removal of the previous latency router. If endpoint selection should remain there, a documented Switchyard integration example for this use case would help operators implement it.

Scope notes

  • Start with provider selection for the same model across explicitly configured endpoints.
  • The proposed public change is an opt-in policy in the deployment TOML. Existing routes would keep their current behavior by default.
  • Assume the endpoints are reachable through API formats Switchyard already supports. Native provider API translation is a separate feature request.

Additional context

Ngôn ngữ chính
Rust
Star
3.7k
Fork
386
Merge trung bình
1 ngày 16 giờ
Pull request đã merge (30 ngày)
113

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của NVIDIA-NeMo/Switchyard

Tất cả issue của NVIDIA-NeMo/Switchyard

Issue tương tự

Thêm issue về Rust

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.