GoModel

ENTERPILOTMIT活跃维护

用 Go 写的 AI 网关,把 OpenAI、Anthropic、Gemini、Ollama 等多家模型统一成兼容接口,自带可观测性、限流防护、成本追踪、智能路由和故障转移,可作为 LiteLLM 的替代方案。

AI gateway / AI control plane / AI proxy written in Go. Unified OpenAI-compatible and Anthropic-compatible API for OpenAI, Anthropic, Gemini, Groq, xAI, Ollama, vLLM and more. A LiteLLM alternative with observability, guardrails, streaming, cost tracking, intelligent routing, sticky sessions, failover, real-time logs and usage tracking. Prod ready.

v0.2.3发布于 2026-11-08 19:21 UTC1,314star +5 / 7 天129fork同步于 2026-11-10 05:54 UTC

怎么上手

由 README 提炼,执行前请确认
docker run --rm -p 8080:8080 -v gomodel_data:/app/data enterpilot/gomodel
硬件要求按 README 说明

README 未说明硬件要求;提供 Docker 镜像和 macOS/Linux/Windows 安装脚本,属于网关服务,不依赖本地 GPU。

有 Docker 镜像
下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

用 Go 写的 AI 网关,统一多家大模型 API 并做成本、限流与可观测

用 Go 写的 AI 网关,把 OpenAI、Anthropic、Gemini、Ollama 等多家模型统一成兼容接口,自带可观测性、限流防护、成本追踪、智能路由和故障转移,可作为 LiteLLM 的替代方案。

核心能力

  • 同时提供 OpenAI 与 Anthropic 兼容接口,官方 SDK 直接改 base URL
  • 支持精确与语义缓存,重复 prompt 不再产生费用
  • 按用户、团队、密钥设置预算与请求/Token/并发限流
  • 虚拟模型别名加轮询或按成本负载均衡,故障自动切换备用供应商
  • Prometheus 指标、OpenTelemetry 追踪与仪表盘实时请求日志

容易踩的坑

启动后需打开 http://localhost:8080/admin/dashboard 添加供应商并配置 API Key 才能调用;配置可用 .env、config.yaml 或环境变量,优先级为默认值 < config.yaml < .env < 环境变量;提示词压缩、智能路由、OIDC 单点登录属于商业版 GoModel Pro,开源版不含。

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

5 个版本v0.2.3
  1. v0.2.3最新正式版2026-11-08 · 2026-11-08 19:21 UTC

    Breaking: providers with a configured model list (<PROVIDER>_MODELS or providers.<name>.models) now expose only those models by default. Set CONFIGURED_PROVIDER_MODELS_MODE=fallback to restore the previous behavior.

    Changelog

    Breaking Changes

    • f6fd0096fd7355eb7ab0852683dbf08032f62c5a feat(models)!: default configured provider models mode to allowlist (#1384)

    Features

    • 427cdbadccb10aff99a12ba201f1ac5676a9aec5 feat(auditlog): add LOGGING_LOG_EMBEDDING_BODIES to keep embedding bodies out of the audit log (#1387)
    • 11ee6f672c7f4762159be7aa4f8ad7b2e8d98859 feat(dashboard): add embeddings mode to the Playground (#1386)
    • b1d1522cb514f49cf715cbb010e8b165b3e15bfd feat(mcp): sign in to upstream MCP servers with OAuth from the dashboard (#1278)
    • 86588107be25ebd967805f87a490a907a3f44034 feat(models): take provider metadata for allowlist models from /models (#1385)
    • 86dbeffc254e0166367d72e0404f5a27aceeeaaa feat(plugins): apply plugin upstream headers to provider calls (#1203)
    • e55ae2abec56749581e74ed69b743ad7ee11c22e feat(providers): add per-provider models_mode override (#1376)

    Bug Fixes

    • 720663f6b7c0e63ff1b4d1956631b912a40f9cdb fix(cluster): bound background database polls with per-tick deadlines (#1372)
    • f7cea22a500e9606caa46100360e04f42ff3ba96 fix(dashboard): update fetched usage rows in place on paused views (#1360)
    • ef391a61b2fd5a865868957378c340adc7381ae1 fix(gemini): stream generated images on Chat Completions and Responses (#1388)
    • a67b996f53babf26ae336e2af9f84d3935920883 fix(providers): throttle on-demand model list refreshes for unknown models (#1362)
    • cb30b2f90ae60e5fe45ac01c8243e16f6808b01c fix(usage): record OpenRouter image costs and token counts (#1383)
    • dc9209786e9cd55cb45b137bf6b792efbb311c7e fix: close the 0.2.3 pre-release findings (#1389)

    Performance

    • d69cab9ef92e018d2ed2edac5fc8865380b7d99c perf(cache): hash the exact-cache key once per request and bound stream capture (#1363)
    • d65b0b6a2cac6987235d9b0c03259906bec4467a perf(streaming): scan SSE event boundaries in one linear pass (#1361)

    Full Changelog: https://github.com/ENTERPILOT/GoModel/compare/v0.2.2...v0.2.3

  2. v0.2.22026-11-06 · 2026-11-06 09:33 UTC
    查看更新说明

    Changelog

    Features

    • 8e7aa5ba13657681bcbef25a76c47961fa06d98b feat(cache): add opt-in response cache partitioning by user path (#1352)
    • 74c9aea3bca95a642adbbeefea316b52c6041b25 feat(dashboard): search every filter by subsequence (#1348)
    • 0f9374c6425af8e91b33f90b77df975d5ca6113d feat(live): show every replica's traffic in the live log view (#1341)
    • 01be17e4d8cd47d552112e3f316e9ad98246a35e feat(mcp): resume downstream MCP sessions on any replica (#1340)
    • 08b94cfdfedbac4115cde2db7a9fcb360fdab6d7 feat(providers): add a billable flag so budgets and billing skip bring-your-own-key usage (#1349)
    • 5360e8c39a35bcdac09a49595c9cdf48bd15cfff feat(ratelimit): enforce limits across replicas sharing a database (#1339)
    • d3ab69fcf460b579c81f4b4ac7fd2f46351bd4cf feat(virtualmodels): set request parameters per virtual model (#1353)

    Bug Fixes

    • 70567a793ac9ef672946a958c3425abf1e323d91 fix(cache): hash every output-shaping field in the semantic cache key (#1356)
    • 27c9ac59a17b3fea0fa86de0c602edfc4e64d9ee fix(messages): apply slowdown to natively forwarded Anthropic requests (#1354)
    • 888abba66e7b78c1daeaf0da16e8fb2ad1c82eda fix(openai): render Responses reasoning as chat reasoning_content (#1343)
    • c4bc4a4a703274ff63e0b51bc908150eaf73a974 fix(providers): keep a provider's routes while its credentials are replaced (#1338)
    • 4e2af61863d4f36bf0bb96a14d2355869abce011 fix(providers): keep failed model discovery from opening the circuit breaker (#1346)
    • c02e4327599b17d0ff5f555ef2cc09435fd437eb fix(providers): narrow allowed_tools for compatible upstreams that ignore it (#1273)
    • d06adbac2782a1ab0693467a0e3c857de6d0277b fix(requestparams): skip chat format keys on the Responses API (#1380)
    • c6d309b6b4a54cfbd5c0f9f00cd5e9139ef0ea65 fix(server): answer connections accepted just before a reload's shutdown (#1355)
    • ebf171149d34912cf6ee075d3016b7245669b286 fix(server): send response feedback for translated non-streaming messages (#1358)
    • 443ef14f692a5cef6c12019e223771ce11376238 fix: close the 0.2.2 pre-release findings (#1359)

    Full Changelog: https://github.com/ENTERPILOT/GoModel/compare/v0.2.1...v0.2.2

  3. v0.2.12026-10-30 · 2026-10-30 17:28 UTC
    查看更新说明

    Changelog

    Features

    • 73d935cf5dea01cdf4ddce0a2322277153daa162 feat(audit): add indexed per-field filters to the audit log search (#1277)
    • ec0c4bcd1b375aeb2c0b5d6e5391f9edbae0ae5f feat(mcp): expose provider-hosted MCP servers, starting with Z.ai (#1272)

    Bug Fixes

    • 18b85bce8b2c469a876c3417875d5f944c07d9ee fix(ratelimit): keep per-replica counter snapshots so replicas stop overwriting each other (#1296)
    • 181cf610cbaea0039f719b419b840a70474d2cd6 fix(server): disable Multipath TCP on listeners (#1342)

    Full Changelog: https://github.com/ENTERPILOT/GoModel/compare/v0.2.0...v0.2.1

  4. v0.2.02026-10-29 · 2026-10-29 17:04 UTC
    查看更新说明

    Changelog

    Features

    • 8374d53357f2b6304606f56f89e776a6eb45f1ef feat(azure): forward gpt-6-luna decisions to Foundry's Decisions API (#1320)
    • ea3b0624ee6bf64530ae9c2b703b955a30f58ae8 feat(azure): serve Microsoft-Decision-1 through decisions and System One (#1319)
    • 6e197ada1f584f696ab53482473ecff207c04e43 feat(azure): support Azure AI Foundry v1 base URLs (#1317)
    • 6e4da41bf49a9e733634a7728cd0be6a44310e20 feat(azure): use the GA realtime websocket on v1 base URLs (#1318)
    • 63365a46cc76f372baddc67f012b6da3185fb7fd feat(chatgpt): serve chat completions via Responses translation (#1313)
    • 80883685c55fa218824c6de889cf5e6ad7c90110 feat(embeddings): support configured model failover (#1309)
    • 16cc74f66550c4431856c8060cee17ddf8c4e10c feat(http): trust private CAs and client certificates on every outbound connection (#876)
    • 3c6b6b72ef9a9a1e10a372fe2a2eddf0ff66dac7 feat(pluginapi): add a range input for bounded numeric fields (#1244)
    • 7455aaf8761c067c72e6d8cdb58aef0946afebd4 feat(server): advertise models the way vLLM discovery expects (#1245)
    • e3086be09a1efa311c5ebbcdbcd5477e80674157 feat(server): serve native TLS with hot-reloaded cert files and optional mTLS (#1326)
    • 535bfa75db46a636b45000c3d0dda7628465be66 feat(vertex): add anthropic api_mode (#1322)

    Bug Fixes

    • 9e453a0ef3b8d599141205641f599925d936b901 fix(gemini): translate Gemini 4 requests and repair the OpenAI-compatible surface (#1329)
    • 8c611bed748e2c41594717e72028c683bf7015b6 fix(passthrough): proxy provider-native error bodies, clean decode errors, cap stop sequences (#966)
    • f5ce0db24af80df789d525cd58c59b9f8afeb61a fix(server): keep skip paths with a query or fragment unmatched (#1331)
    • 73ac234bcc4b4ebbf4642f4bc6d136f00eeca6fb fix(tls): address TLS and certificate review findings (#1330)
    • fecf3b12585622f66981d95dfd96318fddb738cd fix(usage): record embedding token usage from Gemini and partial reports (#1315)
    • d85952cd7072d7d93bed8d33aad94cc4de55bef5 fix(virtualmodels): stop narrower policies from hiding a model-wide slowdown (#1325)
    • b9ae943cfbd6f29d3f6e0a7196ecbd52270f44ac fix: close the 0.2.0 pre-release findings (#1332)

    Full Changelog: https://github.com/ENTERPILOT/GoModel/compare/v0.1.109...v0.2.0

  5. v0.1.1092026-10-28 · 2026-10-28 05:47 UTC
    查看更新说明

    Changelog

    Features

    • 3ee7b2fd217d8c6103905cd624f64e178aab4142 feat(budget): enforce budgets on billed cost (#1292)
    • ae9f7ec62119db9b60888dbffa2ad0e1bf2297b5 feat(budget): make billed cache hits in provider budgets configurable (#1305)
    • ac58a5dedde8f56c80d53a051a6c62fbc5dbce6a feat(clustersync): propagate admin config changes across replicas via the shared database (#1295)
    • ef0f408b1440f7240bc155831ff36a03883c5ae0 feat(dashboard): add column visibility toggle to audit logs (#1288)
    • a5f6cce493d05bbd8ce03ee55c18ce5ecc1ae8a5 feat(ext): add a shared store for extensions (#1297)
    • 51f58e5db461db5bd3cee3b75168a34a8b1aeda7 feat(ext): let request rewriters call models through the gateway (#1299)
    • 1a61c68e61cd6ba0d5d31bbae811b08c79013948 feat(pricing): per-customer markups by user path (#1291)
    • dc943284bb532d940ed8fb29588b18bc06125d5e feat(sglang): route tool calls through chat completions with api_mode (#1294)
    • 837f1e56700995e41be83a7d7e7abd378edb6184 feat(usage): export billed usage as per-customer invoices (#1293)
    • 70ebd13a2d95e6c9a635d3aaefe3ea4824b092eb feat(usage): filter usage by several values and break it down by two dimensions (#1282)
    • b429507a92ded018464b615e74fe22572bbce922 feat(usage): report billed cost in daily, endpoint, and session usage (#1289)
    • 95c66f1df04ab9e797ddfa131dfaef23824dfb63 feat(virtualmodels): per-model and per-virtual-model reasoning effort override (#1274)

    Bug Fixes

    • 0c732e7404d50e5e91862dfd72a23d9709c73a0e fix(budget): keep the stored billed basis while billed budgets are unavailable (#1307)
    • d61262226664d9d8ec5bfdeb3eee9773a92934c6 fix(cache): keep the Redis password out of invalid URL errors (#1312)
    • e42e3b927f07d0a61097b7cdb42ac73a2c0e2ccc fix(cache): preserve Redis TLS through the egress dialer (#1311)
    • 7431bd8c507881d5886cd41856fe198dfb2d9e26 fix(gemini): handle parallel tool calls in native chat translation (#1283)
    • ab7481b0bf8122be2fc73a5b89f96054ac5e659a fix(gemini): honor flat reasoning_effort on the native API (#1306)
    • 6096b766277da5a458bf5d38c62b85905f289f03 fix(reasoning): turn reasoning off for effort none on DeepSeek and Anthropic (#1298)

    Full Changelog: https://github.com/ENTERPILOT/GoModel/compare/v0.1.108...v0.1.109

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    Quick Start

    Step 1: Install and start GoModel

    Docker

    docker run --rm -p 8080:8080 \
      -v gomodel_data:/app/data \
      enterpilot/gomodel
    

    macOS / Linux

    curl -fsSL https://gomodel.enterpilot.io/install.sh | sh
    # OPENAI_API_KEY="your-openai-key" # (optional)
    gomodel
    

    Windows (PowerShell)

    irm https://gomodel.enterpilot.io/install.ps1 | iex
    # $env:OPENAI_API_KEY = "your-openai-key" # (optional)
    gomodel
    

    ℹ️ Configure GoModel with .env, a config.yaml file, or manage the most important settings directly in the dashboard.

    ℹ️ See .env.template for the complete list of environment variables, including all available providers.

    Step 2: Open the dashboard and add a provider

    http://localhost:8080/admin/dashboard
    

    Step 3: Make an API call

    curl http://localhost:8080/v1/responses \
      -H "Content-Type: application/json" \
      -d '{
        "model": "gpt-5-chat-latest",
        "input": "Hello!"
      }'
    

    GoModel and official SDKs

    GoModel accepts requests in two compatible formats:

    • OpenAI-compatible at /v1
    • Anthropic-compatible at /v1/messages

    The official SDKs therefore work unchanged. Configure their base URLs as follows:

    • OpenAI SDK: http://localhost:8080/v1
    • Anthropic SDK: http://localhost:8080 (the SDK appends /v1/messages)

    List of Supported LLM Providers

    • OpenAI
    • Anthropic
    • xAI (Grok)
    • Google Gemini
    • Cohere
    • Vertex AI
    • DeepSeek
    • Groq
    • Fireworks AI
    • Together AI
    • Meta (Muse Spark)
    • OpenRouter
    • Z.ai
    • Alibaba Cloud Model Studio (Bailian)
    • Kilo AI
    • Eden AI
    • MiniMax
    • Xiaomi MiMo
    • OpenCode Go
    • Azure OpenAI
    • Oracle
    • Ollama
    • SGLang
    • vLLM
    • llm-d
    • Amazon Bedrock Runtime and Bedrock Mantle
    • ChatGPT (the Codex backend) and Claude
    • GitHub Copilot
    • ElevenLabs (text-to-speech and speech-to-text)
    • Jev (TypeSafe System One decision API) and self-hosted Kev, also behind OpenAI's Decisions API
    • All OpenAI-compatible providers

    See the Providers Overview for the full per-provider feature matrix.


    Docker Compose

    Infrastructure only (Redis, PostgreSQL, MongoDB, Adminer - no image build):

    cp .env.template .env
    # Add your API keys to .env
    docker compose up -d
    # or: make infra
    

    Full stack (adds GoModel + Prometheus; builds the app image):

    docker compose --profile app up -d
    # or: make image
    

    API docs


    Gateway Configuration

    GoModel resolves configuration in the following order, with each source overriding those to its left:

    Good defaults → config.yaml → .env → exported environment variables

    See the Configuration reference for the full list of settings.


    Features

    • Caching - exact and semantic response caching, so repeated prompts cost nothing
    • Cost tracking - per-request cost estimates, usage analytics, and spending breakdowns in the dashboard
    • Budgets - hard spend limits per user, team, or key
    • Rate limits - requests, tokens, and concurrency caps per user path, provider, or model
    • Usage API - clients check their own usage, remaining budget, and rate-limit headroom with the key they already use for inference
    • Virtual models - aliases and load balancing (round-robin or cost-based) behind stable model names
    • Session keeping - detect a client session and pin it to one target and provider key, so provider prompt caches stay warm and audit logs read as threads
    • Failover - automatic rerouting to backup providers, with retries and circuit breakers
    • Labelling - tag requests from HTTP headers or API keys and break down usage by label
    • User paths - hierarchical scoping of keys, model access, budgets, usage, and audit logs
    • Model access control - per-group, per-user, and per-key model allowlists that intersect down the user-path tree
    • MCP gateway - aggregate your MCP servers behind one authenticated endpoint
    • Passthrough API - provider-native APIs under /p/{provider}/..., with GoModel auth and tracking
    • Audio and image APIs - OpenAI-compatible text-to-speech, transcription, and image generation and editing with the same access rules, budgets, and cost tracking as chat
    • Provider replay state - preserves Gemini thought signatures and Anthropic thinking blocks across turns, APIs, and providers
    • Guardrails - request and response policies enforced at the gateway
    • Plugins - one contract for guardrails, response and stream filters, header edits, and routing strategies; built in, compiled in, or loaded from a .so at startup
    • Workflows - versioned per-request policies that scope cache, budgets, audit logging, guardrail phases, and failover by user path, provider, or model
    • Provider key rotation - round-robin over multiple API keys to lift per-key rate limits
    • Observability - Prometheus metrics, OpenTelemetry traces, audit logs, and live request streaming in the dashboard
    • Playground - try any model or virtual model from the dashboard and inspect the exact request and response JSON

    GoModel Pro

    GoModel Pro is the commercial build: the same gateway, configuration, and dashboard, with licensed extensions.

    • Prompt compression - remove repeated and structural context before it reaches the provider, without changing the request shape
    • Intelligent routing - classify each request as easy or hard, then pick the healthiest and cheapest provider in that tier
    • OIDC single sign-on - protect the dashboard with your identity provider using Authorization Code flow with PKCE

    More in the documentation...

    Not ready for Pro? Sponsor GoModel to keep the open-source gateway moving.

    Roadmap

    See the roadmap for GoModel Pro and the upcoming 0.3.0 release.

    Featured Sponsors

    Goal: $1K/month - ~15% achieved!

    If GoModel saves you money or time, become a sponsor or try GoModel Pro.

    Community

    We are on Discord. Feel free to stop by and tell us what you think about GoModel.