<?xml version="1.0" encoding="UTF-8"?>
<mxfile host="eli.ai" agent="eli.ai diagram exporter" version="1">
  <diagram id="llm-model-routing-631e93d7" name="LLM model routing">
    <mxGraphModel dx="1600" dy="1200" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1600" pageHeight="1200" math="0" shadow="0">
      <root>
        <mxCell id="0"/>
        <object id="1" label="LLM model routing" schemaVersion="1" diagramId="llm-model-routing-631e93d7" canonicalAppearanceKey="tsx:src/app/(docs)/docs/concepts/llm-router/page.tsx:routerChart#1" sourceSha256="631e93d71b118dd16c0fe9b0407201f6baff19e073a452abd1e7e431cd6611e5" metadataPayloadSha256="16b35333e0893dd869dca87980737f1b0306b4005da2174d29ecc3eeac75f57b" generationKey="3158915606d5df1e46812c0880b7fc4ebaddab7106234f9d009e07bd46a2d7e6" concepts="[&quot;LLM router&quot;,&quot;Router&quot;]" keywords="[&quot;models.yaml: price, tier, capabilities&quot;,&quot;engineered features&quot;,&quot;sentence embedding&quot;,&quot;LightGBM scorer&quot;,&quot;model catalog&quot;,&quot;cost model&quot;,&quot;rollout default&quot;,&quot;gateway (litellm)&quot;,&quot;RewardSignal feedback&quot;,&quot;messages · required capabilities · budget&quot;,&quot;~45 signals: code, format, depth, domain&quot;,&quot;MiniLM 384-dim · hash fallback&quot;,&quot;per-model quality + confidence&quot;,&quot;token estimate → expected USD per model&quot;,&quot;chosen model · scored slate · fallback chain&quot;,&quot;shadow (rollout default)&quot;,&quot;execute + fallback on error&quot;,&quot;realized cost · latency · quality&quot;,&quot;eligibility → quality floor → quality-per-dollar&quot;,&quot;RouteRequest&quot;,&quot;policy&quot;,&quot;RouteDecision&quot;,&quot;active&quot;]" application="{&quot;name&quot;:&quot;eli-ai&quot;,&quot;version&quot;:&quot;0.1.0&quot;}" packages="{&quot;mermaid&quot;:&quot;11.16.0&quot;,&quot;mermaidCli&quot;:&quot;11.16.0&quot;,&quot;playwright&quot;:&quot;1.62.1&quot;,&quot;playwrightCore&quot;:&quot;1.62.1&quot;,&quot;puppeteer&quot;:&quot;25.6.0&quot;,&quot;puppeteerCore&quot;:&quot;25.6.0&quot;}" environment="{&quot;architecture&quot;:&quot;x64&quot;,&quot;containerImage&quot;:&quot;playwright:v1.62.1-noble@sha256:c091b21d9fae78c76e85cd4356431e9b018402f172a214fc7d7a5e9a7e29d8ac+node:26.3.1-bookworm-slim@sha256:209558c3e5e40e8adff68959d3c2ba7cd73723e716d89196878a0c362fa1e109&quot;,&quot;node&quot;:&quot;v26.3.1&quot;,&quot;platform&quot;:&quot;linux&quot;,&quot;yarn&quot;:&quot;4.17.1&quot;}" renderer="{&quot;browser&quot;:{&quot;executableSha256&quot;:&quot;0b20b130e7edd9dd51873be867761295fe0cfad490c2b9a64f95bd3cfc08fa71&quot;,&quot;name&quot;:&quot;chromium&quot;,&quot;revision&quot;:&quot;1234&quot;,&quot;version&quot;:&quot;151.0.7922.34&quot;},&quot;font&quot;:{&quot;family&quot;:&quot;Eli Diagram Inter Variable&quot;,&quot;fileSha256&quot;:&quot;3100e775e8616cd2611beecfa23a4263d7037586789b43f035236a2e6fbd4c62&quot;,&quot;licenseSha256&quot;:&quot;3b0a5fca3d17942cde889069889dedbbbd075e9b599968c82a95f4d944e9b345&quot;},&quot;mermaidConfigSha256&quot;:&quot;68c10966fe84406ee626034d58bfabd555df9f65f691204b7c46db24038da101&quot;,&quot;themeCssSha256&quot;:&quot;c80287a78d80ad63d27bd5ca348b2ef9a7e2f44da289e436be6484ea28a1b033&quot;}" adapterVersions="{&quot;diagramGenerator&quot;:&quot;2&quot;,&quot;drawioFlowchart&quot;:&quot;1&quot;,&quot;drawioGantt&quot;:&quot;1&quot;,&quot;drawioSequence&quot;:&quot;1&quot;,&quot;drawioState&quot;:&quot;1&quot;}" mermaidType="flowchart" direction="TB" generatedAt="2026-08-12T23:39:59.243Z" mermaidSource="flowchart TB&#10;  RQ[&quot;RouteRequest&lt;br/&gt;messages · required capabilities · budget&quot;] --&gt; FE[&quot;engineered features&lt;br/&gt;~45 signals: code, format, depth, domain&quot;]&#10;  RQ --&gt; EM[&quot;sentence embedding&lt;br/&gt;MiniLM 384-dim · hash fallback&quot;]&#10;  FE --&gt; SC[&quot;LightGBM scorer&lt;br/&gt;per-model quality + confidence&quot;]&#10;  EM --&gt; SC&#10;  CAT[&quot;model catalog&lt;br/&gt;models.yaml: price, tier, capabilities&quot;] --&gt; SC&#10;  CAT --&gt; CM[&quot;cost model&lt;br/&gt;token estimate → expected USD per model&quot;]&#10;  SC --&gt; PO[&quot;policy&lt;br/&gt;eligibility → quality floor → quality-per-dollar&quot;]&#10;  CM --&gt; PO&#10;  PO --&gt; DE[&quot;RouteDecision&lt;br/&gt;chosen model · scored slate · fallback chain&quot;]&#10;  DE -.-&gt;|&quot;shadow (rollout default)&quot;| TL[&quot;telemetry log only&lt;br/&gt;host&apos;s own model still answers&quot;]&#10;  DE --&gt;|&quot;active&quot;| GW[&quot;gateway (litellm)&lt;br/&gt;execute + fallback on error&quot;]&#10;  GW --&gt; TL&#10;  TL --&gt; FB[&quot;RewardSignal feedback&lt;br/&gt;realized cost · latency · quality&quot;]">
          <mxCell parent="0"/>
        </object>
        <object id="n:RQ" label="RouteRequestmessages · required capabilities · budget" mermaidId="RQ" mermaidShape="rectangle">
          <mxCell parent="1" vertex="1" style="fillColor=#ECECFF;fontColor=#333333;html=1;rounded=0;strokeColor=#9370DB;whiteSpace=wrap;">
            <mxGeometry x="151" y="8" width="256" height="100" as="geometry"/>
          </mxCell>
        </object>
        <object id="n:FE" label="engineered features~45 signals: code, format, depth, domain" mermaidId="FE" mermaidShape="rectangle">
          <mxCell parent="1" vertex="1" style="fillColor=#ECECFF;fontColor=#333333;html=1;rounded=0;strokeColor=#9370DB;whiteSpace=wrap;">
            <mxGeometry x="8" y="158" width="256" height="100" as="geometry"/>
          </mxCell>
        </object>
        <object id="n:EM" label="sentence embeddingMiniLM 384-dim · hash fallback" mermaidId="EM" mermaidShape="rectangle">
          <mxCell parent="1" vertex="1" style="fillColor=#ECECFF;fontColor=#333333;html=1;rounded=0;strokeColor=#9370DB;whiteSpace=wrap;">
            <mxGeometry x="314" y="158" width="256" height="100" as="geometry"/>
          </mxCell>
        </object>
        <object id="n:SC" label="LightGBM scorerper-model quality + confidence" mermaidId="SC" mermaidShape="rectangle">
          <mxCell parent="1" vertex="1" style="fillColor=#ECECFF;fontColor=#333333;html=1;rounded=0;strokeColor=#9370DB;whiteSpace=wrap;">
            <mxGeometry x="314" y="308" width="256" height="100" as="geometry"/>
          </mxCell>
        </object>
        <object id="n:CAT" label="model catalogmodels.yaml: price, tier, capabilities" mermaidId="CAT" mermaidShape="rectangle">
          <mxCell parent="1" vertex="1" style="fillColor=#ECECFF;fontColor=#333333;html=1;rounded=0;strokeColor=#9370DB;whiteSpace=wrap;">
            <mxGeometry x="620" y="158" width="256" height="100" as="geometry"/>
          </mxCell>
        </object>
        <object id="n:CM" label="cost modeltoken estimate → expected USD per model" mermaidId="CM" mermaidShape="rectangle">
          <mxCell parent="1" vertex="1" style="fillColor=#ECECFF;fontColor=#333333;html=1;rounded=0;strokeColor=#9370DB;whiteSpace=wrap;">
            <mxGeometry x="630" y="308" width="256" height="100" as="geometry"/>
          </mxCell>
        </object>
        <object id="n:PO" label="policyeligibility → quality floor → quality-per-dollar" mermaidId="PO" mermaidShape="rectangle">
          <mxCell parent="1" vertex="1" style="fillColor=#ECECFF;fontColor=#333333;html=1;rounded=0;strokeColor=#9370DB;whiteSpace=wrap;">
            <mxGeometry x="467" y="458" width="256" height="100" as="geometry"/>
          </mxCell>
        </object>
        <object id="n:DE" label="RouteDecisionchosen model · scored slate · fallback chain" mermaidId="DE" mermaidShape="rectangle">
          <mxCell parent="1" vertex="1" style="fillColor=#ECECFF;fontColor=#333333;html=1;rounded=0;strokeColor=#9370DB;whiteSpace=wrap;">
            <mxGeometry x="467" y="608" width="256" height="100" as="geometry"/>
          </mxCell>
        </object>
        <object id="n:TL" label="telemetry log onlyhost&apos;s own model still answers" mermaidId="TL" mermaidShape="rectangle">
          <mxCell parent="1" vertex="1" style="fillColor=#ECECFF;fontColor=#333333;html=1;rounded=0;strokeColor=#9370DB;whiteSpace=wrap;">
            <mxGeometry x="467" y="932" width="256" height="100" as="geometry"/>
          </mxCell>
        </object>
        <object id="n:GW" label="gateway (litellm)execute + fallback on error" mermaidId="GW" mermaidShape="rectangle">
          <mxCell parent="1" vertex="1" style="fillColor=#ECECFF;fontColor=#333333;html=1;rounded=0;strokeColor=#9370DB;whiteSpace=wrap;">
            <mxGeometry x="593.433594" y="782" width="256" height="100" as="geometry"/>
          </mxCell>
        </object>
        <object id="n:FB" label="RewardSignal feedbackrealized cost · latency · quality" mermaidId="FB" mermaidShape="rectangle">
          <mxCell parent="1" vertex="1" style="fillColor=#ECECFF;fontColor=#333333;html=1;rounded=0;strokeColor=#9370DB;whiteSpace=wrap;">
            <mxGeometry x="467" y="1082" width="256" height="100" as="geometry"/>
          </mxCell>
        </object>
        <object id="e:L_RQ_FE_0" label="" mermaidId="L_RQ_FE_0" mermaidKind="relationship">
          <mxCell parent="1" source="n:RQ" target="n:FE" edge="1" style="edgeStyle=orthogonalEdgeStyle;endArrow=block;endFill=1;html=1;jettySize=auto;orthogonalLoop=1;rounded=0;strokeColor=#333333;">
            <mxGeometry relative="1" as="geometry">
              <mxPoint x="183.666667" y="108" as="sourcePoint"/>
              <mxPoint x="136" y="158" as="targetPoint"/>
              <Array as="points">
                <mxPoint x="136" y="133"/>
              </Array>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:L_RQ_EM_0" label="" mermaidId="L_RQ_EM_0" mermaidKind="relationship">
          <mxCell parent="1" source="n:RQ" target="n:EM" edge="1" style="edgeStyle=orthogonalEdgeStyle;endArrow=block;endFill=1;html=1;jettySize=auto;orthogonalLoop=1;rounded=0;strokeColor=#333333;">
            <mxGeometry relative="1" as="geometry">
              <mxPoint x="387.666667" y="108" as="sourcePoint"/>
              <mxPoint x="442" y="158" as="targetPoint"/>
              <Array as="points">
                <mxPoint x="442" y="133"/>
              </Array>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:L_FE_SC_0" label="" mermaidId="L_FE_SC_0" mermaidKind="relationship">
          <mxCell parent="1" source="n:FE" target="n:SC" edge="1" style="edgeStyle=orthogonalEdgeStyle;endArrow=block;endFill=1;html=1;jettySize=auto;orthogonalLoop=1;rounded=0;strokeColor=#333333;">
            <mxGeometry relative="1" as="geometry">
              <mxPoint x="136" y="258" as="sourcePoint"/>
              <mxPoint x="314" y="326.627451" as="targetPoint"/>
              <Array as="points">
                <mxPoint x="136" y="283"/>
              </Array>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:L_EM_SC_0" label="" mermaidId="L_EM_SC_0" mermaidKind="relationship">
          <mxCell parent="1" source="n:EM" target="n:SC" edge="1" style="edgeStyle=orthogonalEdgeStyle;endArrow=block;endFill=1;html=1;jettySize=auto;orthogonalLoop=1;rounded=0;strokeColor=#333333;">
            <mxGeometry relative="1" as="geometry">
              <mxPoint x="442" y="258" as="sourcePoint"/>
              <mxPoint x="442" y="308" as="targetPoint"/>
              <Array as="points">
                <mxPoint x="442" y="283"/>
              </Array>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:L_CAT_SC_0" label="" mermaidId="L_CAT_SC_0" mermaidKind="relationship">
          <mxCell parent="1" source="n:CAT" target="n:SC" edge="1" style="edgeStyle=orthogonalEdgeStyle;endArrow=block;endFill=1;html=1;jettySize=auto;orthogonalLoop=1;rounded=0;strokeColor=#333333;">
            <mxGeometry relative="1" as="geometry">
              <mxPoint x="652.666667" y="258" as="sourcePoint"/>
              <mxPoint x="550.666667" y="308" as="targetPoint"/>
              <Array as="points">
                <mxPoint x="605" y="283"/>
              </Array>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:L_CAT_CM_0" label="" mermaidId="L_CAT_CM_0" mermaidKind="relationship">
          <mxCell parent="1" source="n:CAT" target="n:CM" edge="1" style="edgeStyle=orthogonalEdgeStyle;endArrow=block;endFill=1;html=1;jettySize=auto;orthogonalLoop=1;rounded=0;strokeColor=#333333;">
            <mxGeometry relative="1" as="geometry">
              <mxPoint x="754.666667" y="258" as="sourcePoint"/>
              <mxPoint x="758" y="308" as="targetPoint"/>
              <Array as="points">
                <mxPoint x="758" y="283"/>
              </Array>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:L_SC_PO_0" label="" mermaidId="L_SC_PO_0" mermaidKind="relationship">
          <mxCell parent="1" source="n:SC" target="n:PO" edge="1" style="edgeStyle=orthogonalEdgeStyle;endArrow=block;endFill=1;html=1;jettySize=auto;orthogonalLoop=1;rounded=0;strokeColor=#333333;">
            <mxGeometry relative="1" as="geometry">
              <mxPoint x="442" y="408" as="sourcePoint"/>
              <mxPoint x="493" y="458" as="targetPoint"/>
              <Array as="points">
                <mxPoint x="442" y="433"/>
              </Array>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:L_CM_PO_0" label="" mermaidId="L_CM_PO_0" mermaidKind="relationship">
          <mxCell parent="1" source="n:CM" target="n:PO" edge="1" style="edgeStyle=orthogonalEdgeStyle;endArrow=block;endFill=1;html=1;jettySize=auto;orthogonalLoop=1;rounded=0;strokeColor=#333333;">
            <mxGeometry relative="1" as="geometry">
              <mxPoint x="758" y="408" as="sourcePoint"/>
              <mxPoint x="703.666667" y="458" as="targetPoint"/>
              <Array as="points">
                <mxPoint x="758" y="433"/>
              </Array>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:L_PO_DE_0" label="" mermaidId="L_PO_DE_0" mermaidKind="relationship">
          <mxCell parent="1" source="n:PO" target="n:DE" edge="1" style="edgeStyle=orthogonalEdgeStyle;endArrow=block;endFill=1;html=1;jettySize=auto;orthogonalLoop=1;rounded=0;strokeColor=#333333;">
            <mxGeometry relative="1" as="geometry">
              <mxPoint x="595" y="558" as="sourcePoint"/>
              <mxPoint x="595" y="608" as="targetPoint"/>
              <Array as="points">
                <mxPoint x="595" y="583"/>
              </Array>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:L_DE_TL_0" label="shadow (rollout default)" mermaidId="L_DE_TL_0" mermaidKind="relationship">
          <mxCell parent="1" source="n:DE" target="n:TL" edge="1" style="edgeStyle=orthogonalEdgeStyle;endArrow=block;endFill=1;html=1;jettySize=auto;orthogonalLoop=1;rounded=0;strokeColor=#333333;">
            <mxGeometry relative="1" as="geometry">
              <mxPoint x="522.337015" y="708" as="sourcePoint"/>
              <mxPoint x="510.710938" y="932" as="targetPoint"/>
              <Array as="points">
                <mxPoint x="468.566406" y="745"/>
                <mxPoint x="468.566406" y="832"/>
                <mxPoint x="468.566406" y="907"/>
              </Array>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:L_DE_GW_0" label="active" mermaidId="L_DE_GW_0" mermaidKind="relationship">
          <mxCell parent="1" source="n:DE" target="n:GW" edge="1" style="edgeStyle=orthogonalEdgeStyle;endArrow=block;endFill=1;html=1;jettySize=auto;orthogonalLoop=1;rounded=0;strokeColor=#333333;">
            <mxGeometry relative="1" as="geometry">
              <mxPoint x="667.662985" y="708" as="sourcePoint"/>
              <mxPoint x="721.433594" y="782" as="targetPoint"/>
              <Array as="points">
                <mxPoint x="721.433594" y="745"/>
              </Array>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:L_GW_TL_0" label="" mermaidId="L_GW_TL_0" mermaidKind="relationship">
          <mxCell parent="1" source="n:GW" target="n:TL" edge="1" style="edgeStyle=orthogonalEdgeStyle;endArrow=block;endFill=1;html=1;jettySize=auto;orthogonalLoop=1;rounded=0;strokeColor=#333333;">
            <mxGeometry relative="1" as="geometry">
              <mxPoint x="721.433594" y="882" as="sourcePoint"/>
              <mxPoint x="679.289063" y="932" as="targetPoint"/>
              <Array as="points">
                <mxPoint x="721.433594" y="907"/>
              </Array>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:L_TL_FB_0" label="" mermaidId="L_TL_FB_0" mermaidKind="relationship">
          <mxCell parent="1" source="n:TL" target="n:FB" edge="1" style="edgeStyle=orthogonalEdgeStyle;endArrow=block;endFill=1;html=1;jettySize=auto;orthogonalLoop=1;rounded=0;strokeColor=#333333;">
            <mxGeometry relative="1" as="geometry">
              <mxPoint x="595" y="1032" as="sourcePoint"/>
              <mxPoint x="595" y="1082" as="targetPoint"/>
              <Array as="points">
                <mxPoint x="595" y="1057"/>
              </Array>
            </mxGeometry>
          </mxCell>
        </object>
      </root>
    </mxGraphModel>
  </diagram>
</mxfile>
