[feature] Add Microsoft Foundry Rank as a direct-mode decision client

オープン
#1,395 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
18/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
azure, rust
領域
ai, backend

調査の方向性

The payload names no files, so start from the existing llm_classifier route in direct mode and the current decision clients it calls, then compare how a choice is returned to the routing logic. The Foundry Rank client mirrors those, and the generation client and fallback rules stay unchanged. Done means the Rank choice maps to a configured target, and outcome reporting is a separate, later step, so the draft PR covers selection only.

索引モデルが issue の本文から書いたものです。

説明

Problem statement

Switchyard's direct mode can ask an external service to choose a model, then send the request to that model's deployment. Existing decision clients send a prepared conversation and a choice question. Microsoft Foundry Rank instead needs the original API request, including settings such as tools and structured output, plus the list of models it can choose from. It returns a recommendation, not a generated answer. There is no built-in way to use that API as a Switchyard decision client today.

Goal

Let operators use Foundry Rank to choose among the models they configure in Switchyard. Switchyard should still own routing and generation, and existing decision clients should keep their current behavior.

Proposed solution

Add a foundry_rank decision client for the existing llm_classifier route with mode = "direct". Apps keep calling the same Switchyard endpoints. The new decision client only handles the call to Foundry Rank; the existing generation client still calls the selected deployment.

flowchart LR
    A[App]
    subgraph SY[Switchyard]
        subgraph DIRECT[Direct route]
            B[Routing logic]
            C[Foundry Rank decision client]
        end
        G[Existing generation client]
    end
    R[Microsoft Foundry Rank API]
    D[Configured model deployment]
    A -->|Original request| B
    B -->|Request and configured choices| C
    C -->|Original request and canonical model IDs| R
    R -->|Recommended model ID and optional version| C
    C -->|Switchyard choice| B
    B -->|Request and mapped deployment| G
    G -->|Generation request| D
    D -->|Generated answer| G
    G -->|Answer| A

The operator owns the mapping. Configure each choice group with the canonical model ID that Foundry Rank recognizes, and point that group to a Switchyard generation target. For example, the gpt-5-mini group could point to a target named mini, which calls a deployment named support-mini-prod. Rank sees gpt-5-mini, not either local alias. Switchyard checks the recommended version against the configured version when Rank returns one; the operator is responsible for keeping that mapping accurate.

Send the original request for compatibility checks. The client passes the incoming Chat Completions, Responses, or Anthropic Messages JSON, including instructions, tool definitions, and output settings. Rank picks one model from the configured pool, which can contain a single model if the operator only wants a compatibility check. Rank evaluates the incoming request; it cannot guarantee that generation will succeed after Switchyard translates the request or applies target overrides. The Rank call uses the configured Foundry endpoint and operator credentials, separate from the generation client.

Report the generation outcome back to Rank. Switchyard keeps the request ID returned by Rank and associates it with the generation attempt. After generation completes successfully, Switchyard reports the canonical ID of the model that actually served the request, even if a configured fallback served it. The report includes the Rank request ID and the successful attempt’s start time. It can also include token usage when available and the provider response ID when needed for Responses continuity. Switchyard uses the operator’s deployment mapping to translate the serving target back to a canonical ID.

The first version supports both ways to send feedback:

  • With the next Rank request: Include previous_outcome when there is another Rank request in the same API format. Rank can use the earlier result when deciding the next turn.
  • On its own: Send operation: "report_outcome" with payload_format and previous_outcome, but no generation payload or model pool. This covers cases like the last turn of a conversation, where there may be no next Rank request.

Feedback is best effort. A failed report should not turn a successful generation into an error for the app. A successful acknowledgment does not guarantee that Rank used the feedback. No new Switchyard endpoint or routing algorithm is proposed. The current draft PR covers model selection; outcome reporting is proposed here and is not implemented in the draft yet.

Feedback welcome

Does a decision client in direct mode make sense as the integration point? Are there any concerns about passing the original request to the adapter or using the existing fallback rules?

主要言語
Rust
スター
3.7k
フォーク
386
平均マージ
1日 16時間
マージ済み PR(30日)
113

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

NVIDIA-NeMo/Switchyard のほかの issue

NVIDIA-NeMo/Switchyard の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。