Skip to content

Add support for DEFAULT_LLM_MODEL environment variable#637

Open
Abbeyme1 wants to merge 1 commit into
browser-use:mainfrom
Abbeyme1:feature/default-llm-env-support
Open

Add support for DEFAULT_LLM_MODEL environment variable#637
Abbeyme1 wants to merge 1 commit into
browser-use:mainfrom
Abbeyme1:feature/default-llm-env-support

Conversation

@Abbeyme1

@Abbeyme1 Abbeyme1 commented Jun 14, 2025

Copy link
Copy Markdown

Summary

This PR introduces support for a new environment variable DEFAULT_LLM_MODEL to configure the default LLM model used by the web-ui. This eliminates the need to repeatedly set the model manually.

Changes Made

  • Added support for DEFAULT_LLM_MODEL in the executable script.

  • Updated code to fetch the model using:

    os.getenv("DEFAULT_LLM_MODEL", config.model_names[os.getenv("DEFAULT_LLM", "openai")][0])
  • Ensures a consistent and convenient way to define the default model through environment variables.


How to Test

  1. Set the environment variable before running:

    export DEFAULT_LLM_MODEL=gpt-4
  2. Start the web-ui

  3. The selected model should default to the value set in DEFAULT_LLM_MODEL without requiring manual selection.


Notes

  • If DEFAULT_LLM_MODEL is not set, fallback logic still uses the default model from config.model_names based on the DEFAULT_LLM provider or defaults to "openai".

Summary by cubic

Added support for the DEFAULT_LLM_MODEL environment variable to set the default LLM model in the web UI.

  • New Features
    • The web UI now uses DEFAULT_LLM_MODEL to pick the default model, so users no longer need to select it manually.
    • If DEFAULT_LLM_MODEL is not set, the app falls back to the existing default logic.
@CLAassistant

CLAassistant commented Jun 14, 2025

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cubic reviewed 2 files and found no issues. Review PR in cubic.dev.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants