Environment Variables
Relevant source files
The following files were used as context for generating this wiki page:
Environment variables serve as the primary configuration mechanism for the Web UI project, managing sensitive credentials, browser behavior, and containerized runtime settings. They allow the system to interface with various LLM providers and control the lifecycle of the automated browser instances.
The project utilizes a .env file for local development and standard environment injection for Docker deployments. These variables are loaded at runtime using dotenv and accessed throughout the application to initialize LLM clients and browser contexts.
Sources: README.md:92-95, webui.py:5-7, src/utils/deep_research.py:3-5
LLM Provider Configuration
The application supports multiple Large Language Model (LLM) providers. Each provider requires specific environment variables for authentication and API endpoint specification.
API Credentials and Endpoints
| Variable | Description | Default / Example |
|---|---|---|
OPENAI_API_KEY | API key for OpenAI services | - |
OPENAI_ENDPOINT | Custom endpoint for OpenAI-compatible APIs | https://api.openai.com/v1 |
ANTHROPIC_API_KEY | API key for Anthropic (Claude) models | - |
GOOGLE_API_KEY | API key for Google Gemini models | - |
AZURE_OPENAI_API_KEY | API key for Azure-hosted OpenAI instances | - |
AZURE_OPENAI_ENDPOINT | The endpoint URL for Azure OpenAI | - |
DEEPSEEK_API_KEY | API key for DeepSeek models | - |
DEEPSEEK_ENDPOINT | API endpoint for DeepSeek | https://api.deepseek.com |
Sources: docker-compose.yml:18-27, src/utils/utils.py:48-95, tests/test_llm_api.py:40-48
LLM Initialization Logic
The get_llm_model function dynamically constructs the environment variable name based on the provider string (e.g., provider.upper() + "_API_KEY") to fetch credentials if not provided via the UI.
Sources: src/utils/utils.py:31-38
The diagram shows how the system prioritizes UI-provided keys before falling back to environment variables.
Sources: src/utils/utils.py:31-41, src/utils/utils.py:157-165
Browser and Session Management
Environment variables control how the automated browser behaves, particularly regarding persistence and identity.
Browser Pathing and Data
CHROME_PATH: Specifies the executable path of the browser. If left empty, the system attempts to find a default.CHROME_USER_DATA: Defines the directory for browser profile data, enabling persistent logins and sessions.
Sources: README.md:121-135, src/utils/deep_research.py:46-51
Persistence Settings
The CHROME_PERSISTENT_SESSION variable determines the default state of the "Use Own Browser" toggle and influences how Docker containers manage the browser lifecycle.
- Value
true: Browser stays open between tasks, maintaining history. - Value
false: (Default) Browser opens and closes per task for a clean state.
Sources: src/utils/default_config_settings.py:20, README.md:154-162
Docker and Infrastructure Configuration
When running via Docker, several variables manage the virtual display, VNC access, and containerized browser environment.
Virtual Display and VNC
DISPLAY: Set to:99to route browser GUI to the Xvfb virtual frame buffer.RESOLUTION: Configures the Xvfb screen size (e.g.,1920x1080x24).RESOLUTION_WIDTH/RESOLUTION_HEIGHT: Used by the persistent browser process to set the window size.VNC_PASSWORD: Sets the access password for the noVNC web interface.
Sources: docker-compose.yml:31-38, supervisord.conf:10-15
Internal Process Management
The supervisord.conf file uses environment variables to pass configurations to sub-processes like Xvfb and the persistent_browser.
Sources: supervisord.conf:10, supervisord.conf:57
This diagram illustrates how environment variables are propagated from the host/container through Supervisord to the underlying display and browser processes.
Sources: supervisord.conf:10-75
Miscellaneous Settings
BROWSER_USE_LOGGING_LEVEL: Controls the verbosity of logs (default:info).ANONYMIZED_TELEMETRY: Explicitly set tofalsein default configurations to disable tracking.PLAYWRIGHT_BROWSERS_PATH: Defines where Playwright looks for browser binaries inside the container (e.g.,/ms-playwright).
Sources: docker-compose.yml:28-32
The environment variable system provides a robust layer of abstraction, allowing the Web UI to be portable across local installations and complex containerized environments while securing sensitive API tokens.