huifer

Local Router — AI skill for Claude Code

AI community

A local AI gateway for coding agents, with provider routing, protocol translation, console, and CLI.

How to install Local Router

This entry records only its repository, not the path inside it, so there is no exact command to give. Open huifer/local-router and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

What Local Router does

A local AI gateway for coding agents, with provider routing, protocol translation, console, and CLI.

Alternatives in AI

  • CliRelay — Self-hosted AI gateway for coding CLIs — one OpenAI/Claude/Gemini/Codex-compatible endpoint, with a multi-tena 1k ★
  • My Free Code — Open-source multi-provider AI gateway for Claude Code and other coding agents, with model routing, streaming 633 ★
  • NeoRead — NeoRead: a local-first EPUB/PDF reader with annotations, side-by-side translation, and AI assistance through C 294 ★

README

local-router

[English](#english) · [中文](#中文)

English

local-router is a local AI gateway that puts multiple model providers behind one process and gives coding agents (Claude Code, Codex, Gemini CLI, OpenCode, and any client that accepts a base URL) one routed, observable API.

Highlights

  • One Rust binary: gateway, React console, and CLI.
  • Protocol translation: OpenAI Chat, OpenAI Responses, Anthropic Messages, and Gemini, including streaming, tools, reasoning blocks, and token usage.
  • Routing groups: ordered failover, rotation, usage-aware, smart, and weighted routing, with sticky sessions, nested groups, and multiple keys.
  • Multi-node deployment: run one gateway per machine and cascade them — point a provider at another local-router (or any OpenAI/Anthropic/Gemini-compatible endpoint) to route through an overseas egress, with unified routing, failover, cooldowns, and one trace across hops. Bare model ids resolve when exactly one provider serves them, so every node can keep the same model names. Each node is remotely manageable over its own console API (--lan + a caller key + your reverse proxy): full config snapshots move between nodes with export/import and optimistic concurrency, local-router remote … queries another node's state, per-node rate limits keep hot nodes in check, and every node exposes /metrics for Prometheus. See examples/multi-machine and USAGE.md § 8.
  • Monitoring & tracing exports: a Prometheus /metrics endpoint for live state — requests, in-flight, cooldowns, token throughput, p99 latency — and an optional OTLP export (cargo build --features otlp) that mirrors the session span tree to Tempo/Jaeger.
  • Session-backed providers: WorkBuddy and QwenWork without API keys, with account pools, renewal, quota visibility, and check-in support.
  • Console: provider, model, route, usage, session, project, conte