Configuration Settings
Relevant source files
The following files were used as context for generating this wiki page:
The configuration settings within the Web UI project facilitate a modular and flexible environment for managing AI agent behavior, Large Language Model (LLM) parameters, and browser orchestration. These settings are managed through a combination of environment variables, default Python dictionaries, and persistent .pkl files, allowing users to customize everything from API endpoints to the physical dimensions of the automated browser window.
This system serves as the central backbone for the Gradio-based interface, ensuring that the CustomAgent and Browser instances are initialized with the correct state. Configuration is divided into several logical categories: LLM provider details, Agent operational limits, Browser environment variables, and persistence settings.
Sources: src/utils/default_config_settings.py:8-33, webui.py:465-475, README.md:120-135
Core Configuration Architecture
The architecture relies on a multi-layered approach to configuration. At the lowest level, environment variables (often loaded from a .env file) define sensitive data like API keys. Above this, the default_config() function provides a baseline state. Finally, the UI allows for dynamic updates and the ability to save/load these states to disk using UUID-named pickle files.
Configuration Data Flow
The following diagram illustrates how configuration data moves from source to the functional components of the system.
This flow ensures that users can either rely on preset defaults or maintain complex, task-specific configurations that can be reloaded across sessions.
Sources: src/utils/default_config_settings.py:36-62, webui.py:809-840
LLM Provider Settings
The system supports multiple LLM providers, each requiring specific configuration parameters such as base URLs and API keys. These are handled dynamically through utility functions that map provider types to their respective LangChain implementations.
Supported Providers and Models
| Provider | Default Model | Environment Variable |
|---|---|---|
| OpenAI | gpt-4o | OPENAI_API_KEY |
| Anthropic | claude-3-5-sonnet-20240620 | ANTHROPIC_API_KEY |
| gemini-2.0-flash-exp | GOOGLE_API_KEY | |
| DeepSeek | deepseek-chat | DEEPSEEK_API_KEY |
| Ollama | qwen2.5:7b | N/A (Local) |
| Azure OpenAI | gpt-4o | AZURE_OPENAI_API_KEY |
Sources: src/utils/utils.py:168-179, src/utils/utils.py:13-143
LLM Initialization Logic
The get_llm_model function in src/utils/utils.py acts as a factory. It consumes configuration parameters—including temperature, num_ctx (for Ollama), and base_url—to instantiate the correct chat model.
# Example logic for provider-specific base URL configuration
if provider == "openai":
if not kwargs.get("base_url", ""):
base_url = os.getenv("OPENAI_ENDPOINT", "https://api.openai.com/v1")
else:
base_url = kwargs.get("base_url")
Sources: src/utils/utils.py:53-58
Browser and Environment Orchestration
Browser settings control the execution environment of the Playwright-based agent. These settings determine if the agent uses a fresh browser instance or a persistent one linked to a local Chrome profile.
Browser Parameters
| Setting | Type | Default | Description |
|---|---|---|---|
use_own_browser | Boolean | False | Uses local Chrome via CHROME_PATH. |
headless | Boolean | False | Runs browser without a visible GUI. |
window_w | Integer | 1280 | Width of the browser viewport. |
window_h | Integer | 1100 | Height of the browser viewport. |
disable_security | Boolean | True | Disables web security for automation. |
Sources: src/utils/default_config_settings.py:10-25
Deployment Configuration (Docker)
In containerized environments, configuration is passed through docker-compose.yml and managed by supervisord.conf. This includes VNC settings for remote viewing and Xvfb for virtual display management.
Configuration Persistence
The system provides utility functions to serialize the current UI state into pickle files. This is particularly useful for saving complex agent tasks and LLM parameters.
Persistence Functions
save_config_to_file(settings, save_dir): Generates a UUID and saves the settings dictionary to a.pklfile.load_config_from_file(config_file): Deserializes a.pklfile to retrieve a settings dictionary.update_ui_from_config(config_file): A Gradio-specific callback that takes a loaded dictionary and returnsgr.update()objects for all UI components.
Sources: src/utils/default_config_settings.py:44-106
Summary
The configuration settings of the Web UI project provide a robust framework for managing the intersection of AI agents and browser automation. By supporting diverse LLM providers and detailed browser environment controls, the system ensures high adaptability for various research and automation tasks. The inclusion of Docker-based environment variables and persistent configuration files allows for seamless transitions between local development and containerized production deployments.
Sources: README.md:140-150, webui.py:910-920