CF_ORCH_URL makes sense internally but isn't self-explanatory for a local-first user setting up their own GPU rig. Follows the GPU_SERVER_URL convention Kiwi already established (app/core/config.py there). - app/config.py: resolves GPU_SERVER_URL -> CF_ORCH_URL (back-compat alias) -> https://orch.circuitforge.tech default when CF_LICENSE_KEY is present (Paid+ tiers). Written back to os.environ["CF_ORCH_URL"] so existing callers (get_llm_config, app/api/chat.py) needed zero changes. - .env.example / .env.cloud.example: document GPU_SERVER_URL as the primary name, CF_ORCH_URL noted as a still-honoured legacy alias. - compose.cloud.yml: the hardcoded coordinator URL now sets GPU_SERVER_URL instead of CF_ORCH_URL directly (relies on the same config.py normalization). - docs/reference/environment-variables.md updated. - 6 new tests covering the resolution priority chain and the write-back behavior legacy callers depend on. Closes: #10
43 lines
2 KiB
Markdown
43 lines
2 KiB
Markdown
# Environment Variables
|
|
|
|
Copy `.env.example` to `.env` and configure as needed.
|
|
|
|
## Core
|
|
|
|
| Variable | Default | Description |
|
|
|----------|---------|-------------|
|
|
| `PAGEPIPER_DATA_DIR` | `data` | Directory for SQLite databases and uploads |
|
|
| `PAGEPIPER_WATCH_DIR` | _(unset)_ | Directory scanned for PDFs/EPUBs on demand |
|
|
| `SECRET_KEY` | _(required)_ | Random secret for internal signing |
|
|
|
|
## Ollama / BYOK
|
|
|
|
| Variable | Default | Description |
|
|
|----------|---------|-------------|
|
|
| `PAGEPIPER_OLLAMA_URL` | _(unset)_ | Ollama base URL, e.g. `http://localhost:11434`. Enables hybrid search and chat. |
|
|
| `PAGEPIPER_EMBED_MODEL` | `nomic-embed-text` | Ollama embedding model |
|
|
| `PAGEPIPER_EMBED_DIMS` | `1024` | Embedding dimensions (must match the model) |
|
|
| `PAGEPIPER_CHAT_MODEL` | `mistral:7b` | Ollama chat/completion model |
|
|
|
|
## GPU server / cf-orch (managed deployments)
|
|
|
|
| Variable | Default | Description |
|
|
|----------|---------|-------------|
|
|
| `GPU_SERVER_URL` | _(unset)_ | Self-hosted GPU rig / cf-orch coordinator URL for GPU allocation. Preferred over `CF_ORCH_URL`. |
|
|
| `CF_ORCH_URL` | _(unset)_ | Legacy alias for `GPU_SERVER_URL` — still honoured if `GPU_SERVER_URL` is unset. |
|
|
| `CF_LICENSE_KEY` | _(unset)_ | License key for cf-orch authentication. When set and neither `GPU_SERVER_URL` nor `CF_ORCH_URL` is configured, defaults `GPU_SERVER_URL` to `https://orch.circuitforge.tech` (Paid+ tiers). |
|
|
| `CF_APP_NAME` | `pagepiper` | Application identifier sent to cf-orch |
|
|
|
|
## License (cloud tier)
|
|
|
|
| Variable | Default | Description |
|
|
|----------|---------|-------------|
|
|
| `PAGEPIPER_HEIMDALL_URL` | _(unset)_ | Heimdall license server URL |
|
|
| `PAGEPIPER_HEIMDALL_TOKEN` | _(unset)_ | Admin token for license validation |
|
|
|
|
## Feature flags
|
|
|
|
| Variable | Default | Description |
|
|
|----------|---------|-------------|
|
|
| `PAGEPIPER_CHAT_FEEDBACK` | `false` | Enable thumbs up/down feedback UI on chat answers |
|
|
| `CLOUD_MODE` | `false` | Enable cloud-specific middleware (rate limiting, license checks) |
|