browser-use/browser-use · error · ValueError
Invalid model: '{model}'. Use a 'bu-*' alias ({', '.join(bu_
Error message
Invalid model: '{model}'. Use a 'bu-*' alias ({', '.join(bu_aliases)}) or a provider-prefixed id like 'anthropic/claude-sonnet-4-6', 'openai/gpt-5.5', or 'google/gemini-3-pro'. What it means
ChatBrowserUse's constructor validates the model string: it must either be one of the known 'bu-*' aliases (bu-latest, bu-1-0, bu-2-0, bu-2-0-mini-preview, bu-qa-1) or contain a '/' (provider-prefixed id such as anthropic/claude-sonnet-4-6, resolved by the gateway). Anything else is rejected immediately with this ValueError.
Source
Thrown at browser_use/llm/browser_use/chat.py:80
- 'bu-2-0' or 'bu-latest': Premium model
- 'bu-1-0': Previous generation model, redirected to bu-2-0 at the gateway
- 'bu-qa-1': Website QA model (tests a site and scores functionality/aesthetics)
- 'browser-use/bu-30b-a3b-preview': Browser Use Open Source Model
- Provider-prefixed ids resolved by the gateway, e.g. 'anthropic/claude-sonnet-4-6',
'openai/gpt-5.5', 'google/gemini-3-pro'.
api_key: API key for browser-use cloud. Defaults to BROWSER_USE_API_KEY env var.
base_url: Base URL for the API. Defaults to BROWSER_USE_LLM_URL env var or production URL.
timeout: Request timeout in seconds.
max_retries: Maximum number of retries for transient errors (default: 5).
retry_base_delay: Base delay in seconds for exponential backoff (default: 1.0).
retry_max_delay: Maximum delay in seconds between retries (default: 60.0).
"""
# Accept 'bu-*' aliases and any provider-prefixed id; the gateway resolves the
# latter (anthropic/*, openai/*, google/*, browser-use/*), so we don't enumerate them.
bu_aliases = ['bu-latest', 'bu-1-0', 'bu-2-0', 'bu-2-0-mini-preview', 'bu-qa-1']
is_valid = model in bu_aliases or '/' in model
if not is_valid:
raise ValueError(
f"Invalid model: '{model}'. Use a 'bu-*' alias ({', '.join(bu_aliases)}) "
"or a provider-prefixed id like 'anthropic/claude-sonnet-4-6', "
"'openai/gpt-5.5', or 'google/gemini-3-pro'."
)
# Normalize bu-latest to the current latest model. Deliberately not the constructor
# default: 'latest' tracks the stable premium line, not the preview.
if model == 'bu-latest':
self.model = 'bu-2-0'
else:
self.model = model
self.fast = False
self.api_key = api_key or os.getenv('BROWSER_USE_API_KEY')
self.base_url = base_url or os.getenv('BROWSER_USE_LLM_URL', 'https://llm.api.browser-use.com')
self.timeout = timeout
self.max_retries = max_retries
self.retry_base_delay = retry_base_delayView on GitHub (pinned to 6c73fced2f)
Solutions
- Use a bu-* alias, e.g. ChatBrowserUse(model='bu-2-0') (or 'bu-latest')
- Or use a provider-prefixed id: model='anthropic/claude-sonnet-4-6', 'openai/gpt-5.5', 'google/gemini-3-pro'
- If you meant a direct provider, use ChatOpenAI/ChatAnthropic/ChatGoogle instead of ChatBrowserUse
Example fix
```python # before llm = ChatBrowserUse(model='claude-sonnet-4') # after llm = ChatBrowserUse(model='anthropic/claude-sonnet-4-6') # or simply ChatBrowserUse() # defaults to bu-latest ```
Defensive patterns
Strategy: validation
Validate before calling
```python
BU_ALIASES = ['bu-latest', 'bu-1-0', 'bu-2-0', 'bu-2-0-mini-preview', 'bu-qa-1']
def valid_bu_model(model: str) -> bool:
return model in BU_ALIASES or '/' in model
``` Type guard
```python
def is_bu_model(m: str) -> bool:
return m in BU_ALIASES or ('/' in m and not m.startswith('/'))
``` Prevention
- Default to ChatBrowserUse() with no model argument
- Keep model ids in config and validate them at startup
When it happens
Trigger: Passing a bare model name like 'claude-sonnet-4' or 'gpt-5.5' (no provider prefix), a typo'd alias, or a model name meant for a different provider class (ChatOpenAI/ChatAnthropic names).
Common situations: Copying model ids from other Chat* classes; outdated alias names after the gateway changed its model list; swapping providers without updating the model string.
Related errors
- module '{__name__}' has no attribute '{name}'
- Failed to find DOM element based on backendNodeId, maybe pag
- Failed to click element: {js_e}
- JavaScript code must start with (...args) => format. Got: {p
- JavaScript code is empty after cleaning
AI-assisted analysis of browser-use/browser-use@6c73fced2f (2026-08-14).
Data as JSON: /api/errors/d668f73ac77e0cb7.
Report an issue: GitHub.