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(llm): resolve DeepSeek and Cerebras API keys explicitly
nina-mir61a540307fe6
diff --git a/browser_use/llm/cerebras/chat.py b/browser_use/llm/cerebras/chat.pyindex fdf061c60..e87a00b1c 100644--- a/browser_use/llm/cerebras/chat.py+++ b/browser_use/llm/cerebras/chat.py@@ -1,5 +1,6 @@from __future__ import annotations+import osfrom dataclasses import dataclassfrom typing import Any, TypeVar, overload@@ -47,8 +48,16 @@ class ChatCerebras(BaseChatModel):return 'cerebras'def _client(self) -> AsyncOpenAI:+ api_key = self.api_key or os.getenv('CEREBRAS_API_KEY')+ if not api_key:+ raise ModelProviderError(+ message='Missing Cerebras API key. Set CEREBRAS_API_KEY or pass api_key.',+ status_code=401,+ model=self.name,+ )+return AsyncOpenAI(- api_key=self.api_key,+ api_key=api_key,base_url=self.base_url,timeout=self.timeout,**(self.client_params or {}),diff --git a/browser_use/llm/deepseek/chat.py b/browser_use/llm/deepseek/chat.pyindex 77c050e7e..f67dca0aa 100644--- a/browser_use/llm/deepseek/chat.py+++ b/browser_use/llm/deepseek/chat.py@@ -1,6 +1,7 @@from __future__ import annotationsimport json+import osfrom dataclasses import dataclassfrom typing import Any, TypeVar, overload@@ -50,8 +51,16 @@ class ChatDeepSeek(BaseChatModel):return 'deepseek'def _client(self) -> AsyncOpenAI:+ api_key = self.api_key or os.getenv('DEEPSEEK_API_KEY')+ if not api_key:+ raise ModelProviderError(+ message='Missing DeepSeek API key. Set DEEPSEEK_API_KEY or pass api_key.',+ status_code=401,+ model=self.name,+ )+return AsyncOpenAI(- api_key=self.api_key,+ api_key=api_key,base_url=self.base_url,timeout=self.timeout,**(self.client_params or {}),