goroute

module
v0.2.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 17, 2026 License: MIT

README ΒΆ

⚑ GoRoute

   ______      ____             __       
  / ____/___  / __ \____  __  __/ /____  
 / / __/ __ \/ /_/ / __ \/ / / / __/ _ \ 
/ /_/ / /_/ / _, _/ /_/ / /_/ / /_/  __/ 
\____/\____/_/ |_|\____/\__,_/\__/\___/  
The Ultra-Lightweight LLM Gateway & Multi-Provider Router for Coding Agents

Sub-10ms Latency β€’ < 5MB Idle RAM β€’ Zero-Alloc Cache β€’ 100% Native Pure Go

Go Version NPM Version Release Memory Footprint Platform

Quickstart β€’ Architecture β€’ Supported Agents β€’ Benchmarks β€’ Features β€’ Cheatsheet


⚑ What is GoRoute?

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.


πŸ—οΈ Architecture

                β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                β”‚                     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   β”‚  β”‚   Zero-Alloc Cache    β”‚  β”‚    Multi-Account PKCE Pool    β”‚  β”‚
β”‚  β”‚  OpenAI ⇆ Anthropic   β”‚  β”‚   0ms Repeat Hits     β”‚  β”‚  Antigravity Token Refresh    β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β”‚                                                                                           β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚                        Intelligent Failover & Quota Router                          β”‚  β”‚
β”‚  β”‚              (Auto-cascades across accounts on 429 quota or 503 limits)             β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                               β”‚
               β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
               β–Ό                               β–Ό                               β–Ό
 β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
 β”‚ Google Antigravity Pool   β”‚   β”‚  OpenAI / Claude Direct   β”‚   β”‚  DeepSeek / TokenRouter   β”‚
 β”‚ 4x Accounts β€’ Sonnet 4.6  β”‚   β”‚   OpenAI Compatible API   β”‚   β”‚  Custom Fallback Gateway  β”‚
 β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸš€ Quickstart

1. 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: Go Toolchain
go install github.com/ziuus/goroute/cmd/goroute@latest

2. Connect Your Accounts
Migrate from OmniRoute in 1-Second:
goroute import omniroute

Instantly imports all Antigravity OAuth tokens, custom provider keys, and combo routers into encrypted local storage (~/.goroute/vault.json).

Or sign in fresh with Google Antigravity (PKCE OAuth):
goroute auth login antigravity

3. Connect Any Coding Agent

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 14 supported agents in one click
goroute setup all

4. 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 OmniRoute

Tested on Linux x86_64 under 500 concurrent streaming requests:

Benchmark Metric OmniRoute (Node/Next.js) GoRoute (Pure Go) Efficiency Gain
Idle Memory (RSS) 580 MB – 1,450 MB 5.1 MB 99.1% less RAM
Memory Under 500 Req Load 850 MB – 2.1 GB 16.5 MB 98.0% less RAM
Idle CPU Utilization 1.5% – 6.0% background 0.0% (Sleep until epoll) Zero background waste
Disk Footprint ~180 MB (node_modules) 13 MB (Static single binary) 14x smaller
Cold Startup Time 3,200 ms 11 ms 290x faster
Gateway Port 20128 8128 Collision-free

πŸ€– Supported Coding Agents

goroute setup automatically configures paths, headers, authentication keys, and provider manifests for:

Agent Command Target Config File Features Supported
OpenCode goroute setup opencode ~/.config/opencode/opencode.json Full models catalog, auth.json registration
Claude Code goroute setup claude ~/.claude/settings.json Anthropic /v1/messages protocol + thinking
OpenAI Codex CLI goroute setup codex ~/.codex/goroute.config.toml Custom profile, auto-compaction
Cursor IDE goroute setup cursor ~/.config/Cursor/User/settings.json Custom OpenAI Base URL + /v1/embeddings
Aider goroute setup aider ~/.aider.conf.yml OpenAI base URL + git workflow routing
Cline goroute setup cline ~/.cline/data/secrets.json Act & Plan modes
Roo Code goroute setup roo ~/.roo/settings-import.json Custom OpenAI compatible profile
Continue (cn CLI) goroute setup continue ~/.continue/config.yaml Chat completions + vector embeddings
Kilo Code goroute setup kilo ~/.local/share/kilo/auth.json Custom gateway key
Block Goose goroute setup goose ~/.config/goose/config.yaml OpenAI provider configuration
Charm Crush goroute setup crush ~/.config/crush/crush.json Custom host setup
Qwen Code goroute setup qwen ~/.qwen/settings.json Provider base URL
Google Gemini CLI goroute setup gemini Shell environment snippet Native Gemini CLI forwarding
5dive Fleet goroute setup 5dive Agent fleet configuration Multi-agent profile setup

πŸ’Ž Features

  • Dual-Protocol Gateway:
    • POST /v1/chat/completions (OpenAI format + SSE chunks)
    • POST /v1/messages (Native Anthropic format + content_block_delta SSE streaming)
  • 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.
  • Multimodal Vision & Media:
    • Automatically translates OpenAI image_url data URIs and Anthropic image base64 blocks into Gemini inlineData parts.
  • Smart Quota Cascade:
    • Automatically cascades across all connected Antigravity accounts on HTTP 429 (quota exhausted) or 403 (licensing limits) before falling back to backup providers.
  • Vector Embeddings Proxy:
    • POST /v1/embeddings supported for codebase indexing in Cursor, Continue, and local RAG workflows.
  • Role & Assistant Prefill Normalization:
    • Automatically handles consecutive turns and strips trailing assistant prefill messages to ensure 100% compatibility with Google Cloud Code / Vertex endpoints.

πŸ’» Cross-Platform Matrix

GoRoute provides pre-compiled, optimized static binaries for all major platforms:

Platform Architecture Binary Format Autostart Service
Linux x86_64, arm64 Native ELF systemd user service
macOS Apple Silicon (arm64), Intel (x86_64) Mach-O launchd / CLI
Windows x64, arm64 Native .exe Windows Task / CLI
NPM Wrapper Any Node.js 18+ environment Universal JS runner Auto-detects platform

πŸ“– CLI Cheatsheet

# 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 import omniroute            # Import all accounts & keys from OmniRoute
goroute catalog                     # View 25+ built-in provider presets

πŸ“„ License

MIT Β© ziuus. Designed for developers who love speed.

Directories ΒΆ

Path Synopsis
cmd
goroute command
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL