2x Faster Browser Automation with 50% Less Token Consumption
A lightweight, optimized code agent that revolutionizes browser automation through simplified input/output design.
The agent simplifies the traditional browser automation pipeline:
Core Innovation:
- Input: Highlighted screenshot only
- Output: Think + Python code for browser operations and data extraction
# Copy and configure environment variables
cp .env.example .env
# Edit .env with your LLM API keys# Install uv package manager
pip install uv
# Install project dependencies
uv syncfrom dotenv import load_dotenv
import asyncio
import os
load_dotenv()
from light_browser_use.agents.light_browser_use_agent import LightBrowserUseAgent
from light_browser_use.llm.openai_compatible import ChatOpenAICompatible
async def main():
task = "search vibesurf, go into its github repo, summary the latest release for me"
llm = ChatOpenAICompatible(model='qwen-vl-max',
base_url=os.getenv("DASHSCOPE_ENDPOINT"),
api_key=os.getenv("DASHSCOPE_API_KEY"))
agent = LightBrowserUseAgent(
task=task,
max_steps=30,
llm=llm
)
try:
print('Running light browser agent...')
session = await agent.run()
finally:
await agent.close()
asyncio.run(main())