Make Codex and Claude Code subscriptions go further: a local model router that gives routine agent work to economical models and keeps your strongest model for the hard parts.
Rust ai-agentsai-gatewayclaude-codecodexcoding-agentcost-optimizationdeepseekllm-gatewayllm-routerlocal-firstmodel-routingrusttask-routingtauri
<svg xmlns="http://www.w3.org/2000/svg" width="1600" height="960" viewBox="0 0 1600 960" role="img"><defs><marker id="arrow" markerWidth="8" markerHeight="8" refX="7" refY="4" orient="auto-start-reverse"><path d="M 0 0 L 8 4 L 0 8 Z" fill="#7650D4"/></marker></defs><g font-family="Arial,Helvetica,sans-serif"><title>Choose the agent for the task, the model for each stage</title><desc>Independent task routing and model routing, using existing subscriptions, APIs, free quotas, and local models.</desc><rect x="0" y="0" width="1600" height="960" rx="0" fill="#fff" stroke="none" stroke-width="2"/><text x="800" y="91" font-size="46" fill="#142341" font-weight="700" text-anchor="middle">Choose the agent for the task, the model for each stage</text><path d="M 415 225 V 197 Q 415 182 430 182 H 1170 Q 1185 182 1185 197 V 225" fill="none" stroke="#7650D4" stroke-width="3" stroke-linejoin="round"/><rect x="575" y="145" width="450" height="72" rx="24" fill="#7650D4" stroke="none" stroke-width="2"/><text x="800" y="192" font-size="35" fill="#fff" font-weight="700" text-anchor="middle">HiRoute routing plans</text><rect x="50" y="252" width="730" height="431" rx="22" fill="#FBFAFE" stroke="#DAD0F7" stroke-width="2"/><text x="415" y="323" font-size="38" fill="#142341" font-weight="700" text-anchor="middle">Who does the work?</text><rect x="820" y="252" width="730" height="431" rx="22" fill="#FBFAFE" stroke="#DAD0F7" stroke-width="2"/><text x="1185" y="323" font-size="38" fill="#142341" font-weight="700" text-anchor="middle">What does this stage need?</text><rect x="95" y="383" width="190" height="184" rx="16" fill="#F1ECFF" stroke="#E0D5FC" stroke-width="2"/><rect x="166" y="401" width="48" height="48" rx="24" fill="#7650D4" stroke="none" stroke-width="2"/><text x="190" y="435" font-size="29" fill="#fff" font-weight="700" text-anchor="middle">1</text><text x="190" y="484" font-size="27" fill="#142341" font-weight="700" text-anchor="middle">Main agent</text><text x="190" y="518" font-size="21" fill="#56647D" font-weight="400" text-anchor="middle">Receives the</text><text x="190" y="546" font-size="21" fill="#56647D" font-weight="400" text-anchor="middle">user’s task</text><rect x="330" y="383" width="190" height="184" rx="16" fill="#F1ECFF" stroke="#E0D5FC" stroke-width="2"/><rect x="401" y="401" width="48" height="48" rx="24" fill="#7650D4" stroke="none" stroke-width="2"/><text x="425" y="435" font-size="29" fill="#fff" font-weight="700" text-anchor="middle">2</text><text x="425" y="484" font-size="27" fill="#142341" font-weight="700" text-anchor="middle">Task routing</text><text x="425" y="518" font-size="21" fill="#56647D" font-weight="400" text-anchor="middle">Selects an</text><text x="425" y="546" font-size="21" fill="#56647D" font-weight="400" text-anchor="middle">open worker plan</text><rect x="565" y="383" width="190" height="184" rx="16" fill="#F1ECFF" stroke="#E0D5FC" stroke-width="2"/><rect x="636" y="401" width="48" height="48" rx="24" fill="#7650D4" stroke="none" stroke-width="2"/><text x="660" y="435" font-size="29" fill="#fff" font-weight="700" text-anchor="middle">3</text><text x="660" y="484" font-size="27" fill="#142341" font-weight="700" text-anchor="middle">Worker agent</text><text x="660" y="518" font-size="21" fill="#56647D" font-weight="400" text-anchor="middle">Completes the</text><text x="660" y="546" font-size="21" fill="#56647D" font-weight="400" text-anchor="middle">delegated work</text><rect x="865" y="383" width="190" height="184" rx="16" fill="#F1ECFF" stroke="#E0D5FC" stroke-width="2"/><rect x="936" y="401" width="48" height="48" rx="24" fill="#7650D4" stroke="none" stroke-width="2"/><text x="960" y="435" font-size="29" fill="#fff" font-weight="700" text-anchor="middle">1</text><text x="960" y="484" font-size="27" fill="#142341" font-weight="700" text-anchor="middle">Existing agent</text><text x="960" y="518" font-size="21" fill="#56647D" font-weight="400" text-anchor="middle">Continues the</text><text x="960" y="546" font-size="21" fill="#56647D" font-weight="400" text-anchor="middle">current work</text><rect x="1100" y="383" width="190" height="184" rx="16" fill="#F1ECFF" stroke="#E0D5FC" stroke-width="2"/><rect x="1171" y="401" width="48" height="48" rx="24" fill="#7650D4" stroke="none" stroke-width="2"/><text x="1195" y="435" font-size="29" fill="#fff" font-weight="700" text-anchor="middle">2</text><text x="1195" y="484" font-size="27" fill="#142341" font-weight="700" text-anchor="middle">Model routing</text><text x="1195" y="518" font-size="21" fill="#56647D" font-weight="400" text-anchor="middle">Chooses for</text><text x="1195" y="546" font-size="21" fill="#56647D" font-weight="400" text-anchor="middle">this stage</text><rect x="1335" y="383" width="190" height="184" rx="16" fill="#F1ECFF" stroke="#E0D5FC" stroke-width="2"/><rect x="1406" y="401" width="48" height="48" rx="24" fill="#7650D4" stroke="none" stroke-width="2"/><text x="1430" y="435" font-size="29" fill="#fff" font-weight="700" text-anchor="middle">3</text><text x="1430" y="484" font-size="27" fill="#142341" font-weight="700" text-anchor="middle">Model &</text><text x="1430" y="518" font-size="21" fill="#56647D" font-weight="400" text-anchor="middle">reasoning settings</text><path d="M 293 476 H 320" fill="none" stroke="#7650D4" stroke-width="3" stroke-linejoin="round" marker-end="url(#arrow)"/><path d="M 528 476 H 555" fill="none" stroke="#7650D4" stroke-width="3" stroke-linejoin="round" marker-end="url(#arrow)"/><path d="M 1063 476 H 1090" fill="none" stroke="#7650D4" stroke-width="3" stroke-linejoin="round" marker-end="url(#arrow)"/><path d="M 1298 476 H 1325" fill="none" stroke="#7650D4" stroke-width="3" stroke-linejoin="round" marker-end="url(#arrow)"/><text x="1185" y="614" font-size="26" fill="#344B72" font-weight="400" text-anchor="middle">Economy / primary models</text><text x="1185" y="652" font-size="25" fill="#344B72" font-weight="400" text-anchor="middle">or custom writing / review branches</text><text x="800" y="761" font-size="37" fill="#7650D4" font-weight="700" text-anchor="middle">Enable task routing and model routing independently</text><rect x="50" y="810" width="1500" height="107" rx="20" fill="#F1ECFF" stroke="none" stroke-width="2"/><rect x="78" y="834" width="280" height="60" rx="14" fill="#7650D4" stroke="none" stroke-width="2"/><text x="218" y="873" font-size="24" fill="#fff" font-weight="700" text-anchor="middle">Use existing compute</text><text x="520" y="875" font-size="29" fill="#142341" font-weight="700" text-anchor="middle">Subscriptions</text><text x="811" y="875" font-size="29" fill="#142341" font-weight="700" text-anchor="middle">Model APIs</text><text x="1090" y="875" font-size="29" fill="#142341" font-weight="700" text-anchor="middle">Free quotas</text><text x="1370" y="875" font-size="29" fill="#142341" font-weight="700" text-anchor="middle">Local models</text></g></svg>