Execution-aware routing for coding agents

CodeRoute

An OpenAI-compatible routing brain that classifies each coding step, chooses the cheapest capable model, escalates when execution feedback says the work is risky, and uses local CodeGraph impact signals before spending premium tokens.

Built for full coding sessions, not isolated prompts.

CodeRoute optimizes cost per successful software task by watching step type, budget, prior failures, repo impact, provider health, and feedback from tests or users.

01

Client calls one alias

Agents use `coding-auto` through the OpenAI-compatible API.

02

CodeRoute classifies

The request becomes a coding step with difficulty and risk.

03

CodeGraph adds context

Optional local analysis spots broad or high-impact changes.

04

LiteLLM executes

Provider routing stays normalized across cloud and local models.

05

Feedback escalates

Failures and outcomes shape the next model decision.

Cheap when possible. Strong when it matters.

The system keeps lightweight tasks on inexpensive or local capacity, while security reviews, architecture decisions, multi-file refactors, and high-impact repo changes route up faster.

1

OpenAI-compatible endpoint

Existing coding tools can point at `/v1`.

4

Routing tiers

Local, cheap, balanced, and strong models.

0

Source sent to CodeGraph

CodeGraph runs locally against an index.

The homelab stack behind the route.

Small, inspectable pieces with clear jobs: API, ledger, provider gateway, deploy path, edge route, and repo intelligence.

FastAPI

Serves the OpenAI-compatible API, feedback endpoints, health checks, and this page.

PostgreSQL

Stores sessions, routing decisions, feedback, cost estimates, and model registry data.

LiteLLM

Normalizes model calls across OpenRouter, direct APIs, and local model servers.

CodeGraph

Provides optional local impact signals from a pre-indexed repository graph.

Dokploy

Pulls the GitHub repo and redeploys the Docker compose stack on push.

Cloudflare Tunnel

Publishes `coderoute.pchomelab.com` to the pchomelab host without opening inbound ports.

Useful endpoints.

Human landing page on `/`, machine metadata on `/meta`, and OpenAI-compatible model access under `/v1`.

GET /healthservice status
GET /metaservice metadata
GET /harnessesclient setup
GET /model-planrouting plan
GET /v1/modelsmodel aliases
POST /v1/chat/completionsrouting proxy
POST /v1/coderoute/feedbackoutcomes
GET /v1/coderoute/usagesession cost