UIGraph Gateway (uigraph-gateway)
The gateway presigns uploads and runs the AI chat. UIGRAPH_API_URL and the STORAGE_* keys are required; the AI provider and MCP settings are only needed for the AI chat feature.
Core
| Variable | Required | Default | Description |
|---|
PORT | No | 8080 | Port inside the container (published on host 8081 in the bundled deploy). |
UIGRAPH_API_URL | Yes | — | In-network base URL of uigraph-api (e.g. http://uigraph-api:8080). |
DEPLOYMENT_ENV | No | production | local | development | production. How much detail is written to the logs. Leave at production for a normal deploy; the others are noisier and meant for debugging. |
Object storage
Presigns uploads with the same credentials as the API; these must match the values set on UIGraph API.
| Variable | Required | Default | Description |
|---|
STORAGE_ENDPOINT | Yes | — | In-network storage endpoint (e.g. http://minio:9000). |
STORAGE_BUCKET | Yes | — | Bucket name. |
STORAGE_ACCESS_KEY | Yes | — | Access key. |
STORAGE_SECRET_KEY | Yes | — | Secret key. |
STORAGE_PUBLIC_ENDPOINT | No | — | Browser-reachable storage host for presigned URLs. |
STORAGE_REGION | No | us-east-1 | Region for the s3 backend. |
STORAGE_FORCE_PATH_STYLE | No | true | Path-style addressing. Set false for AWS S3. |
AI provider
The model the AI chat uses. See AI Providers for the full explanation and Examples for complete configurations.
| Variable | Required | Default | Description |
|---|
AI_PROVIDER_NPM | No | @ai-sdk/openai-compatible | Which provider to use. |
AI_PROVIDER_API_URL | If AI_PROVIDER_NPM not provided | — | Endpoint URL. Needed for the default OpenAI-compatible provider. |
AI_PROVIDER_API_KEY | For AI chat | — | API key for the provider. |
AI_PROVIDER_MODEL | For AI chat | — | Model to use, e.g. gpt-4o. |
AI_PROVIDER_TITLE_MODEL | No | falls back to AI_PROVIDER_MODEL | Cheaper model used only to generate chat session titles. |
AI_PROVIDER_BEAUTIFY_MODEL | No | falls back to AI_PROVIDER_MODEL | Model used only when someone tidies up an architecture diagram's layout. |
AI_PROVIDER_OPTIONS | No | — | Extra provider settings as a single line of JSON. |
MCP connection
| Variable | Required | Default | Description |
|---|
UIGRAPH_MCP_URL | For AI chat | — | Base URL of the UIGraph MCP server the chat reads architecture data from. Without it, the chat returns an MCP_NOT_CONFIGURED error. |
MCP_CACHE_TTL_MS | No | 900000 | How long (ms) the gateway caches the MCP tool list. Default is 15 minutes. |
Caching
The gateway remembers which organization a token belongs to, so it does not ask the API on every request.
| Variable | Required | Default | Description |
|---|
REDIS_URL | No | — | A Redis instance the gateway shares its cache through, the same one the API uses. Leave it blank and each gateway process caches in its own memory instead. Worth setting when you run more than one gateway. |
ORG_ID_CACHE_TTL_MS | No | 86400000 | How long (ms) a token's organization is remembered. Default is 1 day. |
Behaviour
| Variable | Required | Default | Description |
|---|
LLM_MAX_STEP | No | 100 | The most tool-calling steps the chat may take while answering one question. |
LLM_ATTACHMENT_IMAGE | No | false | Let the chat read image attachments. |
LLM_ATTACHMENT_AUDIO | No | false | Let the chat read audio attachments. |
LLM_ATTACHMENT_VIDEO | No | false | Let the chat read video attachments. |