KeiRouter
A self-hostable AI gateway written in Go that routes AI coding tools to one local endpoint, with automatic provider failover, semantic caching, budget limits and guardrails.
KeiRouter sits in front of AI coding tools such as Claude Code, Cursor and Cline, giving them one local endpoint that speaks OpenAI or Anthropic's API and translates requests to whichever provider is actually configured behind it. It routes requests across providers with fallback chains that keep working when a provider is down or rate limited, and uses an embedding-powered semantic cache to answer repeated questions without another model call.
Cost controls include per-key and per-organization USD and token budgets with automatic cutoffs, and rate limiting by requests, tokens and concurrency through reusable plans. Guardrails detect PII, prompt injection, toxicity, restricted topics and bias at the global, provider, model, chain or key level, including mid-stream scanning of output, with a fully offline mode. Configuration can be exported and imported with encryption for backup or migration between instances.
It ships as a single Go binary using around 20 MB of memory, with a dashboard, and supports connecting tools through OAuth.