Skip to main content
The gateway is the engine of Spaceduck. It runs on your machine and manages everything: chat streaming, memory, tools, file uploads, and configuration.

Starting the gateway

bun run dev
# Gateway starts at http://localhost:3000
The web UI is served directly by the gateway — open http://localhost:3000 in your browser.

Where data lives

DataLocationNotes
Configdata/spaceduck.config.json5Single source of truth for all settings
Databasedata/spaceduck.dbSQLite — conversations, facts, vector embeddings
Uploadsdata/uploads/Temporary file storage with TTL sweeper
All data stays on your machine. Nothing is sent anywhere except to the model provider you configure.

Ports and access

The gateway listens on port 3000 by default. Change it with the PORT environment variable in .env. Clients connect over HTTP (config API, file uploads) and WebSocket (chat streaming). Both use the same port.

Environment variables

These are deployment knobs only — product settings (provider, model, API keys) are managed in the Settings UI or via the CLI.
VariableDefaultDescription
PORT3000Gateway listen port
LOG_LEVELinfoLogging verbosity (debug, info, warn, error)
SPACEDUCK_TOKENAuth token for CLI and remote access

Configuration system

Spaceduck uses a single config file (spaceduck.config.json5) validated by a Zod schema. You can modify it through three surfaces:
SurfaceHow it worksSecrets?
Settings UIBrowser-based preference paneYes (masked input)
CLIspaceduck config set /ai/provider bedrockYes (secret set)
Chat toolsAsk the assistant: “change my model to nova”No (read-only for secrets)

Hot-apply vs restart

Some settings take effect immediately, others require a gateway restart:
Hot-applies immediatelyRequires restart
Chat provider, model, base URLEmbedding provider, model, dimensions
System prompt
API keys
Temperature
Changing embedding provider, model, or dimensions requires a restart and may invalidate existing vector memory.