> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bumbleagi.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Environment variables

> Every BUMBLEBEE_* and platform variable.

Set variables in `.env` at the repo root (gitignored, loaded automatically) or as system/Railway env vars.

## Platform tokens

| Variable                          | Purpose                                                                                           |
| --------------------------------- | ------------------------------------------------------------------------------------------------- |
| `TELEGRAM_TOKEN`                  | Telegram bot token (must match `token_env` in entity YAML)                                        |
| `DISCORD_TOKEN`                   | Discord bot token                                                                                 |
| `BUMBLEBEE_TELEGRAM_OPERATOR_IDS` | Comma-separated Telegram user IDs for `/privacy` operators. Merged with YAML `operator_user_ids`. |

## Deployment

| Variable                            | Default | Purpose                                                                                                                                                                                                                  |
| ----------------------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `BUMBLEBEE_DEPLOYMENT_MODE`         | `local` | `local` or `hybrid_railway`                                                                                                                                                                                              |
| `BUMBLEBEE_INFERENCE_PROVIDER`      | derived | `local`, `remote_gateway` (home tunnel gateway), **`openrouter`**, or **`venice`** (hosted OpenAI-compatible APIs for optional harness testing). See [Hosted inference (testing)](/deployment/hosted-inference-testing). |
| `BUMBLEBEE_INFERENCE_BASE_URL`      | —       | **Gateway:** tunnel root URL (no path). **Hosted presets:** optional override; otherwise defaults are baked in per provider. Must always be the **root before `/v1`**.                                                   |
| `BUMBLEBEE_INFERENCE_TIMEOUT`       | `120`   | Inference request timeout (seconds)                                                                                                                                                                                      |
| `BUMBLEBEE_INFERENCE_GATEWAY_TOKEN` | —       | Bearer token for **`remote_gateway`** (home inference gateway)                                                                                                                                                           |
| `BUMBLEBEE_INFERENCE_API_KEY_ENV`   | —       | Env var name for the Bearer token (gateway or hosted, depending on provider)                                                                                                                                             |
| `BUMBLEBEE_INFERENCE_PASS_NUM_CTX`  | —       | `true` / `false`: send Ollama-style `options.num_ctx` on chat. Use **`false`** for strict OpenAI-compatible hosts (OpenRouter, Venice, etc.).                                                                            |
| `OPENROUTER_API_KEY`                | —       | Bearer key when `BUMBLEBEE_INFERENCE_PROVIDER=openrouter` (unless overridden via `BUMBLEBEE_INFERENCE_API_KEY_ENV` / YAML).                                                                                              |
| `VENICE_API_KEY`                    | —       | Bearer key when `BUMBLEBEE_INFERENCE_PROVIDER=venice` (unless overridden).                                                                                                                                               |
| `BUMBLEBEE_TIMEZONE`                | —       | IANA timezone (e.g. `America/New_York`)                                                                                                                                                                                  |

## Ollama

| Variable      | Default                  | Purpose             |
| ------------- | ------------------------ | ------------------- |
| `OLLAMA_HOST` | `http://127.0.0.1:11434` | Override Ollama URL |

## Database

| Variable       | Purpose                                                                                      |
| -------------- | -------------------------------------------------------------------------------------------- |
| `DATABASE_URL` | Postgres connection string. When set, all structured memory uses Postgres instead of SQLite. |

## Execution

| Variable                              | Default            | Purpose                                                                                                                                        |
| ------------------------------------- | ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| `BUMBLEBEE_EXECUTION_RPC_URL`         | —                  | Remote execution host URL                                                                                                                      |
| `BUMBLEBEE_EXECUTION_RPC_TOKEN`       | —                  | Bearer token for execution RPC                                                                                                                 |
| `BUMBLEBEE_EXECUTION_WORKSPACE_DIR`   | —                  | Pin workspace root (e.g. `/app/data` on Railway). Also anchors the **persistent venv** (`$WORKSPACE/.venv`) and `HOME` for Railway entrypoint. |
| `BUMBLEBEE_SKIP_VOLUME_VENV`          | `0`                | Set to `1` to use the image Python instead of `$WORKSPACE/.venv` (debug only).                                                                 |
| `BUMBLEBEE_VOLUME_HOME`               | `$WORKSPACE/.home` | Override `HOME` on the volume (pip / Playwright caches).                                                                                       |
| `BUMBLEBEE_EXECUTION_REQUIRE_RAILWAY` | `false`            | Block all local execution when not on Railway                                                                                                  |

## Home gateway

| Variable                            | Default                  | Purpose                                                                                                                                                                  |
| ----------------------------------- | ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `BUMBLEBEE_PYTHON`                  | —                        | Optional full path to `python3` for `scripts/gateway.sh` when the interpreter on `PATH` is not the one with Bumblebee installed (common on macOS with multiple Pythons). |
| `INFERENCE_GATEWAY_TOKEN`           | —                        | Bearer token (must match worker's `BUMBLEBEE_INFERENCE_GATEWAY_TOKEN`)                                                                                                   |
| `OLLAMA_BASE_URL`                   | `http://127.0.0.1:11434` | Upstream Ollama URL                                                                                                                                                      |
| `INFERENCE_GATEWAY_HOST`            | `127.0.0.1`              | Gateway listen address                                                                                                                                                   |
| `INFERENCE_GATEWAY_PORT`            | `8010`                   | Gateway listen port                                                                                                                                                      |
| `INFERENCE_GATEWAY_BACKEND_TIMEOUT` | `120`                    | Timeout for Ollama requests                                                                                                                                              |
| `INFERENCE_GATEWAY_MAX_BODY_BYTES`  | `8000000`                | Max request body size                                                                                                                                                    |

## Object storage

| Variable                        | Purpose                            |
| ------------------------------- | ---------------------------------- |
| `BUMBLEBEE_ATTACHMENTS_BACKEND` | `local_disk` or `object_s3_compat` |
| `BUMBLEBEE_S3_ENDPOINT_URL`     | S3-compatible endpoint             |
| `BUMBLEBEE_S3_BUCKET`           | Bucket name                        |
| `BUMBLEBEE_S3_ACCESS_KEY`       | Access key                         |
| `BUMBLEBEE_S3_SECRET_KEY`       | Secret key                         |

## Optional tools

| Variable                | Purpose                                          |
| ----------------------- | ------------------------------------------------ |
| `FIRECRAWL_API_KEY`     | Firecrawl key for enhanced web search/scrape     |
| `FAL_API_KEY`           | Fal key for image generation                     |
| `HOME_ASSISTANT_URL`    | Home Assistant API URL for IoT tools             |
| `HOME_ASSISTANT_TOKEN`  | Home Assistant Long-Lived Access Token           |
| `MASTODON_URL`          | Mastodon instance URL for social broadcast tools |
| `MASTODON_ACCESS_TOKEN` | Mastodon access token                            |
| `X_API_KEY`             | X (Twitter) API Key                              |
| `X_API_SECRET`          | X (Twitter) API Secret                           |
| `X_ACCESS_TOKEN`        | X (Twitter) Access Token                         |
| `X_ACCESS_SECRET`       | X (Twitter) Access Secret                        |

## Railway

| Variable                 | Purpose                            |
| ------------------------ | ---------------------------------- |
| `BUMBLEBEE_ENTITY`       | Entity name to run (e.g. `canary`) |
| `BUMBLEBEE_RAILWAY_ROLE` | `worker` or `api`                  |
| `PORT`                   | API listen port (default `8080`)   |
