GoModel 推出開源 AI 閘道,集中管理模型供應商與使用費用
Show HN: GoModel – an open-source AI gateway – LiteLLM alternative
應用程式接上多家 AI 服務時,切換供應商、追查費用和處理故障可能都得改程式。
- GoModel 是用 Go 寫的開源 AI 閘道,提供 OpenAI 和 Anthropic 相容的 API,讓原有程式多半隻要更改連線網址,就能透過同一個入口使用不同供應商,也能設定快取、預算、用量追蹤和故障轉移。它支援 38 家供應商,並提供管理介面與請求紀錄。網站列出的 2026 年 9 月測試中,GoModel 和 LiteLLM 在延遲、處理量、記憶體用量及啟動時間都有差異。
- GoModel 支援的供應商則較少。
AI 伴隨問答
針對這篇報導有疑問?可直接點選快捷問題或向 AI 追問背景脈絡與技術細節:
The last AI Gateway
you will ever need
Like OpenRouter, but open-source and self-hosted
Why GoModel
Problems GoModel Solves
When provider switching, debugging, and usage tracking start leaking into application code, GoModel moves that logic into one gateway layer.
Coupled to one provider
Switching vendors shouldn't be a code project. One stable API decouples provider choice from your app - swap models with a config change.
One behavior doesn't fit every team or app
One path needs cache, another audit, another guardrails. Scoped workflows set behavior per provider, model, or user path.
The same prompts burn budget twice
Identical requests shouldn't pay full price twice. Exact-match response caching returns duplicates faster and cheaper.
Costs nobody can attribute
Provider dashboards show one total. Per-request usage tracking maps spend to teams, tenants, and features.
Incidents nobody can reconstruct
A fallback fired and nobody knows why. Audit logs and runtime metadata make every request traceable.
The gateway becomes its own project
Running the gateway shouldn't out-scale running the app. One binary with a built-in admin UI and storage that grows with the workload.
How It Works
How GoModel Works
GoModel authenticates each request, applies the matching workflow - guardrails, cache, budgets, rate limits - and routes it to the right provider with automatic failover, behind OpenAI- and Anthropic-compatible APIs.
POST /v1/chat/completionsPOST /v1/responsesPOST /v1/messages
OpenAI- and Anthropic-compatible. Change the base URL, keep your SDK.
SSE streamingPrometheus /metricsSQLite / Postgres / MongoDB
Features
What the gateway does
The six features teams adopt GoModel for first. Everything ships in the single open-source binary.
38 Providers, One API
OpenAI, Anthropic, Gemini, Bedrock, Azure, Groq, Ollama, vLLM, and more behind one endpoint.
Aliases & Virtual Models
Publish stable names like smart-chat and remap the model behind them without touching application code.
Automatic Failover
Retries, circuit breakers, and failover chains turn a provider incident into a routing event.
Budgets
Per-key and per-team budgets with rate limits, so spend stops where you set the line.
Usage & Cost Tracking
Tokens and cost per request, user, and tag, ready for chargeback or a Prometheus dashboard.
Audit Logs
Replay any request: resolved route, guardrail versions, provider attempts, and admin changes.
Quick Start
Quick Start: Deploy GoModel
Launch GoModel, open the dashboard, and send your first OpenAI-compatible request in three steps.
1
Install and run GoModel
Run it with Docker - standalone or as the full local stack with Docker Compose - or install the binary with one command.
docker run --rm -p 8080:8080 \
-e LOG_FORMAT=text \
-v gomodel_data:/app/data \
enterpilot/gomodelcurl -fsSL https://gomodel.enterpilot.io/install.sh | sh
gomodelirm https://gomodel.enterpilot.io/install.ps1 | iex
gomodelcp .env.template .env
# Add your API keys to .env
docker compose --profile app up -d2
Open the dashboard
Inspect models, aliases, workflows, usage, cache, and audit logs in the admin UI once the gateway is running.
3
Send your first API call
Keep the OpenAI-compatible request shape and point it at GoModel.
API Call
curl http://localhost:8080/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-5-chat-latest",
"messages": [{
"role": "user",
"content": "Hello!"
}]
}'Already using an OpenAI SDK? Change base_url and keep the rest of your code.
Python OpenAI SDK
from openai import OpenAI
client = OpenAI(
base_url="http://localhost:8080/v1",
api_key="your-gomodel-key",
)FAQ
GoModel FAQ
Common questions about deployment, provider switching, GoModel as a LiteLLM alternative, local models via Ollama, vLLM, and LM Studio, caching, usage tracking, and the roadmap.
What is GoModel?
GoModel is an open-source AI gateway written in Go and released under the MIT license. Your apps talk to one OpenAI- and Anthropic-compatible endpoint, and the gateway handles provider routing, model aliases, scoped workflows, caching, failover, budgets, rate limits, audit logs, and usage tracking behind it. It ships as a single small binary with an embedded admin dashboard, so there is nothing else to deploy.
Can I keep using the OpenAI or Anthropic SDK with GoModel?
Yes - in most cases you only change the base URL. GoModel serves the OpenAI API (/v1/chat/completions, /v1/responses, embeddings, files, batches) and the Anthropic Messages API (/v1/messages) natively, so the OpenAI SDK, the Anthropic SDK, and plain HTTP clients all keep working while routing, caching, and usage visibility move into the gateway.
Which AI providers and models does GoModel support?
38 providers, including OpenAI, Anthropic, Google Gemini and Vertex AI, Azure OpenAI, Amazon Bedrock, OpenRouter, Cohere, Groq, xAI, DeepSeek, and open models through Ollama, vLLM, SGLang, and llama.cpp. GoModel reads hundreds of models from live provider catalogs. You can register multiple API keys per provider for round-robin rotation, and any other OpenAI-compatible backend can join as its own provider instance.
How does GoModel compare to LiteLLM?
In the reproducible September 2026 benchmark on the same AWS box, GoModel answered in 2.22 ms at the median vs 55.76 ms, sustained 4,498 req/s vs 220, peaked at 73.6 MB of RAM vs 1,488 MB, and cold-started in 0.81 s vs 26.77 s. LiteLLM still supports more providers today - the trade-off is runtime footprint on the request path, which matters most at high volume, on small machines, or in front of fast local models.
What do scoped workflows control?
A workflow toggles cache, audit logging, usage tracking, budgets, guardrails, and failover per provider, model, or user path - the most specific matching scope wins. Workflow versions are immutable, so you can see exactly which policy a given request ran under. One gateway, different runtime policies for different workloads.
Does GoModel cache LLM responses?
Yes, two ways. Exact-match caching returns identical non-streaming requests straight from the gateway - no provider call, no cost. Semantic caching goes further by matching similar prompts, backed by Qdrant, pgvector, Pinecone, or Weaviate. Cache lookups run after alias and workflow resolution, so policy decisions still apply, and cache hits are visible in the dashboard.
Can I track AI usage and cost per team, tenant, or feature?
Yes. Tag requests with X-GoModel-User-Path or labels from virtual API keys, and GoModel records tokens and dollar cost per request against that path. The dashboard breaks spend down by team, tenant, model, and label, pricing overrides keep numbers accurate when your contract differs from list prices, and budgets enforce hard spend limits before a request is ever dispatched.
What happens when a provider goes down?
GoModel retries with backoff, trips a circuit breaker on repeated failures, and fails over to the next configured model or provider - skipping routes that are rate-limited or saturated. Every attempt lands in the audit log with the resolved route, so an outage becomes a routing event you can reconstruct rather than a mystery.
Can I use GoModel with local models via vLLM, Ollama, or LM Studio?
Yes - point OLLAMA_BASE_URL or VLLM_BASE_URL at your server and local models sit behind the same endpoint as the cloud providers. LM Studio, llama.cpp, and similar servers connect the same way through their OpenAI-compatible endpoints. Because the gateway itself is a 21 MB image that peaks at about 74 MB of RAM under load, it is cheap enough to run next to the models - on a laptop, an edge box, or a sidecar.
How do I deploy and operate GoModel?
The fastest path is one docker run; Docker Compose, Kubernetes with the Helm chart, and the plain binary all work too. Storage starts on SQLite with zero setup and moves to PostgreSQL or MongoDB when traffic and retention grow. Operations run through the embedded admin dashboard and API, with Prometheus /metrics and health endpoints for your existing monitoring.
What shipped in GoModel v0.2.0 and what comes next?
The whole v0.2.0 scope has shipped: plugins starting with guardrails, hardened custom and response-side guardrails, a reworked testing strategy, OpenTelemetry traces, the full /responses and /conversations lifecycles, Anthropic /messages with count_tokens, budgets per user_path and API key, editable pricing, and prompt cache visibility including the dashboard view. Version 0.3.0 focuses on MCP proxy hardening, simpler configuration and UI, a passthrough rework for every provider, Gemini native API ingress, price correctness, mid-stream failover, failover and streaming for the image endpoints, better audio and video support, plugins hardening, dashboard customization, and a workflows rework. Intelligent routing, context window compression, OIDC SSO, egress proxy pools, and secret manager vaults have shipped as GoModel Pro features.
What is GoModel Pro and how is it priced?
GoModel Pro is the commercial distribution of GoModel: the same MIT gateway plus licensed prompt compression (2-20% fewer input tokens on agentic traffic), OIDC single sign-on, per-child quota templates, intelligent routing (beta), and egress proxy pools (beta). It is licensed per company with nothing counted, and the price is set on a short discovery call - book one with the founder. You can try every Pro feature free for 21 days first, with no credit card, at the trial page. The license is a signed token validated offline, with no network call, and your key arrives by email within 24 hours.
Contact
Contact the GoModel Team
Need help deciding whether GoModel fits your project, or planning a switch between AI model providers? Book a 30-minute call, send a message, join Discord, or call directly.