Environment Variables
The local Lattice daemon reads its configuration from CLI flags, then environment
variables, then the config file at ~/.lovelace/lattice/config.toml, then
built-in defaults — highest priority first. Environment variables are the right
place for values that change per machine or per shell, and for secrets you do not
want in a version-controlled config file.
This page is the reference for the LATTICE_* variables. For the config-file
format and precedence, see Configuration.
Provider and model selection#
| Variable | Purpose | Default |
|---|---|---|
LATTICE_PROVIDER | Override the default provider (ollama, anthropic, …). | Config file's default_provider |
LATTICE_MODEL | Override the default model for the selected provider. | Config file's default_model |
LATTICE_CONFIG_PATH | Path to the TOML config file to load. | ~/.lovelace/lattice/config.toml |
Local provider endpoints#
These point the daemon at a locally running model server. They are exactly the
overrides you need when a personal runtime's LM Studio server is not on its
default host or port. LATTICE_LMSTUDIO_BASE_URL is also the endpoint the
daemon probes for local-first election and the one lattice-ctl voice setup
and voice doctor check.
| Variable | Purpose | Default |
|---|---|---|
LATTICE_LMSTUDIO_BASE_URL | Base URL of the LM Studio OpenAI-compatible server. | http://localhost:1234/v1 |
LATTICE_OLLAMA_BASE_URL | Base URL of the Ollama server (deprecated; used only when orchestrator.default_provider is "ollama"). | http://localhost:11434 |
# Point the daemon at an LM Studio server on a non-default port
export LATTICE_LMSTUDIO_BASE_URL="http://localhost:4321/v1"
lattice-ctl daemon start
Runtime paths#
| Variable | Purpose | Default |
|---|---|---|
LATTICE_SOCKET | Unix socket the daemon listens on for local IPC. | A path under ~/.lovelace/lattice/ |
LATTICE_PID_PATH | File the daemon writes its process ID to. | A path under ~/.lovelace/lattice/ |
Override these only when running more than one isolated daemon instance on the same machine.
Serving mode#
A freshly started daemon does not serve external compute until a serving mode is
enabled. These toggles opt the daemon into serving; for a paired personal
runtime, lattice-ctl relay connect sets the relay variables for you (see
below).
| Variable | Purpose |
|---|---|
LATTICE_ENABLE_SIDECAR | Serve gateway-routed compute through the local sidecar. |
LATTICE_ENABLE_RELAY | Serve personal-runtime work through the outbound relay. |
LATTICE_ENABLE_COMPUTE_HTTP | Set to 1 to also serve the compute-provider routes (/v1/catalog, /v1/execute) on the local API port. |
Local OpenAI-compatible API#
The daemon serves an OpenAI-compatible API for local models at
http://127.0.0.1:11435/v1 by default. See
Local OpenAI-compatible API.
| Variable | Purpose | Default |
|---|---|---|
LATTICE_LOCAL_API_ENABLED | Set to false to turn the local API off. | true |
LATTICE_LOCAL_API_PORT | Loopback port of the local API. | 11435 |
LATTICE_LOCAL_API_ALLOWED_ORIGINS | Extra browser origins, comma-separated, allowed to call it. | None |
Relay and pairing (managed by the CLI)#
When you run lattice-ctl relay connect, the CLI redeems the bootstrap token and
writes the relay configuration the daemon needs — you normally do not set these
by hand. They are listed here for debugging a paired runtime.
| Variable | Purpose |
|---|---|
LATTICE_RELAY_BASE_URL | Relay endpoint the daemon polls outbound. |
LATTICE_RELAY_LATTICE_ID | The lat_... id of this runtime. |
LATTICE_RELAY_ACCOUNT_ID | The account that owns this runtime. |
LATTICE_RELAY_AUTH_TOKEN | The daemon's relay authentication token. |
LATTICE_RELAY_DISPLAY_NAME | Human-readable runtime name. |
LATTICE_RELAY_EXECUTION_BACKEND | Which backend the daemon executes work with. |
LATTICE_GATEWAY_URL | Lattice Cloud gateway base URL. |
For the full pairing flow, see Personal runtimes. For advanced tuning, see Advanced configuration.