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="1000" viewBox="0 0 1600 1000" 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>HiRoute: a local routing and collaboration engine</title><desc>Desktop and CLI configure the local service and Rust gateway. Agents call the gateway, which connects to decision services, model APIs, and subscriptions via CPA; execution records stay local.</desc><rect x="0" y="0" width="1600" height="1000" rx="0" fill="#fff" stroke="none" stroke-width="2"/><text x="800" y="95" font-size="46" fill="#142341" font-weight="700" text-anchor="middle">HiRoute: a local routing and collaboration engine</text><rect x="50" y="172" width="1090" height="670" rx="26" fill="#F7F4FE" stroke="#D9CFF1" stroke-width="2"/><text x="85" y="219" font-size="24" fill="#7350C5" font-weight="700" text-anchor="start">YOUR COMPUTER</text><path d="M 440 300 H 530" fill="none" stroke="#7650D4" stroke-width="3" stroke-linejoin="round" marker-end="url(#arrow)"/><path d="M 710 355 V 435" fill="none" stroke="#7650D4" stroke-width="3" stroke-linejoin="round" marker-end="url(#arrow)"/><text x="727" y="402" font-size="20" fill="#7B8294" font-weight="400" text-anchor="start">Configuration</text><path d="M 410 513 H 500" fill="none" stroke="#7650D4" stroke-width="3" stroke-linejoin="round" marker-start="url(#arrow)" marker-end="url(#arrow)"/><text x="285" y="420" font-size="22" fill="#7350C5" font-weight="400" text-anchor="start">Requests / responses</text><path d="M 965 513 H 1190" fill="none" stroke="#7650D4" stroke-width="3" stroke-linejoin="round" marker-start="url(#arrow)" marker-end="url(#arrow)"/><path d="M 915 435 V 394 H 1167 V 300 H 1190" fill="none" stroke="#7650D4" stroke-width="3" stroke-linejoin="round" marker-start="url(#arrow)" marker-end="url(#arrow)"/><path d="M 870 610 V 641 H 1037 V 670" fill="none" stroke="#7650D4" stroke-width="3" stroke-linejoin="round" marker-end="url(#arrow)"/><path d="M 1125 736 H 1190" fill="none" stroke="#7650D4" stroke-width="3" stroke-linejoin="round" marker-end="url(#arrow)"/><path d="M 710 610 V 702" fill="none" stroke="#7650D4" stroke-width="3" stroke-linejoin="round" marker-end="url(#arrow)"/><rect x="90" y="245" width="350" height="110" rx="18" fill="#fff" stroke="#DED6F1" stroke-width="2"/><text x="265.0" y="290" font-size="28" fill="#142341" font-weight="700" text-anchor="middle">Desktop / CLI</text><text x="265.0" y="323" font-size="21" fill="#64718A" font-weight="400" text-anchor="middle">Connect sources · Publish plans</text><rect x="530" y="245" width="360" height="110" rx="18" fill="#fff" stroke="#DED6F1" stroke-width="2"/><text x="710.0" y="290" font-size="28" fill="#142341" font-weight="700" text-anchor="middle">Local service</text><text x="710.0" y="323" font-size="23" fill="#64718A" font-weight="400" text-anchor="middle">Plans · Permissions · Tasks</text><rect x="90" y="442" width="320" height="145" rx="18" fill="#fff" stroke="#DED6F1" stroke-width="2"/><text x="250.0" y="487" font-size="28" fill="#142341" font-weight="700" text-anchor="middle">Existing agent</text><text x="250.0" y="520" font-size="23" fill="#64718A" font-weight="400" text-anchor="middle">Executes your work</text><rect x="500" y="435" width="465" height="175" rx="18" fill="#7650D4" stroke="none" stroke-width="2"/><text x="732.5" y="480" font-size="28" fill="#fff" font-weight="700" text-anchor="middle">HiRoute Gateway · Rust</text><text x="732.5" y="513" font-size="21" fill="#F0EAFD" font-weight="400" text-anchor="middle">Decision adapters · Capability checks</text><text x="732.5" y="544" font-size="23" fill="#F0EAFD" font-weight="400" text-anchor="middle">Ordered candidate failover</text><rect x="500" y="702" width="360" height="112" rx="18" fill="#fff" stroke="#DED6F1" stroke-width="2"/><text x="680.0" y="747" font-size="28" fill="#142341" font-weight="700" text-anchor="middle">Local execution records</text><text x="680.0" y="780" font-size="21" fill="#64718A" font-weight="400" text-anchor="middle">Sessions · Usage · Stage scores</text><rect x="950" y="670" width="175" height="132" rx="18" fill="#fff" stroke="#DED6F1" stroke-width="2"/><text x="1037.5" y="715" font-size="30" fill="#142341" font-weight="700" text-anchor="middle">CPA</text><text x="1037.5" y="748" font-size="23" fill="#64718A" font-weight="400" text-anchor="middle">Subscription</text><text x="1037.5" y="779" font-size="23" fill="#64718A" font-weight="400" text-anchor="middle">access</text><rect x="1190" y="232" width="360" height="136" rx="18" fill="#fff" stroke="#DED6F1" stroke-width="2"/><text x="1370.0" y="277" font-size="28" fill="#142341" font-weight="700" text-anchor="middle">Decision models &</text><text x="1370.0" y="310" font-size="28" fill="#64718A" font-weight="700" text-anchor="middle">extensions</text><text x="1370.0" y="341" font-size="21" fill="#64718A" font-weight="400" text-anchor="middle">Jev · Bailian · Custom services</text><rect x="1190" y="442" width="360" height="145" rx="18" fill="#fff" stroke="#DED6F1" stroke-width="2"/><text x="1370.0" y="523.5" font-size="28" fill="#142341" font-weight="700" text-anchor="middle">Model APIs</text><rect x="1190" y="667" width="360" height="145" rx="18" fill="#fff" stroke="#DED6F1" stroke-width="2"/><text x="1370.0" y="748.5" font-size="28" fill="#142341" font-weight="700" text-anchor="middle">Subscription models</text><text x="800" y="916" font-size="32" fill="#7650D4" font-weight="600" text-anchor="middle">Configuration and records stay local; connected services perform inference.</text><text x="800" y="963" font-size="25" fill="#64718A" font-weight="400" text-anchor="middle">Local model services can also be connected.</text></g></svg>