Federation & Service

路由

Federation 如何路由请求和处理故障转移

路由

Federation AIService 处理模型提供商和 Service 之间的请求路由和故障转移。这确保即使个别后端宕机,Agent 仍然可用。

模型路由

当 Agent 发送模型请求时:

  1. Federation AIService 查找模型 ID
  2. 选择健康和延迟最低的提供商
  3. 转发请求
  4. 如果提供商失败,用下一个可用提供商重试

Service 路由

当 Agent 调用 Action 时:

  1. City 将 Action 解析到拥有它的 Service
  2. 检查 Service 的健康和负载
  3. 将请求路由到最佳实例
  4. 如果 Service 不可用,返回错误或排队请求

故障转移

  • 持续监控提供商健康
  • 失败的请求以指数退避重试
  • 断路器防止级联故障
  • 负载均衡将流量分布到健康实例

继续阅读: