# HiRoute

> A local model router that sends routine agent work to economical models and keeps stronger models for harder stages of long-horizon tasks.

HiRoute is an open-source local model router from the higress-group organization, released under the Apache-2.0 license. It sits between agents such as Codex, Claude Code, Qoder, Pi, and DeepSeek Harness and the models they use, choosing a model for each stage of a long task. The latest stable release listed is 0.3.1, available as a macOS desktop app and a Linux headless CLI and daemon.

## What It Is

HiRoute is a model router for long-horizon agent work such as coding, research, analysis, and automation. With a difficulty-routing plan, it judges each new user message. Routine work like reading code or gathering facts can go to an economical model, while design decisions and hard fixes stay with a primary model or subscription. Subscriptions, API keys, and local models are managed in one place, and each session shows which model actually ran, its usage, and its cost.

## How routing works

HiRoute offers four routing modes: fixed model, difficulty routing, custom branches, and free first. Each mode uses ordered candidates for bounded failover, and exhaustion fails explicitly rather than silently switching.

- Difficulty routing has regular and primary model groups. The regular group is chosen when the simple-task probability meets the user's threshold and no applicable, complete assessment falls below the competence floor.
- Custom branches first separate task categories such as drafting and review, then use the degree within the category to pick a group.
- Tool continuations within one turn inherit that turn's frozen decision, which helps reuse the KV cache. A new user message triggers a fresh decision that may keep the same model.

## Decision models and evidence

Built-in decision connections (Bailian, OpenRouter Jev, TypeSafe, or a compatible endpoint) return a task category, degree probabilities, and an optional assessment of the prior stage in one call. No self-hosted Jev service is needed. Difficulty routing also supports heuristic rules. A custom extension API with an OpenAPI document is available for teams that want their own judgment or scoring logic. Desktop session views show stage competence scores tied to a plan, revision, model, and execution stage, alongside execution records.

## Agents and delegation

Codex, Claude Code, Qoder, Pi, and DeepSeek Harness are listed as available now. OpenCode, Hermes Agent, and OpenClaw are listed as planned. A main agent can also discover allowed work plans and delegate independent tasks to other agents, and delegation stays separate from model routing.

## Setup path

On macOS 15 or later, install the desktop app. On Linux x86_64 or ARM64, install the current-user CLI and daemon without sudo. Then connect a model source, create and publish a routing plan, and enable HiRoute routing for an agent client. A CLI quickstart command reports the current service state and next steps.

## Features
- Stage-based model routing for long-running agent tasks
- Four routing modes: fixed model, difficulty routing, custom branches, free first
- Built-in decision model connections for task judgment and prior-stage assessment
- Bounded failover across ordered candidates
- KV cache-aware decision reuse across tool continuations
- Per-session view of actual model, usage, and cost
- Stage competence scoring linked to execution records
- Agent work plans and task delegation to other agents
- Custom decision extension API with OpenAPI document
- Desktop app and headless CLI/daemon

## Integrations
Codex, Claude Code, Qoder, Pi, DeepSeek Harness, Bailian, OpenRouter Jev, TypeSafe

## Platforms
MACOS, LINUX, CLI, API

## Pricing
Open Source

## Version
0.3.1

## Links
- Website: https://hiroute.ai
- Documentation: https://hiroute.ai/en/docs/
- Repository: https://github.com/higress-group/HiRoute
- EveryDev.ai: https://www.everydev.ai/tools/hiroute
