Fast, featherweight, OpenAI-compatible model-routing gateway written in Go.
1.3K
Go Feather Route is a small Go 1.27.1 gateway for routing chat and embeddings requests to OpenAI-compatible provider endpoints. It gives applications one authenticated boundary for provider credentials, model aliases, request limits, retries, timeouts, and streaming responses.
It is designed for small VMs, edge services, homelabs, containers, and teams that want a focused, standard-library-oriented routing layer without a database, queue, dashboard, or large platform runtime.
Documentation · API reference · Benchmarks · Docker Hub
flowchart LR
client[OpenAI-compatible client] -->|Bearer token| router[Go Feather Route]
router -->|model alias and policy| providerA[Provider endpoint A]
router -->|model alias and policy| providerB[Provider endpoint B]
router -. planned, separate boundary .-> mcp[Thingd MCP connector]
The router does not embed Thingd and does not access databases directly. The planned connector will use the authenticated Thingd MCP boundary when added.
Prerequisites: Go 1.27.1 and provider credentials.
cp .env.example .env
export GOFEATHERROUTE_API_KEY=gateway-key
export OPENAI_API_KEY=your-key
go run ./cmd/go-feather-route
Check health and models:
curl http://127.0.0.1:4000/health/liveliness
curl -H 'Authorization: Bearer gateway-key' \
http://127.0.0.1:4000/v1/models
Send a chat request:
curl http://127.0.0.1:4000/v1/chat/completions \
-H 'Authorization: Bearer gateway-key' \
-H 'Content-Type: application/json' \
-d '{"model":"gpt-4o-mini","messages":[{"role":"user","content":"Say hello."}]}'
Try streaming:
curl -N http://127.0.0.1:4000/v1/chat/completions \
-H 'Authorization: Bearer gateway-key' \
-H 'Content-Type: application/json' \
-d '{"model":"gpt-4o-mini","stream":true,"messages":[{"role":"user","content":"Tell me a short story."}]}'
For local stalled-stream or goroutine investigations, enable the separate loopback-only diagnostics listener:
GOFEATHERROUTE_PPROF_ADDR=127.0.0.1:6060 go run ./cmd/go-feather-route
curl 'http://127.0.0.1:6060/debug/pprof/goroutineleak?debug=1'
Diagnostics are disabled by default and are not available through port 4000. See the health and operations guide before enabling them.
docker run --rm -p 4000:4000 \
-e GOFEATHERROUTE_API_KEY=gateway-key \
-e OPENAI_API_KEY=your-key \
sayanmohsin/go-feather-route:0.1.0
Use Doppler, your deployment secret manager, or an equivalent runtime injector
for production credentials. Never put real credentials in a Dockerfile,
.env.example, committed Compose file, or image layer.
Configuration precedence is supported CLI flags (-config, -addr) → environment → YAML file → safe defaults.
Non-secret defaults belong in config/defaults.yaml; credentials belong in
environment variables and can be injected by Doppler or CI. See the
environment guide and configuration guide.
Model names and provider mappings belong in model_list and route_rules,
not in application code. The same OpenAI-compatible SSE contract can therefore
route DeepSeek, Ollama, OpenAI, or a future provider by configuration.
The benchmark harness compares the Go gateway with a pinned LiteLLM image against the same deterministic fake provider. It records latency, throughput, CPU, memory, I/O, process count, cgroup peaks, and OOM state where the host exposes those measurements. The homepage shows a concise summary; the full benchmark methodology and results explain platform and architecture context before the numbers are interpreted.
A preliminary Thingd Cloud canary returned 10/10 successful chat requests through both gateways and showed lower Go Feather Route p95 latency and streaming time-to-first-byte in that sample. Re-run the documented comparison after changing routes or provider models; the canary is not a substitute for production monitoring. See the Cloud canary results.
Go Feather Route is intended to grow into a small operational boundary for model access: more OpenAI-compatible providers, multimodal requests, per-tenant quotas, usage metrics, health-aware routing, graceful degradation, memory-aware deployment profiles, and a planned Thingd MCP data boundary. The standalone router remains useful without Thingd.
make tools
make check
make bench
See coding standards for the project contract.
Go Feather Route is available under the Apache License 2.0.
Content type
Image
Digest
sha256:8289ddea8…
Size
4.1 MB
Last updated
9 days ago
docker pull sayanmohsin/go-feather-route