Skip to content

Environment Variables

Forge reads the following environment variables. They override values in config.toml but are themselves overridden by CLI flags.


Controls the log verbosity level.

ValueDescription
traceExtremely verbose; logs internal state transitions.
debugVerbose; logs index operations, heartbeat decisions, query plans.
infoDefault. Normal operational messages.
warnWarnings only (heartbeat failures, stale index alerts).
errorErrors only.
Terminal window
FORGE_LOG=debug forge index . 2>forge-debug.log

This is the same value accepted by the --log-level CLI flag. Both accept RUST_LOG-style filter syntax (e.g., forge=debug,forge_core=trace).


Override the default Forge data directory (~/.forge). All state files — license, stats, heartbeat cache, community usage — are stored under this directory.

Terminal window
export FORGE_DATA_DIR=/opt/forge-state
forge serve .

Useful for:

  • Running multiple independent Forge installations on the same machine.
  • Containers and CI environments where $HOME is not writable.
  • Integration tests that must not touch the real ~/.forge.

Provide a license key via environment variable instead of running forge activate. The key is validated in-memory; nothing is written to ~/.forge/license.json.

Terminal window
export FORGE_LICENSE_KEY="eyJrZXki...<base64_payload>.<base64_signature>"
forge serve .

Intended for:

  • CI environments where persisting a license file is impractical.
  • Docker containers that receive the key at runtime.
  • Scripts that run forge ci as part of a pipeline.

The key format is the same as for forge activate. See License File Format for the key structure.


URL of the Ollama server. Used by the ollama embedding backend.

Terminal window
export OLLAMA_HOST=http://192.168.1.10:11434
forge index . --with-embeddings

Default: http://localhost:11434

Also readable as the ollama_host config key in ~/.forge/config.toml. Environment variable takes precedence.


Override the directory where Ollama stores model blobs.

Terminal window
export OLLAMA_MODELS=/data/ollama/models
forge warmup-model

When not set, Forge searches for model blobs in this order:

  1. $OLLAMA_MODELS
  2. ~/.ollama/models/
  3. /usr/share/ollama/.ollama/models/ (upstream systemd installer)
  4. /var/lib/ollama/.ollama/models/ (alternative systemd path)
  5. Homebrew install paths

The first directory that contains the requested model is used.


Override the heartbeat endpoint URL. Used for testing and internal development only. Standard builds point to https://forge-license-webhook.ironpinelabs.workers.dev/heartbeat.

Terminal window
# Test against a local mock server
export FORGE_HEARTBEAT_URL=http://localhost:8787/heartbeat
forge config heartbeat now

This variable is not intended for customer use. Do not set it in production environments.


VariableDefaultDescription
FORGE_LOGinfoLog verbosity level.
FORGE_DATA_DIR~/.forgeOverride the Forge data directory.
FORGE_LICENSE_KEYProvide license key without activating. For CI use.
OLLAMA_HOSThttp://localhost:11434Ollama server URL for embedding generation.
OLLAMA_MODELS(auto-detected)Override Ollama model blob directory.
FORGE_HEARTBEAT_URL(compiled-in URL)Override heartbeat endpoint. Internal/testing only.