ferro-labs /ai-gateway
Unified AI Gateway for 30+ LLMs (OpenAI, Anthropic, Bedrock, Azure etc) with Caching, Guardrails, A/B test & cost controls. Go-native Fastest & Scalable AI Gateway LiteLLM & Kong AI Gateway alternative.
★ 301⑂ 39👁 6⑃ 315● 141▤ 74
+0
Daily
301
stars
39
forks
6
watchers
315
prs
141
issues
74
releases
README
English | 中文
Ferro Labs AI Gateway
Open-Source, OpenAI-Compatible LLM Gateway
High-performance AI gateway in Go. Route LLM requests across 30 providers via a single OpenAI-compatible API.
📖 Documentation: docs.ferrolabs.ai
🔀 30 providers, 2,500+ models — one API
⚡ 13,925 RPS at 1,000 concurrent users (v1.0.0 benchmark)
📦 Single static binary, no external services required, 32 MB base memory
---
Quick Start
Under two minutes from install to first response.
| Platform / tool | Install |
|:---|:---|
| macOS, Linux | curl -fsSL https://get.ferrolabs.ai \| sh |
| Windows | irm https://get.ferrolabs.ai/install.ps1 \| iex |
| Homebrew | brew install ferro-labs/tap/ferrogw |
| Scoop | scoop bucket add ferrolabs https://github.com/ferro-labs/homebrew-tap then scoop install ferrogw |
| npm | npm install -g ferrogw |
| Python | uv tool install ferrogw |
| Docker | docker run -p 8080:8080 ghcr.io/ferro-labs/ai-gateway:latest |
| Go | go install github.com/ferro-labs/ai-gateway/cmd/ferrogw@latest — builds from source, without the dashboard |
| Debian, RPM, Alpine | .deb, .rpm and .apk packages on the releases page |
Then go from nothing to a served request:
bash
export OPENAI_API_KEY=sk-your-key ferrogw init detects this and writes the matching target
ferrogw init writes config.yaml, prints your master key
export GATEWAY_CONFIG=./config.yaml the server reads a config file only when this is set
export MASTER_KEY=fgw_your-master-key the key ferrogw init printed
ferrogw serve starts the server on :8080
ferrogw init prints the master key once and never writes it to disk — save
it yourself, in your .env file or a secret manager.
Docker runs the server itself, so there is no ferrogw init to print a master
key — choose your own. Pass both variables by name so their values stay off the
command line, where ps would show them:
bash
export OPENAI_API_KEY=sk-your-key
export MASTER_KEY=fgw-any-strong-secret-you-choose
docker run -p 8080:8080 -e OPENAI_API_KEY -e MASTER_KEY ghcr.io/ferro-labs/ai-gateway:latest
Passing them by name keeps the values out of process arguments only — they are
still readable in the container's environment and through docker inspect, so
use Docker secrets or your platform's secret storage in production.
First request
bash
export MASTER_KEY=fgw_your-master-key the key ferrogw init printed, in whichever shell you curl from
curl http://localhost:8080/v1/chat/completions \
-H "Authorization: Bearer $MASTER_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-4o-mini",
"messages": [{"role": "user", "content": "Hello from Ferro Labs AI Gateway"}]
}' | jq
Every release is signed with keyless cosign and ships an SPDX SBOM —
verification steps are in SECURITY.md.
---
Why Ferro Labs AI Gateway
AI gateways differ most under load, in throughput, latency and memory. Ferro Labs AI Gateway is written in Go frTop issues
#360mcp: migrate to the official Go MCP SDK3 comments · 2026-07-21#361mcp: restart a crashed stdio server with backoff2 comments · 2026-07-21#208feat(plugin): streaming-aware stage + optional StreamInspector (additive)2 comments · 2026-06-18#358mcp: a Streamable HTTP server that dies after initialization is never detected1 comments · 2026-07-21#245feat(providers): add NeuralWatt energy-efficient inference provider1 comments · 2026-06-28#244feat(strategies/cost): add CapabilityAggregator to prevent opaque-cost misrouting in CostOptimized1 comments · 2026-06-28#451Plugin pattern: external source-rights evidence before MCP tool execution0 comments · 2026-10-06#427Dashboard: move admin session token from sessionStorage to an HttpOnly cookie0 comments · 2026-09-03
Discussions
#179Which framework integration should AI Gateway prioritize next?0 comments · 2026-06-02#178What cookbook recipes should AI Gateway publish next?3 comments · 2026-06-02#177Which observability bridge should AI Gateway ship first?0 comments · 2026-06-02#176RFC: v1.5 Plugin SDK for AI Gateway1 comments · 2026-06-02#42Welcome to ai-gateway Discussions!0 comments · 2026-03-12
Latest release
v1.6.1 v1.6.1 2026-11-15[1.6.1] — 2026-11-15 Security fixes for v1.6.1. No API, configuration, or dashboard sign-in changes. Building the gateway, or a module that imports it, now needs Go 1.26.11 or later. Security - Go 1.26.10 → 1.26.11 fixes GO-2026-6859 (CVE-2026-97054): an HTTP/1 server using MaxBytesReader could panic when an over-limit body read raced with a response-header write. CI, release builds and the Docker build use the patched toolchain. - OpenTelemetry v1.45.0 → v1.47.0 fixes GHSA-q7gw-24fr-5p69: strings containing Unicode replacement characters could bypass attribute length limits. The