Skip to content

Commit 102ad15

Browse files
docs: refresh Mintlify docs and dashboard UI (#233)
* docs(mintlify): refresh documentation site * feat(dashboard): add lucide action icons * docs: expand feature pages and navigation * feat(config): enable model overrides by default * fix(dashboard): keep admin api keys in memory * docs: update user path and philosophy pages
1 parent 06c0eda commit 102ad15

66 files changed

Lines changed: 10779 additions & 7683 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.env.template

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -99,13 +99,12 @@
9999
# MODEL_LIST_URL=https://raw.githubusercontent.com/ENTERPILOT/ai-model-list/refs/heads/main/models.min.json
100100

101101
# Model Access Configuration
102-
# Process-wide default for concrete provider models when no persisted override exists and model overrides are enabled (default: true)
102+
# Process-wide default for provider models when no persisted override exists (default: true)
103103
# Set to false to keep models unavailable until a model override allows one or more user paths.
104104
# MODELS_ENABLED_BY_DEFAULT=true
105-
# Persisted model overrides are opt-in (default: false).
106-
# Set true to load/enforce model overrides and enable dashboard editing.
107-
# MODEL_OVERRIDES_ENABLED=false
108-
# Hide concrete provider models from GET /v1/models and expose only enabled aliases (default: false).
105+
# Enable/disable persisted model overrides and dashboard editing (default: true).
106+
# MODEL_OVERRIDES_ENABLED=true
107+
# Hide provider models from GET /v1/models and expose only enabled aliases (default: false).
109108
# KEEP_ONLY_ALIASES_AT_MODELS_ENDPOINT=false
110109

111110
# Fallback & Workflow Configuration
@@ -259,7 +258,7 @@
259258
# OPENROUTER_API_KEY=sk-or-...
260259
# OPENROUTER_BASE_URL=https://openrouter.ai/api/v1
261260
# OPENROUTER_SITE_URL=https://gomodel.enterpilot.io
262-
# OPENROUTER_APP_NAME=GOModel
261+
# OPENROUTER_APP_NAME=GoModel
263262

264263
# Azure OpenAI
265264
# AZURE_API_KEY=...

2026-03-16_ARCHITECTURE_SNAPSHOT.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# GOModel Architecture Snapshot
1+
# GoModel Architecture Snapshot
22

33
This document is a point-in-time architecture snapshot based on the code and runtime wiring present on March 16, 2026.
44

@@ -153,11 +153,11 @@ Echo + Handler"]
153153

154154
## 2. Request-Scoped Data Objects
155155

156-
| Object | Created by | Contains | Consumed by |
157-
| --- | --- | --- | --- |
158-
| `RequestSnapshot` | `RequestSnapshotCapture()` | Immutable ingress transport data: method, path, route params, query params, headers, content type, captured body bytes, `BodyNotCaptured`, request id, trace metadata | `DeriveWhiteBoxPrompt`, audit logging, passthrough semantic enrichers, any later logic that needs raw ingress fidelity |
159-
| `WhiteBoxPrompt` | `core.DeriveWhiteBoxPrompt(snapshot)` | Best-effort semantics: route type, operation type, route hints, stream intent, JSON parsed flag, cached typed request objects, cached route metadata | workflow resolution, canonical request decoding, passthrough/file/batch helpers |
160-
| `Workflow` | `WorkflowResolutionWithResolver(...)` or `ensureTranslatedRequestWorkflow(...)` | Control-plane decision: endpoint descriptor, execution mode, capabilities, provider type, resolved model selector, passthrough info | response cache, translated handlers, passthrough handlers, audit-log enrichment |
156+
| Object | Created by | Contains | Consumed by |
157+
| ----------------- | ------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- |
158+
| `RequestSnapshot` | `RequestSnapshotCapture()` | Immutable ingress transport data: method, path, route params, query params, headers, content type, captured body bytes, `BodyNotCaptured`, request id, trace metadata | `DeriveWhiteBoxPrompt`, audit logging, passthrough semantic enrichers, any later logic that needs raw ingress fidelity |
159+
| `WhiteBoxPrompt` | `core.DeriveWhiteBoxPrompt(snapshot)` | Best-effort semantics: route type, operation type, route hints, stream intent, JSON parsed flag, cached typed request objects, cached route metadata | workflow resolution, canonical request decoding, passthrough/file/batch helpers |
160+
| `Workflow` | `WorkflowResolutionWithResolver(...)` or `ensureTranslatedRequestWorkflow(...)` | Control-plane decision: endpoint descriptor, execution mode, capabilities, provider type, resolved model selector, passthrough info | response cache, translated handlers, passthrough handlers, audit-log enrichment |
161161

162162
Important constraints:
163163

AGENTS.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ GoModel is a high-performance AI gateway in Go that routes requests to multiple
88

99
Follow Postel's Law: be conservative in what you send, liberal in what you accept.
1010

11-
- GOModel accepts client requests generously (e.g. `max_tokens` for any model) and adapts them to each provider's specific requirements before forwarding (e.g. translating `max_tokens``max_completion_tokens` for OpenAI reasoning models).
12-
- GOModel accepts providers' responses liberally and passes them to the user in a conservative OpenAI-compatible shape.
11+
- GoModel accepts client requests generously (e.g. `max_tokens` for any model) and adapts them to each provider's specific requirements before forwarding (e.g. translating `max_tokens``max_completion_tokens` for OpenAI reasoning models).
12+
- GoModel accepts providers' responses liberally and passes them to the user in a conservative OpenAI-compatible shape.
1313

1414
[The Twelve-Factor App](https://12factor.net/).
1515

CLAUDE.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ Guidance for AI models (like Claude) working with this codebase.
44

55
## Project Overview
66

7-
**GOModel** is a high-performance AI gateway in Go that routes requests to multiple AI model providers (OpenAI, Anthropic, Gemini, Groq, xAI, Oracle, Ollama). LiteLLM killer.
7+
**GoModel** is a high-performance AI gateway in Go that routes requests to multiple AI model providers (OpenAI, Anthropic, Gemini, Groq, xAI, Oracle, Ollama). LiteLLM killer.
88

99
**Go:** 1.26.2
10-
**Repo:** https://github.com/ENTERPILOT/GOModel
10+
**Repo:** https://github.com/ENTERPILOT/GoModel
1111

1212
- **Stage:** Development - backward compatibility is not a concern
1313
- **Design philosophy:**
@@ -36,7 +36,7 @@ make clean # Remove bin/
3636
make record-api # Record API responses for contract tests
3737
make swagger # Regenerate Swagger docs
3838
make infra # Docker Compose: Redis, Postgres, MongoDB, Adminer only
39-
make image # Docker Compose: full stack (GOModel + Prometheus)
39+
make image # Docker Compose: full stack (GoModel + Prometheus)
4040
```
4141

4242
**Single test:** `go test ./internal/providers -v -run TestName`

GETTING_STARTED.md

Lines changed: 26 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -102,26 +102,24 @@ providers:
102102
api_key: ${ANTHROPIC_API_KEY}
103103
resilience:
104104
retry:
105-
max_retries: 5 # Anthropic supports long requests — allow more retries
105+
max_retries: 5 # Anthropic supports long requests — allow more retries
106106
ollama:
107107
type: ollama
108108
base_url: ${OLLAMA_BASE_URL:-http://localhost:11434/v1}
109109
resilience:
110110
circuit_breaker:
111-
failure_threshold: 10 # local service — tolerate more transient failures
111+
failure_threshold: 10 # local service — tolerate more transient failures
112112
timeout: 5s
113113
```
114114
115115
**Effective resilience per provider:**
116116
117-
118117
| Provider | max_retries | failure_threshold | cb timeout |
119118
| --------- | ---------------- | ----------------- | ----------------- |
120119
| openai | 2 (global) | 3 (global) | 15s (global) |
121120
| anthropic | **5** (override) | 3 (global) | 15s (global) |
122121
| ollama | 2 (global) | **10** (override) | **5s** (override) |
123122
124-
125123
Only fields that are explicitly listed under a provider's `resilience:` block are overridden. Everything else silently inherits from the global section.
126124

127125
---
@@ -163,7 +161,6 @@ GROQ_API_KEY=gsk_...
163161

164162
All resilience settings can be overridden at runtime via env vars. Env vars always beat both code defaults and YAML values.
165163

166-
167164
| Variable | Type | Default | Description |
168165
| ----------------------------------- | -------- | --------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
169166
| `RETRY_MAX_RETRIES` | int | `3` | Maximum retry attempts per request |
@@ -174,36 +171,33 @@ All resilience settings can be overridden at runtime via env vars. Env vars alwa
174171
| `CIRCUIT_BREAKER_FAILURE_THRESHOLD` | int | `5` | Consecutive failures before opening |
175172
| `CIRCUIT_BREAKER_SUCCESS_THRESHOLD` | int | `2` | Consecutive successes to close again |
176173
| `CIRCUIT_BREAKER_TIMEOUT` | duration | `30s` | How long the circuit stays open |
177-
| `LOG_FORMAT` | string | *(unset)* | Auto-detects based on environment: colorized text on a TTY, JSON otherwise. Set to `text` to force human-readable output (no colors if not a TTY), or `json` to force structured JSON even on a TTY (recommended for production, CloudWatch, Datadog, GCP). |
178-
| `LOG_LEVEL` | string | `info` | Minimum runtime log level. Supported values are `debug`, `info`, `warn`, and `error`. Common aliases such as `dbg`, `inf`, `warning`, and `err` are also accepted. |
179-
174+
| `LOG_FORMAT` | string | _(unset)_ | Auto-detects based on environment: colorized text on a TTY, JSON otherwise. Set to `text` to force human-readable output (no colors if not a TTY), or `json` to force structured JSON even on a TTY (recommended for production, CloudWatch, Datadog, GCP). |
175+
| `LOG_LEVEL` | string | `info` | Minimum runtime log level. Supported values are `debug`, `info`, `warn`, and `error`. Common aliases such as `dbg`, `inf`, `warning`, and `err` are also accepted. |
180176

181177
Provider credentials:
182178

183-
184-
| Variable | Provider |
185-
| -------------------- | --------------------------------------------- |
186-
| `OPENAI_API_KEY` | OpenAI |
187-
| `OPENAI_BASE_URL` | OpenAI (custom endpoint) |
188-
| `ANTHROPIC_API_KEY` | Anthropic |
189-
| `ANTHROPIC_BASE_URL` | Anthropic (custom endpoint) |
190-
| `GEMINI_API_KEY` | Google Gemini |
191-
| `GEMINI_BASE_URL` | Gemini (custom endpoint) |
192-
| `OPENROUTER_API_KEY` | OpenRouter (default base URL: `https://openrouter.ai/api/v1`) |
193-
| `OPENROUTER_BASE_URL` | OpenRouter (custom endpoint override) |
179+
| Variable | Provider |
180+
| --------------------- | ------------------------------------------------------------------------------ |
181+
| `OPENAI_API_KEY` | OpenAI |
182+
| `OPENAI_BASE_URL` | OpenAI (custom endpoint) |
183+
| `ANTHROPIC_API_KEY` | Anthropic |
184+
| `ANTHROPIC_BASE_URL` | Anthropic (custom endpoint) |
185+
| `GEMINI_API_KEY` | Google Gemini |
186+
| `GEMINI_BASE_URL` | Gemini (custom endpoint) |
187+
| `OPENROUTER_API_KEY` | OpenRouter (default base URL: `https://openrouter.ai/api/v1`) |
188+
| `OPENROUTER_BASE_URL` | OpenRouter (custom endpoint override) |
194189
| `OPENROUTER_SITE_URL` | OpenRouter attribution URL override (default: `https://gomodel.enterpilot.io`) |
195-
| `OPENROUTER_APP_NAME` | OpenRouter attribution title override (default: `GOModel`) |
196-
| `XAI_API_KEY` | xAI / Grok |
197-
| `XAI_BASE_URL` | xAI (custom endpoint) |
198-
| `GROQ_API_KEY` | Groq |
199-
| `GROQ_BASE_URL` | Groq (custom endpoint) |
200-
| `AZURE_API_KEY` | Azure OpenAI |
201-
| `AZURE_BASE_URL` | Azure OpenAI deployment base URL |
202-
| `AZURE_API_VERSION` | Azure OpenAI API version override (default: `2024-10-21`) |
203-
| `ORACLE_API_KEY` | Oracle |
204-
| `ORACLE_BASE_URL` | Oracle OpenAI-compatible base URL |
205-
| `OLLAMA_BASE_URL` | Ollama (default: `http://localhost:11434/v1`) |
206-
190+
| `OPENROUTER_APP_NAME` | OpenRouter attribution title override (default: `GoModel`) |
191+
| `XAI_API_KEY` | xAI / Grok |
192+
| `XAI_BASE_URL` | xAI (custom endpoint) |
193+
| `GROQ_API_KEY` | Groq |
194+
| `GROQ_BASE_URL` | Groq (custom endpoint) |
195+
| `AZURE_API_KEY` | Azure OpenAI |
196+
| `AZURE_BASE_URL` | Azure OpenAI deployment base URL |
197+
| `AZURE_API_VERSION` | Azure OpenAI API version override (default: `2024-10-21`) |
198+
| `ORACLE_API_KEY` | Oracle |
199+
| `ORACLE_BASE_URL` | Oracle OpenAI-compatible base URL |
200+
| `OLLAMA_BASE_URL` | Ollama (default: `http://localhost:11434/v1`) |
207201

208202
See `.env.template` for the full list of all configurable environment variables.
209203

@@ -233,7 +227,7 @@ If your Oracle endpoint does not return a usable model list, configure `provider
233227
**Azure ships with a pinned API version by default.**
234228
If you do not set `AZURE_API_VERSION`, the gateway sends `api-version=2024-10-21`. Override it only when you need a different Azure API version.
235229

236-
**OpenRouter gets GOModel attribution headers by default.**
230+
**OpenRouter gets GoModel attribution headers by default.**
237231
When the `openrouter` provider is used, the gateway adds `HTTP-Referer` and `X-OpenRouter-Title` unless the request already provides them. Override the defaults with `OPENROUTER_SITE_URL` and `OPENROUTER_APP_NAME`.
238232

239233
**Partial YAML fields leave the rest at defaults.**

METRICS_CONFIGURATION.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# Prometheus Metrics Configuration Guide
22

3-
This guide explains how to configure Prometheus metrics in GOModel.
3+
This guide explains how to configure Prometheus metrics in GoModel.
44

55
## Quick Start
66

77
### Disabled by Default
88

9-
Metrics are **disabled by default**. To enable metrics collection, set `METRICS_ENABLED=true` and start GOModel:
9+
Metrics are **disabled by default**. To enable metrics collection, set `METRICS_ENABLED=true` and start GoModel:
1010

1111
```bash
1212
export METRICS_ENABLED=true
@@ -174,7 +174,6 @@ If you need to protect the metrics endpoint further:
174174
```
175175

176176
2. **Use network-level security:**
177-
178177
- Configure firewall rules to allow only Prometheus server
179178
- Use private network for metrics collection
180179
- Deploy Prometheus in the same VPC/network

Makefile

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
.PHONY: all build run clean tidy test test-race test-dashboard test-e2e test-integration test-contract test-all lint lint-fix record-api swagger install-tools perf-check perf-bench infra image
1+
.PHONY: all build run clean tidy test test-race test-dashboard test-e2e test-integration test-contract test-all lint lint-fix record-api swagger docs-openapi install-tools perf-check perf-bench infra image
22

33
all: build
44

55
# Get version info
66
VERSION ?= $(shell git describe --tags --always --dirty)
77
COMMIT ?= $(shell git rev-parse --short HEAD)
88
DATE ?= $(shell date -u +"%Y-%m-%dT%H:%M:%SZ")
9+
DOCS_API_SERVERS ?= http://localhost:8080
910

1011
# Linker flags to inject version info
1112
LDFLAGS := -X "gomodel/internal/version.Version=$(VERSION)" \
@@ -35,7 +36,7 @@ tidy:
3536
infra:
3637
docker compose up -d
3738

38-
# Docker Compose: full stack (GOModel + Prometheus; builds app image when needed)
39+
# Docker Compose: full stack (GoModel + Prometheus; builds app image when needed)
3940
image:
4041
docker compose --profile app up -d
4142

@@ -87,8 +88,20 @@ swagger:
8788
go run github.com/swaggo/swag/cmd/swag init --generalInfo main.go \
8889
--dir cmd/gomodel,internal \
8990
--output cmd/gomodel/docs \
90-
--outputTypes go,json \
91+
--outputTypes go \
9192
--parseDependency
93+
$(MAKE) docs-openapi
94+
95+
docs-openapi:
96+
@tmp_dir=$$(mktemp -d); \
97+
trap 'rm -rf "$$tmp_dir"' EXIT; \
98+
go run github.com/swaggo/swag/cmd/swag init --quiet --generalInfo main.go \
99+
--dir cmd/gomodel,internal \
100+
--output "$$tmp_dir" \
101+
--outputTypes json \
102+
--parseDependency; \
103+
npx -y swagger2openapi@7.0.8 --patch -o docs/openapi.json "$$tmp_dir/swagger.json"; \
104+
DOCS_API_SERVERS="$(DOCS_API_SERVERS)" node -e 'const fs = require("fs"); const file = "docs/openapi.json"; const urls = (process.env.DOCS_API_SERVERS || "").split(",").map((url) => url.trim()).filter(Boolean); if (!urls.length) throw new Error("DOCS_API_SERVERS must include at least one URL"); const spec = JSON.parse(fs.readFileSync(file, "utf8")); spec.servers = urls.map((url) => ({ url, description: /(^https?:\/\/)?(localhost|127\.0\.0\.1)(:|\/|$$)/.test(url) ? "Local GoModel" : "GoModel" })); fs.writeFileSync(file, JSON.stringify(spec, null, 2) + "\n");'
92105

93106
# Run linter
94107
lint:

0 commit comments

Comments
 (0)