{"record":{"id":"d668f73ac77e0cb7","repo":"browser-use/browser-use","slug":"invalid-model-model-use-a-bu-alias","errorCode":null,"errorMessage":"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'.","messagePattern":"Invalid model: '(.+?)'\\. Use a 'bu-\\*' alias \\((.+?)\\) or a provider-prefixed id like 'anthropic/claude-sonnet-4-6', 'openai/gpt-5\\.5', or 'google/gemini-3-pro'\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"browser_use/llm/browser_use/chat.py","lineNumber":80,"sourceCode":"\t\t\t\t- 'bu-2-0' or 'bu-latest': Premium model\n\t\t\t\t- 'bu-1-0': Previous generation model, redirected to bu-2-0 at the gateway\n\t\t\t\t- 'bu-qa-1': Website QA model (tests a site and scores functionality/aesthetics)\n\t\t\t\t- 'browser-use/bu-30b-a3b-preview': Browser Use Open Source Model\n\t\t\t\t- Provider-prefixed ids resolved by the gateway, e.g. 'anthropic/claude-sonnet-4-6',\n\t\t\t\t  'openai/gpt-5.5', 'google/gemini-3-pro'.\n\t\t\tapi_key: API key for browser-use cloud. Defaults to BROWSER_USE_API_KEY env var.\n\t\t\tbase_url: Base URL for the API. Defaults to BROWSER_USE_LLM_URL env var or production URL.\n\t\t\ttimeout: Request timeout in seconds.\n\t\t\tmax_retries: Maximum number of retries for transient errors (default: 5).\n\t\t\tretry_base_delay: Base delay in seconds for exponential backoff (default: 1.0).\n\t\t\tretry_max_delay: Maximum delay in seconds between retries (default: 60.0).\n\t\t\"\"\"\n\t\t# Accept 'bu-*' aliases and any provider-prefixed id; the gateway resolves the\n\t\t# latter (anthropic/*, openai/*, google/*, browser-use/*), so we don't enumerate them.\n\t\tbu_aliases = ['bu-latest', 'bu-1-0', 'bu-2-0', 'bu-2-0-mini-preview', 'bu-qa-1']\n\t\tis_valid = model in bu_aliases or '/' in model\n\t\tif not is_valid:\n\t\t\traise ValueError(\n\t\t\t\tf\"Invalid model: '{model}'. Use a 'bu-*' alias ({', '.join(bu_aliases)}) \"\n\t\t\t\t\"or a provider-prefixed id like 'anthropic/claude-sonnet-4-6', \"\n\t\t\t\t\"'openai/gpt-5.5', or 'google/gemini-3-pro'.\"\n\t\t\t)\n\n\t\t# Normalize bu-latest to the current latest model. Deliberately not the constructor\n\t\t# default: 'latest' tracks the stable premium line, not the preview.\n\t\tif model == 'bu-latest':\n\t\t\tself.model = 'bu-2-0'\n\t\telse:\n\t\t\tself.model = model\n\n\t\tself.fast = False\n\t\tself.api_key = api_key or os.getenv('BROWSER_USE_API_KEY')\n\t\tself.base_url = base_url or os.getenv('BROWSER_USE_LLM_URL', 'https://llm.api.browser-use.com')\n\t\tself.timeout = timeout\n\t\tself.max_retries = max_retries\n\t\tself.retry_base_delay = retry_base_delay","sourceCodeStart":62,"sourceCodeEnd":98,"githubUrl":"https://github.com/browser-use/browser-use/blob/6c73fced2f6d45a11d88622fe56365a5fe18f28b/browser_use/llm/browser_use/chat.py#L62-L98","documentation":"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.","triggerScenarios":"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).","commonSituations":"Copying model ids from other Chat* classes; outdated alias names after the gateway changed its model list; swapping providers without updating the model string.","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"],"exampleFix":"```python\n# before\nllm = ChatBrowserUse(model='claude-sonnet-4')\n\n# after\nllm = ChatBrowserUse(model='anthropic/claude-sonnet-4-6')\n# or simply ChatBrowserUse()  # defaults to bu-latest\n```","handlingStrategy":"validation","validationCode":"```python\nBU_ALIASES = ['bu-latest', 'bu-1-0', 'bu-2-0', 'bu-2-0-mini-preview', 'bu-qa-1']\ndef valid_bu_model(model: str) -> bool:\n    return model in BU_ALIASES or '/' in model\n```","typeGuard":"```python\ndef is_bu_model(m: str) -> bool:\n    return m in BU_ALIASES or ('/' in m and not m.startswith('/'))\n```","tryCatchPattern":null,"preventionTips":["Default to ChatBrowserUse() with no model argument","Keep model ids in config and validate them at startup"],"tags":["browser-use-cloud","model-config","validation"],"backgroundTag":null,"analyzedSha":"6c73fced2f6d45a11d88622fe56365a5fe18f28b","analyzedAt":"2026-08-14T19:42:40.557Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}