Skip to main content

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

VariableRequiredDefaultDescription
PORTNo8080Port inside the container (published on host 8081 in the bundled deploy).
UIGRAPH_API_URLYesIn-network base URL of uigraph-api (e.g. http://uigraph-api:8080).
DEPLOYMENT_ENVNoproductionlocal | 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.

VariableRequiredDefaultDescription
STORAGE_ENDPOINTYesIn-network storage endpoint (e.g. http://minio:9000).
STORAGE_BUCKETYesBucket name.
STORAGE_ACCESS_KEYYesAccess key.
STORAGE_SECRET_KEYYesSecret key.
STORAGE_PUBLIC_ENDPOINTNoBrowser-reachable storage host for presigned URLs.
STORAGE_REGIONNous-east-1Region for the s3 backend.
STORAGE_FORCE_PATH_STYLENotruePath-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.

VariableRequiredDefaultDescription
AI_PROVIDER_NPMNo@ai-sdk/openai-compatibleWhich provider to use.
AI_PROVIDER_API_URLIf AI_PROVIDER_NPM not providedEndpoint URL. Needed for the default OpenAI-compatible provider.
AI_PROVIDER_API_KEYFor AI chatAPI key for the provider.
AI_PROVIDER_MODELFor AI chatModel to use, e.g. gpt-4o.
AI_PROVIDER_TITLE_MODELNofalls back to AI_PROVIDER_MODELCheaper model used only to generate chat session titles.
AI_PROVIDER_BEAUTIFY_MODELNofalls back to AI_PROVIDER_MODELModel used only when someone tidies up an architecture diagram's layout.
AI_PROVIDER_OPTIONSNoExtra provider settings as a single line of JSON.

MCP connection

VariableRequiredDefaultDescription
UIGRAPH_MCP_URLFor AI chatBase 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_MSNo900000How 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.

VariableRequiredDefaultDescription
REDIS_URLNoA 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_MSNo86400000How long (ms) a token's organization is remembered. Default is 1 day.

Behaviour

VariableRequiredDefaultDescription
LLM_MAX_STEPNo100The most tool-calling steps the chat may take while answering one question.
LLM_ATTACHMENT_IMAGENofalseLet the chat read image attachments.
LLM_ATTACHMENT_AUDIONofalseLet the chat read audio attachments.
LLM_ATTACHMENT_VIDEONofalseLet the chat read video attachments.