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
Remove litellm from dependencies (supply chain attack CVE)
Magnus Müllerd4b9e30188ef
diff --git a/browser_use/llm/litellm/chat.py b/browser_use/llm/litellm/chat.pyindex 1c0707491..3510fe846 100644--- a/browser_use/llm/litellm/chat.py+++ b/browser_use/llm/litellm/chat.py@@ -1,3 +1,12 @@+"""+ChatLiteLLM - LiteLLM chat model wrapper.++Requires the `litellm` package to be installed separately:+ pip install litellm++Note: litellm is NOT included as a dependency of browser-use.+"""+import loggingfrom dataclasses import dataclass, fieldfrom typing import Any, TypeVar, overload@@ -33,7 +42,7 @@ class ChatLiteLLM(BaseChatModel):def __post_init__(self) -> None:"""Resolve provider info from the model string via litellm."""try:- from litellm import get_llm_provider+ from litellm import get_llm_provider # type: ignore[reportMissingImports]self._clean_model, self._provider_name, _, _ = get_llm_provider(self.model)except Exception:@@ -108,9 +117,9 @@ class ChatLiteLLM(BaseChatModel):output_format: type[T] | None = None,**kwargs: Any,) -> ChatInvokeCompletion[T] | ChatInvokeCompletion[str]:- from litellm import acompletion- from litellm.exceptions import APIConnectionError, APIError, RateLimitError, Timeout- from litellm.types.utils import ModelResponse+ from litellm import acompletion # type: ignore[reportMissingImports]+ from litellm.exceptions import APIConnectionError, APIError, RateLimitError, Timeout # type: ignore[reportMissingImports]+ from litellm.types.utils import ModelResponse # type: ignore[reportMissingImports]litellm_messages = LiteLLMMessageSerializer.serialize(messages)diff --git a/pyproject.toml b/pyproject.tomlindex 5dd194bed..b3b5afea1 100644--- a/pyproject.toml+++ b/pyproject.toml@@ -2,7 +2,7 @@name = "browser-use"description = "Make websites accessible for AI agents"authors = [{ name = "Gregor Zunic" }]-version = "0.12.4"+version = "0.12.5"readme = "README.md"requires-python = ">=3.11,<4.0"classifiers = [@@ -46,7 +46,6 @@ dependencies = ["markdownify==1.2.2","python-docx==1.2.0","browser-use-sdk==2.0.15",- "litellm==1.82.2",]# google-api-core: only used for Google LLM APIs# pyperclip: only used for examples that use copy/paste