higress-group/HiRoute

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.

What it solves

AI coding agents like Codex and Claude Code can get expensive when every message uses the same powerful model. HiRoute solves this by acting as a local router that inspects each request: routine work, like reading code or gathering facts, gets sent to an economical model, while design decisions and tricky fixes stay with your premium subscription or primary model. This makes fixed subscriptions and API budgets go further without sacrificing quality on the hard parts.

How it works

HiRoute runs locally as a desktop app (macOS) or as a headless CLI and daemon (Linux). You connect your agent clients (e.g., Codex, Claude Code) and define a routing plan. The plan contains one of four modes: fixed model, difficulty routing, custom branches, or free first. For difficulty routing, HiRoute uses a separate “decision model” to judge each new user message and estimate whether it is simple or complex. If the simple probability meets your threshold and the task isn’t blocked by a low competence score from an earlier stage, it picks the economical regular model; otherwise it uses the primary model. Within a turn, tool calls keep the same decision so the context stays cacheable. On a new message or a context rebuild, HiRoute judges again. The system also supports custom task branches (e.g., drafting vs. review) and can delegate independent tasks to other agents via Worker plans. Every session records which model actually ran, its usage, and its cost, and you can review performance scores linked to each execution stage.

Who it’s for

HiRoute is for developers and teams who use AI coding agents on a budget—especially those with subscriptions to Codex, Claude Code, Qoder, Pi, or DeepSeek Harness. It’s also for anyone who wants more control over which model handles which type of work, with transparent cost tracking and the ability to define custom routing rules. It targets macOS 15+ (Apple silicon or Intel) and Linux (x86_64 or ARM64) users comfortable running a local service.

Highlights

  • Difficulty-based routing – judge each message and route simple tasks to cheap models, complex ones to your best model.
  • Bounded failover – if a model candidate fails, HiRoute tries ordered fallbacks within the same category, and fails explicitly if all are exhausted.
  • Custom extensions – connect your own decision service via an API, or use the built-in decision models (Bailian, OpenRouter Jev, TypeSafe).
  • Transparent supervision – see per-session model, usage, cost, and competence scores to verify routing decisions.
  • Runs locally – desktop app or headless CLI/daemon; no cloud dependency.
  • Open source – Apache-2.0 licensed, with a Rust workspace and Tauri desktop client.

Related

  • Project
  • Project
  • Project
  • Project