The most advanced local AI Gateway. Universal routing, streaming, MCP, A2A, plugins, and a beautiful dashboard.
Agent Nexus Gateway is a production-grade, open-source AI Gateway that sits between your applications and your LLM providers. It gives you a single, OpenAI-compatible API endpoint that intelligently routes requests across multiple providers, with failover, caching, observability, and a real-time dashboard.
It is designed to be the last AI gateway you ever install β flexible enough for a solo developer running Ollama on a laptop, powerful enough to back an enterprise multi-agent platform.
Existing gateways (OpenRouter, LiteLLM, etc.) make tradeoffs that don't fit everyone. Agent Nexus Gateway is built on three principles:
- Local-first. Runs on your machine, your cluster, your air-gapped network. No vendor lock-in.
- Universal. OpenAI-compatible REST, streaming SSE, WebSocket, MCP server, MCP client, A2A protocol β all from one process.
- Honest. No tricks to evade rate limits. No undocumented APIs. Just intelligent routing, retries, failover, and caching on top of providers' official APIs.
- β
OpenAI-compatible REST API (
/v1/chat/completions,/v1/embeddings,/v1/models) - β Streaming support (SSE)
- β WebSocket support (real-time dashboard feed)
- β MCP Server (expose gateway tools to Claude Code, Continue, Cline, etc.)
- β MCP Client (consume external MCP servers and aggregate their tools)
- β A2A Protocol (Agent-to-Agent coordination)
- β
Plugin Framework (lifecycle hooks:
onRequest,onRouteResolved,onProviderStart,onProviderChunk,onProviderEnd,onError,onResponse,onStartup,onShutdown) - β 19 Native Integrations with auto-setup (Claude Code, Codex CLI, Gemini CLI, Hermes CLI, OpenCode, OpenCode Go, OpenCode Zen, Cursor, Continue, Cline, Roo Code, OpenHands, Aider, Zed, VS Code, JetBrains, Neovim, Emacs)
- β Extension Marketplace (browse, install, update, rollback, signature verification)
- π§ Desktop App (planned β Electron shell)
| Provider | Status | Streaming | Tools | Vision | Embeddings |
|---|---|---|---|---|---|
| OpenAI | β | β | β | β | β |
| Anthropic | β | β | β | β | β |
| Google Gemini | β | β | β | β | β |
| OpenRouter | β | β | β | β | β |
| DeepSeek | β | β | β | β | β |
| Mistral | β | β | β | β | β |
| xAI (Grok) | β | β | β | β | β |
| Groq | β | β | β | β | β |
| Together | β | β | β | β | β |
| Fireworks | β | β | β | β | β |
| Cerebras | β | β | β | β | β |
| Cloudflare AI | β | β | β | β | β |
| Ollama | β | β | β | β | β |
| vLLM | β | β | β | β | β |
| LM Studio | β | β | β | β | β |
| LiteLLM | β | β | β | β | β |
| Azure OpenAI | β | β | β | β | β |
| AWS Bedrock | π§ | β | β | β | β |
| Vertex AI | π§ | β | β | β | β |
- Weighted β random selection weighted by
weightfield - Round-robin β fair distribution
- Least latency β EWMA latency per endpoint
- Least cost β minimize $/1K tokens
- Highest quality β prefer high-priority endpoints
- Capability matching β filter by required capabilities (vision, tools, etc.)
- Priority β strict priority ordering
- Budget-aware β stay within remaining budget
Plus:
- β Automatic failover with up to N alternatives
- β
Circuit breakers (open after
failureThresholdretryable errors infailureWindowMs) - β Retries with exponential backoff
- β Health monitoring (active probes + passive observation)
- β Fallback chains
- β Connection pooling (via Node's fetch)
- β Affinity routing (sticky sessions)
- β Streaming (SSE)
- β
Prompt caching (provider-side, e.g. Anthropic
cache_control) - β Semantic cache (vector similarity via cosine)
- β Compression (prompt compression: system dedup, stop-words, schema, summarization)
- β Token optimization (character-based estimation; tiktoken integration planned)
- β Connection pooling
- π§ Batching (Anthropic batching API)
- π§ Request deduplication
- π§ Parallel execution
- β Real-time metrics via WebSocket
- β Token usage charts
- β Cost analytics
- β Latency graphs
- β Provider health table
- β Request logs (live event feed)
- β Audit log viewer
- β Network diagnostics page
- π§ Workflow editor (drag-and-drop)
- β Plugin manager UI
- β Settings
- π§ User management
- β Dark mode
- β API Keys management (multi-key per provider, intelligent rotation)
- β Router Studio (visual routing config, alias management)
- β Budget tracking
- β Cost analytics
- β Request tracing
- β
HTTP / HTTPS / SOCKS5 proxy support (via undici
ProxyAgent) - β Latency measurement
- β Health-check endpoints
- β Automatic failover between proxies
- β DNS over HTTPS (Cloudflare, Google, custom)
- β IPv4 / IPv6 support
- β Enterprise proxy authentication (basic auth in URL)
- β Connection diagnostics
- β Encrypted credential vault (AES-256-GCM at rest, scrypt-derived key)
- β RBAC with wildcard permissions
- β JWT (HS256; RS256 planned)
- π§ OAuth2 (planned)
- β Audit logs
- β Secrets management
- β Zero Trust architecture
- β Workflow engine (multi-step agent workflows with pause/resume/replay)
- β
Multi-agent orchestration (via
@anx/a2aβ in-process; planner/executor/critic roles planned) - β Memory (short-term + long-term with vector search, Qdrant adapter)
- π§ Prompt templates
- β Tool calling (passthrough)
- β Function calling (passthrough)
- β Vision (full translation for Anthropic + Gemini)
- π§ Audio
- π§ Speech (TTS)
- β Embeddings
- π§ RAG
- π§ Knowledge graphs
- β Agent coordination (A2A protocol β message routing, teams, proposals)
- π§ OpenTelemetry (interface ready; OpenTelemetry SDK integration planned)
- β
Prometheus metrics endpoint (
/metrics) - π§ Grafana dashboards (dashboard JSON in
deploy/grafana/) - β
Distributed tracing (in-process request tracer with
/v1/traces) - β Structured logs (JSON to stdout)
- β
Metrics (counters, gauges, histograms, unified
/v1/metricsendpoint) - π§ Alerts (Alertmanager rules planned)
- β
Health endpoints (
/health)
Windows (PowerShell):
irm https://raw.githubusercontent.com/rachidSabah/codingghosts/main/scripts/install.ps1 | iexLinux / macOS / WSL:
curl -fsSL https://raw.githubusercontent.com/rachidSabah/codingghosts/main/scripts/install.sh | bashThe installer automatically:
- Installs Node.js 22+ (via nvm/winget if missing)
- Installs pnpm
- Clones the repo
- Installs all dependencies
- Builds all packages
- Registers the
anxCLI globally - Starts the gateway (background, 127.0.0.1:8787)
- Starts the dashboard (background, localhost:3000)
- Verifies health
- Detects coding agents
- Opens the dashboard in your browser
After installation:
- Gateway: http://127.0.0.1:8787
- Dashboard: http://localhost:3000
- CLI:
anx doctor(diagnostics),anx models --free(free models),anx integrations install --all(auto-configure coding agents)
# Clone
git clone https://github.com/rachidSabah/codingghosts.git
cd codingghosts
# Set at least one provider key
export OPENAI_API_KEY=sk-...
# Run
docker compose up
# Gateway: http://localhost:8787
# Dashboard: http://localhost:3000# Requires Node 22+ and pnpm 9+
corepack enable
pnpm install
pnpm build
# Start gateway
pnpm --filter @anx/gateway start
# In another terminal, start dashboard
pnpm --filter @anx/dashboard dev# Drop-in replacement for OpenAI API
curl http://localhost:8787/v1/chat/completions \
-H 'Content-Type: application/json' \
-d '{
"model": "gpt-4",
"messages": [{"role": "user", "content": "Hello!"}]
}'// Or use the SDK
import { NexusClient } from '@anx/sdk';
const client = new NexusClient({
baseUrl: 'http://localhost:8787',
apiKey: process.env.NEXUS_API_KEY,
});
const response = await client.chat.completions.create({
model: 'gpt-4',
messages: [{ role: 'user', content: 'Hello!' }],
});# Install
pnpm --filter @anx/cli build
ln -s $(pwd)/packages/cli/dist/bin.js /usr/local/bin/anx
# Chat
anx chat --model gpt-4 --message "Hello, world"
# List providers
anx providers list
# Health check
anx healthThe gateway ships with 19 native integrations that auto-configure AI tools to route through it:
# List all integrations + their status
anx integrations list
# Configure Claude Code to use the gateway (writes ~/.claude/settings.json)
anx integrations install claude-code
# Configure OpenCode + OpenCode Go + OpenCode Zen together
anx integrations install opencode opencode-go opencode-zen
# Configure every installed tool in one shot (idempotent)
anx integrations install --all
# Verify a tool can reach the gateway
anx integrations verify claude-code| CLI tools | Editors | IDEs |
|---|---|---|
claude-code |
cursor |
vscode |
codex-cli |
continue |
jetbrains |
gemini-cli |
cline |
|
hermes-cli |
roo-code |
|
opencode |
zed |
|
opencode-go |
neovim |
|
opencode-zen |
emacs |
|
aider |
||
openhands |
See docs/INTEGRATIONS.md for the full table and per-tool config paths.
π‘ Prefer automation? Use
anx integrations install claude-code(or--all) instead of editing config files by hand. See docs/INTEGRATIONS.md.
See docs/ARCHITECTURE.md for the full design. TL;DR:
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Dashboard (Next.js) β
βββββββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββ
β WebSocket + REST
βββββββββββββββββββββββββββββ΄ββββββββββββββββββββββββββββββ
β Gateway (Fastify, port 8787) β
β ββββββββββββ ββββββββββββ ββββββββββββ βββββββββββ β
β β REST API β β SSE β β WS β β MCP β β
β ββββββ¬ββββββ ββββββ¬ββββββ ββββββ¬ββββββ ββββββ¬βββββ β
β βββββββββββββββ΄ββββββββββββββ΄ββββββββββββββ β
β β β
β ββββββββββ΄βββββββββ β
β β ChatCompletion β β
β β Use Case β β
β ββββββββββ¬βββββββββ β
β βββββββββββββββββββΌββββββββββββββββββ β
β β β β β
β ββββββ΄βββββ ββββββββ΄βββββββ βββββββ΄ββββββ β
β β Routing β β Plugins β β Failover β β
β β Engine β β Runtime β β β β
β ββββββ¬βββββ βββββββββββββββ βββββββββββββ β
β β β
β ββββββ΄βββββββββββββββββββββββββββββββββββββββββββββ β
β β Provider Adapters β β
β β OpenAI Β· Anthropic Β· Google Β· DeepSeek Β· ... β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββ β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
agent-nexus-gateway/
βββ apps/
β βββ gateway/ # Fastify HTTP server (the gateway itself)
β βββ dashboard/ # Next.js dashboard
β βββ desktop/ # Electron app (planned)
βββ packages/
β βββ core/ # Hexagonal core: domain, ports, use cases
β βββ providers/ # 17 provider adapters
β βββ routing/ # Routing engine extensions
β βββ plugins/ # Plugin framework
β βββ integrations/ # 19 native tool integrations (Claude Code, OpenCode, β¦)
β βββ networking/ # Proxy, DoH, diagnostics
β βββ security/ # Vault, RBAC, JWT
β βββ observability/ # Telemetry, Prometheus, structured logs
β βββ mcp-server/ # MCP server
β βββ mcp-client/ # MCP client
β βββ a2a/ # Agent-to-Agent protocol
β βββ cli/ # CLI
β βββ sdk/ # TypeScript SDK
β βββ shared/ # Common utilities
βββ deploy/
β βββ docker/ # Dockerfile + Prometheus config
β βββ k8s/ # Kubernetes manifests
β βββ helm/ # Helm chart
βββ docs/ # Architecture, roadmap, API docs
βββ .github/ # CI, issue templates, SECURITY.md, CONTRIBUTING.md
βββ Dockerfile
βββ docker-compose.yml
βββ package.json
βββ pnpm-workspace.yaml
βββ turbo.json
βββ tsconfig.base.json
- Architecture
- Roadmap
- API Reference
- Plugin Development
- Provider Adapters
- Routing Strategies
- Security
- Contributing
See docs/ROADMAP.md. Highlights:
- 0.2 β Semantic cache, prompt cache (Anthropic
cache_control), OpenTelemetry SDK integration - 0.3 β Workflow engine v1, RAG, MCP marketplace
- 0.4 β Multi-agent orchestration UI, knowledge graphs
- 0.5 β AWS Bedrock, Vertex AI adapters
- 1.0 β Stable API, desktop app, extension marketplace
| Feature | Agent Nexus Gateway | OmniRoute | Free Claude Code |
|---|---|---|---|
| Architecture | Hexagonal + DDD | Monolithic | Single-purpose |
| OpenAI-compat API | β | β | β |
| Streaming | β | β | β |
| WebSocket | β | β | β |
| MCP Server | β | β | β |
| MCP Client | β | β | β |
| A2A | β | β | β |
| Plugin framework | β | β | β |
| Dashboard | β | β | β |
| CLI | β | β | β |
| Docker | β | β | β |
| Kubernetes | β | β | β |
| RBAC | β | β | β |
| Encrypted vault | β | β | β |
| Audit log | β | β | β |
| Proxy support | β | β | β |
| 17 provider adapters | β | ~10 | 1 |
| Honest (no limit evasion) | β | β | β |
Windows (PowerShell):
irm https://raw.githubusercontent.com/rachidSabah/codingghosts/main/scripts/uninstall.ps1 | iexLinux / macOS / WSL:
curl -fsSL https://raw.githubusercontent.com/rachidSabah/codingghosts/main/scripts/uninstall.sh | bashOr manually:
# Stop processes
pkill -f 'node.*gateway/dist/bin'
pkill -f 'next dev'
# Remove files
rm -rf ~/.agent-nexus/codingghosts
rm -f ~/.local/bin/anx
# Windows PowerShell:
# Stop-Process -Name node -Force
# Remove-Item -Recurse -Force "$env:USERPROFILE\.agent-nexus"
# Remove-Item "$env:USERPROFILE\.local\bin\anx.cmd"Node.js and pnpm are left installed (remove manually if needed).
Apache-2.0. See LICENSE.
Built on the shoulders of giants. Inspired by:
- LiteLLM β for the OpenAI-compat abstraction idea
- OpenRouter β for the routing-as-a-service model
- Anthropic's MCP β for the protocol design
- Fastify β for the best Node.js HTTP framework
- Next.js β for the dashboard framework