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: Update DeepSeek default model to deepseek-v4-flash after chat/reasoner retirement.
DipsyHouc7214fa867ed
diff --git a/browser_use/llm/deepseek/chat.py b/browser_use/llm/deepseek/chat.pyindex 26f656c8b..c9db7cc06 100644--- a/browser_use/llm/deepseek/chat.py+++ b/browser_use/llm/deepseek/chat.py@@ -29,13 +29,14 @@ T = TypeVar('T', bound=BaseModel)class ChatDeepSeek(BaseChatModel):"""DeepSeek /chat/completions wrapper (OpenAI-compatible)."""- model: str = 'deepseek-chat'+ model: str = 'deepseek-v4-flash'# Generation parametersmax_tokens: int | None = Nonetemperature: float | None = Nonetop_p: float | None = Noneseed: int | None = None+ thinking: bool = False# Connection parametersapi_key: str | None = None@@ -59,6 +60,23 @@ class ChatDeepSeek(BaseChatModel):def name(self) -> str:return self.model+ def _request_kwargs(self) -> dict[str, Any]:+ common: dict[str, Any] = {}++ if self.temperature is not None:+ common['temperature'] = self.temperature+ if self.max_tokens is not None:+ common['max_tokens'] = self.max_tokens+ if self.top_p is not None:+ common['top_p'] = self.top_p+ if self.seed is not None:+ common['seed'] = self.seed++ common['extra_body'] = {+ 'thinking': {'type': 'enabled' if self.thinking else 'disabled'},+ }+ return common+@overloadasync def ainvoke(self,@@ -96,16 +114,7 @@ class ChatDeepSeek(BaseChatModel):"""client = self._client()ds_messages = DeepSeekMessageSerializer.serialize_messages(messages)- common: dict[str, Any] = {}-- if self.temperature is not None:- common['temperature'] = self.temperature- if self.max_tokens is not None:- common['max_tokens'] = self.max_tokens- if self.top_p is not None:- common['top_p'] = self.top_p- if self.seed is not None:- common['seed'] = self.seed+ common = self._request_kwargs()# Beta conversation prefix continuation (see official documentation)if self.base_url and str(self.base_url).endswith('/beta'):diff --git a/examples/models/deepseek-chat.py b/examples/models/deepseek-chat.pyindex cf05ceace..1f1a9aaff 100644--- a/examples/models/deepseek-chat.py+++ b/examples/models/deepseek-chat.py@@ -20,7 +20,7 @@ if deepseek_api_key is None:async def main():llm = ChatDeepSeek(base_url='https://api.deepseek.com/v1',- model='deepseek-chat',+ model='deepseek-v4-flash',api_key=deepseek_api_key,)diff --git a/skills/open-source/references/models.md b/skills/open-source/references/models.mdindex 30438aec7..497d6fbbb 100644--- a/skills/open-source/references/models.md+++ b/skills/open-source/references/models.md@@ -150,7 +150,7 @@ Supports profiles, IAM roles, SSO via standard AWS credential chain. Install wit```pythonfrom browser_use import Agent, ChatDeepSeek-llm = ChatDeepSeek(model="deepseek-chat")+llm = ChatDeepSeek(model="deepseek-v4-flash")```**Env:** `DEEPSEEK_API_KEY` | [Available models](https://api-docs.deepseek.com/quick_start/pricing)