Open-source Python library for AI browser agents, plus Browser Use Cloud: stealth browsers and a hosted agent API.
Python ai-agentsai-toolsbrowser-agentbrowser-automationbrowser-usecdpcloud-browsercomputer-useheadless-browserllmmcpplaywrightpythonremote-browserstealth-browserweb-automationweb-scraping
Fix Cerebras GLM alias resolution
Ryan Loneyae9d11cc1bb7
diff --git a/browser_use/llm/models.py b/browser_use/llm/models.pyindex 28ad163e8..81a277731 100644--- a/browser_use/llm/models.py+++ b/browser_use/llm/models.py@@ -143,6 +143,8 @@ def get_llm_by_name(model_name: str):model = model_part.replace('llama_4_maverick', 'llama-4-maverick').replace('_', '-')elif 'gpt_oss_120b' in model_part:model = model_part.replace('gpt_oss_120b', 'gpt-oss-120b')+ elif 'zai_glm_4_7' in model_part:+ model = model_part.replace('zai_glm_4_7', 'zai-glm-4.7')elif 'qwen_3_32b' in model_part:model = model_part.replace('qwen_3_32b', 'qwen-3-32b')elif 'qwen_3_235b_a22b_instruct' in model_part:diff --git a/tests/ci/models/test_llm_model_factory.py b/tests/ci/models/test_llm_model_factory.pyindex 7643de28d..a37a3ab9d 100644--- a/tests/ci/models/test_llm_model_factory.py+++ b/tests/ci/models/test_llm_model_factory.py@@ -1,4 +1,5 @@from browser_use.llm.anthropic.chat import ChatAnthropic+from browser_use.llm.cerebras.chat import ChatCerebrasfrom browser_use.llm.models import get_llm_by_name@@ -10,3 +11,13 @@ def test_get_llm_by_name_resolves_anthropic_from_env(monkeypatch):assert isinstance(llm, ChatAnthropic)assert llm.model == 'claude-sonnet-4-0'assert llm.api_key == 'anthropic-test-key'+++def test_get_llm_by_name_preserves_cerebras_zai_glm_version_separator(monkeypatch):+ monkeypatch.setenv('CEREBRAS_API_KEY', 'cerebras-test-key')++ llm = get_llm_by_name('cerebras_zai_glm_4_7')++ assert isinstance(llm, ChatCerebras)+ assert llm.model == 'zai-glm-4.7'+ assert llm.api_key == 'cerebras-test-key'