Browser-Use
Connect Browser-Use AI web automation to Lightcone cloud computers.
Browser-Use is an open-source framework that makes websites accessible to AI models. Connect it to Lightcone’s cloud computers for scalable, stealth-enabled web automation.
Install
Section titled “Install”pip install browser-use tzafon playwrightplaywright install chromiumExample
Section titled “Example”import osfrom browser_use import Agentfrom langchain_openai import ChatOpenAIfrom tzafon import Lightconefrom playwright.async_api import async_playwright
async def main(): # Create a Lightcone browser session client = Lightcone() session = client.computers.create(kind="browser")
# Build the full CDP URL from the relative endpoint path cdp_path = session.endpoints.get("cdp") cdp_url = f"https://api.tzafon.ai{cdp_path}"
# Connect Playwright to the Lightcone browser pw = await async_playwright().start() browser = await pw.chromium.connect_over_cdp(cdp_url, headers={ "Authorization": f"Bearer {os.environ['TZAFON_API_KEY']}", })
# Use Lightcone's own model via its OpenAI-compatible API llm = ChatOpenAI( model="tzafon.northstar-cua-fast", base_url="https://api.tzafon.ai/v1", api_key=os.environ["TZAFON_API_KEY"], )
# Create a Browser-Use agent on the remote browser agent = Agent( task="Search for 'machine learning' on Wikipedia and summarize the first paragraph", llm=llm, browser=browser, )
result = await agent.run() print(result)
await browser.close() await pw.stop() client.computers.delete(session.id)
import asyncioasyncio.run(main())Why use Lightcone with Browser-Use?
Section titled “Why use Lightcone with Browser-Use?”By default, Browser-Use runs a local Chromium browser. Connecting it to Lightcone gives you:
- Cloud execution — No local browser needed; scale to many concurrent tasks
- Stealth mode — Lightcone’s anti-detection features help access sites that block automation
- Residential proxies — Rotate IPs to avoid rate limiting
- Session persistence — Save and restore login state across runs
How it works
Section titled “How it works”Browser-Use uses Playwright internally. Lightcone exposes a Chrome DevTools Protocol (CDP) endpoint for each computer session. You connect Playwright to Lightcone’s CDP URL instead of launching a local browser, and Browser-Use operates on the remote session transparently.
Resources
Section titled “Resources”See also
Section titled “See also”- Playwright — direct CDP connection without Browser-Use
- Run a task — use Lightcone’s built-in Northstar as an alternative
- Legacy software — automate enterprise applications