Skip to content

Switchyard lets LLM applications route traffic across models and providers while preserving native OpenAI and Anthropic API compatibility - enabling flexible model selection, benchmarking, and cost/performance optimization.

Rust
5.5 KB
Raw Blame
<svg xmlns="http://www.w3.org/2000/svg" width="1600" height="900" viewBox="0 0 1600 900" role="img" aria-labelledby="title description">
  <title id="title">Evaluating Switchyard routing with NeMo Gym</title>
  <desc id="description">MMLU-Redux 2.0 supplies the multiple-choice questions. Gym's simple_agent initializes each task session, obtains a model answer, and sends it to the mcqa resources server, which grades the boxed answer letter against the expected answer. Gym's litellm_model calls a runner-managed LiteLLM proxy through the OpenAI Responses API. Switchyard Random routing runs as a library inside LiteLLM, not as a separate Switchyard server. Compare fixed and routed runs on identical inputs using rewards, serving models, Gym-captured input and output tokens, latency and captured errors.</desc>
  <metadata>SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION &amp; AFFILIATES. All rights reserved.
SPDX-License-Identifier: Apache-2.0</metadata>
  <defs>
    <marker id="arrow" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="8" markerHeight="8" orient="auto-start-reverse">
      <path d="M 0 0 L 10 5 L 0 10 L 3 5 Z" fill="#4B4B4B"/>
    </marker>
    <style>
      text { font-family: 'NVIDIA Sans', Arial, Helvetica, sans-serif; fill: #000; }
      .title { font-size: 44px; font-weight: 700; }
      .subtitle { font-size: 27px; fill: #76B900; }
      .heading { font-size: 28px; font-weight: 700; }
      .step { font-size: 29px; }
      .server { font-size: 20px; font-weight: 700; }
      .detail { font-size: 20px; }
      .body { font-size: 24px; }
      .caption { font-size: 18px; fill: #4B4B4B; }
      .flow { fill: none; stroke: #4B4B4B; stroke-width: 1.8; marker-end: url(#arrow); }
      .exchange { fill: none; stroke: #4B4B4B; stroke-width: 1.8; marker-start: url(#arrow); marker-end: url(#arrow); }
    </style>
  </defs>

  <rect width="1600" height="900" fill="#fff"/>
  <text x="800" y="66" text-anchor="middle" class="title">Evaluating Switchyard routing with NeMo Gym</text>
  <text x="800" y="110" text-anchor="middle" class="subtitle">Run the same tasks with a fixed model or a router, then compare rewards, tokens and latency</text>

  <rect x="34" y="205" width="1190" height="250" rx="36" fill="#E6EDEA"/>
  <text x="80" y="252" class="heading">NeMo Gym</text>

  <rect x="67" y="285" width="248" height="100" fill="#fff"/>
  <text x="191" y="326" text-anchor="middle" class="step">Dataset</text>
  <text x="191" y="362" text-anchor="middle" class="step">(tasks)</text>
  <text x="191" y="420" text-anchor="middle" class="detail">MMLU-Redux 2.0</text>

  <rect x="358" y="285" width="248" height="100" fill="#fff"/>
  <text x="482" y="326" text-anchor="middle" class="step">Initialize</text>
  <text x="482" y="362" text-anchor="middle" class="step">Task session</text>

  <rect x="649" y="285" width="248" height="100" fill="#fff"/>
  <text x="773" y="326" text-anchor="middle" class="step">Agent</text>
  <text x="773" y="362" text-anchor="middle" class="step">Executes</text>
  <text x="773" y="410" text-anchor="middle" class="server">Agent server</text>
  <text x="773" y="435" text-anchor="middle" class="detail">simple_agent</text>

  <rect x="940" y="285" width="248" height="100" fill="#fff"/>
  <text x="1064" y="345" text-anchor="middle" class="step">Verify</text>
  <text x="1064" y="410" text-anchor="middle" class="server">Resources server</text>
  <text x="1064" y="435" text-anchor="middle" class="detail">Multiple-choice verifier</text>

  <path d="M 315 335 H 356" class="flow"/>
  <path d="M 606 335 H 647" class="flow"/>
  <path d="M 897 335 H 938" class="flow"/>
  <path d="M 1188 335 H 1375 V 553" class="flow"/>

  <path d="M 773 458 V 523" class="exchange"/>
  <text x="795" y="495" class="caption">Model request / response</text>
  <rect x="503" y="525" width="540" height="65" rx="20" fill="#E6EDEA"/>
  <text x="773" y="553" text-anchor="middle" class="heading">Gym model server</text>
  <text x="773" y="578" text-anchor="middle" class="detail">litellm_model</text>
  <path d="M 773 592 V 628" class="exchange"/>
  <text x="795" y="615" class="caption">OpenAI Responses API</text>
  <rect x="503" y="630" width="540" height="105" rx="28" fill="#E6EDEA"/>
  <text x="773" y="660" text-anchor="middle" class="heading">LiteLLM proxy</text>
  <rect x="532" y="674" width="482" height="48" fill="#fff"/>
  <text x="773" y="704" text-anchor="middle" class="server">Switchyard library</text>

  <path d="M 625 737 V 806" class="exchange"/>
  <path d="M 935 737 V 806" class="exchange"/>
  <text x="780" y="780" text-anchor="middle" class="caption">Upstream models</text>
  <rect x="510" y="808" width="230" height="62" rx="20" fill="#E6EDEA"/>
  <text x="625" y="848" text-anchor="middle" class="detail">Nemotron 3.5 Lightning</text>
  <rect x="820" y="808" width="230" height="62" rx="20" fill="#E6EDEA"/>
  <text x="935" y="848" text-anchor="middle" class="detail">Nemotron 3 Ultra</text>

  <path d="M 1043 676 H 1118" class="flow"/>
  <text x="1080" y="632" text-anchor="middle" class="caption">Serving</text>
  <text x="1080" y="655" text-anchor="middle" class="caption">model</text>

  <rect x="1120" y="555" width="435" height="245" fill="#fff" stroke="#76B900" stroke-width="3"/>
  <text x="1140" y="595" class="heading">Output:</text>
  <text x="1140" y="632" class="body">Compare fixed vs. routed runs</text>
  <text x="1140" y="676" class="body">Per-task rewards</text>
  <text x="1140" y="708" class="body">Serving models</text>
  <text x="1140" y="740" class="body">Input + output tokens</text>
  <text x="1140" y="772" class="body">Latency and captured errors</text>
</svg>