Reference1 min readgenerated from the code

Configuration

Two sources, one rule: the environment wins. A deployment that pins a root or exports a key should not be overridden by a file someone edited through a browser, and every surface that shows a resolved value also shows which of the two it came from.

Environment

variable what it does
LANCE_ROOT the database to read. Wins over any saved connection
LANCESCOPE_CONFIG where the settings file lives (default ~/.config/lancescope/settings.json)
ANTHROPIC_API_KEY enables the Claude path; beats a stored key
LANCESCOPE_LLM_PROVIDER auto · anthropic · ollama · openai-compat · none (default: auto-detect)
OLLAMA_HOST as Ollama itself defines it (default http://localhost:11434)
LANCESCOPE_LLM_BASE_URL for an OpenAI-compatible endpoint
LANCESCOPE_LLM_API_KEY for an OpenAI-compatible endpoint
LANCESCOPE_CACHE cached answers (default ~/.cache/lancescope)
LANCESCOPE_SPEND_CEILING dollars, per process. Refuses before spending past it
API_ORIGIN where the web app proxies /api/*

The settings file

Written at mode 0600, because a stored API key would be in it. It is the only file this project writes, and it is never written inside a dataset directory.

json
{
  "version": 1,
  "connections": [
    { "id": "…", "label": "…", "uri": "/path/to/tables", "added": "…" }
  ],
  "active_id": "…",
  "intelligence": {
    "enabled": true,
    "provider": "auto",
    "model": null,
    "model_fast": null,
    "spend_ceiling_usd": null
  }
}

Where the root comes from

In order, first match wins:

  1. LANCE_ROOT
  2. the active saved connection
  3. the ingest output directory, only if it holds tables
  4. nothing — and the console says so rather than showing an empty database