# GoModel

GoModel is a Go-based AI gateway that exposes a single OpenAI-compatible API over 10+ LLM providers: OpenAI, Anthropic, Google Gemini, Groq, OpenRouter, Z.ai, xAI (Grok), Azure OpenAI, Oracle Generative AI, and Ollama. It's explicitly positioned as a LiteLLM alternative — same problem space (unified LLM access layer for app developers), different language (Go vs Python).

Built by the ENTERPILOT team, MIT-licensed, 379 stars, created December 2025.

## What it covers

The gateway auto-detects which providers are available from the credentials you supply. The feature grid from the README:

| Feature | Scope |
|---------|-------|
| Chat completions | All 10 providers |
| `/v1/responses` (OpenAI Responses API) | All 10 providers |
| Embeddings | 7 providers (not Anthropic, Oracle, Ollama-partial) |
| Files | 5 providers (OpenAI, Gemini, Groq, OpenRouter, xAI, Azure) |
| Batches | 6 providers |
| Provider-native passthrough at `/p/{provider}/...` | OpenAI, Anthropic, OpenRouter, Z.ai by default |

Plus: usage analytics by model/day/period, audit logging, response caching, Prometheus metrics, admin dashboard, Swagger UI, guardrails pipeline, configurable storage (SQLite, PostgreSQL, MongoDB).

## Operational posture

Designed as a production-ready deployable, not a library:

- Docker image at `enterpilot/gomodel` on Docker Hub.
- Docker Compose profiles for infrastructure-only (Redis/Postgres/MongoDB/Adminer) or full-stack (+ GoModel + Prometheus).
- `GOMODEL_MASTER_KEY` environment variable as the API auth gate. The README specifically warns that without this key all endpoints are unauthenticated.
- Credentials passed via environment variables; README recommends `--env-file` over `-e` to avoid leaking secrets through shell history and process lists.

Go 1.26.2+ required when building from source.

## Why it matters

LiteLLM's Python posture has always been awkward for teams running a Go or Rust backend — adding a Python process just for the gateway is operationally expensive. GoModel removes that impedance mismatch: single binary, single runtime, fits into a Go deployment exactly like any other service.

Beyond that, the passthrough feature (`/p/{provider}/...`) is the interesting structural choice. Instead of forcing every client to route through an OpenAI-schema shim, it exposes the raw provider API with just auth/logging/metering in the middle. That matches how production traffic actually splits: some paths want normalized OpenAI-shape, some want provider-native features that don't fit in the OpenAI schema (Anthropic's prompt caching, Gemini's grounding, etc.).

## Repo

https://github.com/ENTERPILOT/GoModel — 379 stars, MIT. Docs at gomodel.enterpilot.io. Discord and Docker Hub linked from the README.

## Related

- [[rawquery]] — adjacent tool operating on structured data (CLI-first data platform), not LLM gateway
- [[build-your-own-openclaw]] — agent-building tutorial; would pair with GoModel if you wanted to deploy the agent behind a gateway
