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

Aperta
#1,395 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
18/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
azure, rust
Ambito
ai, backend

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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?

Lingua principale
Rust
Stelle
3.7k
Fork
386
Merge medio
1g 16h
PR unite (30g)
113

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di NVIDIA-NeMo/Switchyard

Tutte le issue di NVIDIA-NeMo/Switchyard

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.