
Show HN: GoRoute – Native Go LLM Gateway for Coding Agents (< 12MB RAM)
Sub-10ms Latency • < 12MB RAM • 35 CLI Agents • A2A Protocol • Zero Node.js Overhead
以下正文同步自 Hacker News 最新,版权归原站所有,已转换为易读排版。
Sub-10ms Latency • < 12MB RAM • 35 CLI Agents • A2A Protocol • Zero Node.js Overhead
Quickstart • Architecture • Supported Agents • Benchmarks • Features • Cheatsheet
GoRoute is an ultra-fast, single-binary LLM gateway engineered specifically for developers using autonomous AI coding agents (OpenCode, Claude Code, Cursor, Codex CLI, Aider, Cline, etc.).
Instead of running bloated Node/Electron proxies that consume 600MB to 1.5GB of RAM, GoRoute delivers identical multi-provider pooling, Google Antigravity OAuth rotation, Anthropic-to-OpenAI protocol normalization, and response caching inside a tiny 5.1MB footprint.
┌─────────────────────────────────────────────────────────────┐ │ YOUR CODING AGENTS │ │ OpenCode • Claude Code • Cursor • Codex CLI • Aider • Roo │ └──────────────────────────────┬──────────────────────────────┘ │ http://127.0.0.1:8128 (OpenAI /v1 & Anthropic /v1/messages) │ ▼ ┌───────────────────────────────────────────────────────────────────────────────────────────┐ │ ⚡ GOROUTE CORE │ │ │ │ ┌───────────────────────┐ ┌───────────────────────┐ ┌───────────────────────────────┐ │ │ │ Dual-Protocol SSE │ │ 55 RTK Filters │ │ Session Account Affinity │ │ │ │ OpenAI ⇆ Anthropic │ │ 70-90% Noise Cut │ │ Prompt Cache Preservation │ │ │ └───────────────────────┘ └───────────────────────┘ └───────────────────────────────┘ │ │ │ │ ┌─────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ Autonomous Token Health Scheduler & Router │ │ │ │ (Cascades across accounts on 429 quota or 503 limits; proactive refresh) │ │ │ └─────────────────────────────────────────────────────────────────────────────────────┘ │ └──────────────────────────────────────────────┬────────────────────────────────────────────┘ │ ┌───────────────────────────────┼───────────────────────────────┐ ▼ ▼ ▼ ┌───────────────────────────┐ ┌───────────────────────────┐ ┌───────────────────────────┐ │ Google Antigravity Pool │ │ AWS CodeWhisperer (Kiro) │ │ OpenAI / Codex Direct │ │ Multi-Account • Sonnet │ │ Context Auto-Pruning │ │ OpenAI Compatible API │ └───────────────────────────┘ └───────────────────────────┘ └───────────────────────────┘
🚀 Quickstart
- Install (Choose One)
📦 Option A: via npm / npx (Zero Go needed)
npm install -g goroute
Or run directly via npx:
npx goroute setup opencode
⚡ Option B: 1-Line Native Installer (Linux & macOS)
curl -fsSL https://raw.githubusercontent.com/ziuus/goroute/main/install.sh | bash
🍺 Option C: Homebrew (macOS & Linux)
brew install ziuus/goroute/goroute
🛠️ Option D: Go Toolchain
go install github.com/ziuus/goroute/cmd/goroute@latest
- Connect Your Accounts
Sign in with Google Antigravity (PKCE OAuth):
goroute auth login antigravity
Securely links your Antigravity accounts into GoRoute's encrypted local storage (~/.goroute/vault.json).
Auto-configure your favorite agent with one command:
Configure OpenCode (writes config + registers provider credentials)
goroute setup opencode
Configure Claude Code
goroute setup claude
Configure OpenAI Codex CLI
goroute setup codex
Configure ALL 18 supported agents in one click
goroute setup all
- Run Seamlessly
Run GoRoute as a background service:
Enable Linux background autostart (systemd user unit, ~5MB RAM):
goroute autostart enable
Verify gateway status:
goroute status
Or launch any agent with zero configuration using the universal proxy injector:
goroute run opencode goroute run claude goroute run aider --model openai/claude-3-7-sonnet
📊 Benchmarks vs Traditional Gateways
Tested on Linux x86_64 under 500 concurrent streaming requests:
goroute setup automatically configures paths, headers, authentication keys, and provider manifests for:
Universal Multi-Protocol Gateway:
POST /v1/chat/completions (OpenAI format + SSE chunks)
POST /v1/messages (Native Anthropic format + content_block_delta SSE streaming)
POST /api/chat (Native Ollama emulation)
GET /mcp (Model Context Protocol native SSE server)
GET /.well-known/agent.json & POST /api/a2a/tasks (A2A Protocol v0.3)
Zero-Alloc In-Memory Cache:
Repeated agent queries (e.g. title generation, linters, duplicate prompts) hit the internal cache and return X-Cache: HIT with 0ms latency and 0 upstream tokens.
DuckDuckGo Web Search & Readability Scraper:
Built-in POST /v1/web/fetch and GET/POST /v1/search with zero API keys required. Converts fetched HTML to clean GitHub-flavored Markdown.
Smart Quota Cascade & Multi-Account Pools:
Dynamically rotates across accounts with configurable strategies: Priority / Failover, Round-Robin, and Fair-Share.
Automatically isolates accounts on HTTP 429 quota exhaustion or 402 billing limits with proactive token cooldowns.
Context Pruning & Token Optimization:
Single-pass $O(N)$ integer pruning algorithm trims duplicate prompt prefixes and keeps multi-turn transcripts within upstream limits without dropping active agent instructions.
🤝 Contributing & Good First Issues
We welcome contributors! Check out our open Good First Issues:
GoRoute provides pre-compiled, optimized static binaries for all major platforms:
Gateway Management
goroute serve # Start gateway server (port 8128) goroute serve --no-dashboard # Headless mode (< 10MB RAM) goroute autostart enable # Enable system background service goroute autostart status # Check service status goroute autostart disable # Stop & disable service goroute status # Health check & model listing
Agent Setups
goroute setup all # Configure all 14 coding agents goroute setup <agent> # Configure a specific agent (e.g. opencode, claude) goroute run <agent> [args...] # Launch agent with proxy env variables
Providers & Accounts
goroute auth login antigravity # Interactive PKCE OAuth login goroute auth list # List connected provider accounts goroute catalog # View 25+ built-in provider presets
📄 License
MIT © ziuus. Designed for developers who love speed.
正文由 探How 从来源站点 RSS 同步,内容未经改写;遇到排版缺失或需要图片、视频时请以原文为准。