Browser Use: The Free AI Browser Agent Framework

Browser Use: The Free AI Browser Agent Framework

Quick answer: Browser Use is a free, MIT-licensed Python library (107,000+ GitHub stars) that lets an LLM drive a real browser from a plain-English task — reading the page, then clicking, typing, and scrolling in a loop, with no CSS selectors. The library has no key, quota, or fee; the only cost is the model, which is $0 if you point it at a local Ollama model or a free Gemini/Groq key. It reports 89.1% on the WebVoyager benchmark.

Give an LLM a goal like “log in, find last month’s invoice, download the PDF” and it describes the steps beautifully but can’t perform them — there’s no button inside a chat completion. The old fix, hand-scripting Selenium/Playwright selectors, shatters the moment a CSS class is renamed. Browser Use closes that gap: you describe the task, and the agent perceives the page semantically (via the accessibility tree and DOM) so it finds “the search box” or “the Accept button” without a hard-coded ID that breaks on the next redeploy. It’s used for form filling, cross-site extraction, E2E QA, and as the “hands” of larger agents (github.com/browser-use/browser-use).

Is Browser Use really free?

Yes — “free” three ways: the framework is MIT-licensed (commercial use, no revenue cap), no key or quota for the library (you pip install and run it; task count is bounded by hardware, not billing), and the only real cost is the model. Point it at a paid API and you pay per token; point it at a local Ollama model and the whole thing is $0; point it at a free API tier (Gemini, Groq) and you stay at $0 up to that provider’s limits. There’s also a paid Browser Use Cloud (proxy rotation, CAPTCHA solving, 1,000+ integrations) but it’s strictly additive — the self-hosted library stays free.

Install in 60 seconds

Needs Python 3.11+; installation is one package plus the Chromium binary Playwright drives:

pip install browser-use   # or: uv add browser-use  (recommended)
# It installs and manages its own Chromium automatically
import asyncio
from browser_use import Agent, ChatOpenAI

async def main():
    agent = Agent(
        task="Go to news.ycombinator.com and return the titles of the top 3 stories.",
        llm=ChatOpenAI(model="gpt-5.5-mini"),
    )
    history = await agent.run()
    print(history.final_result())

asyncio.run(main())

No selectors, no XPaths, no wait-for-element boilerplate. The history object records every step, action, and the final answer — far easier to debug than a black-box script.

How the agent loop works

On each step the agent (1) observes — captures a compressed, indexed view of interactive elements from the accessibility tree/DOM (optionally a screenshot for vision models); (2) decides — sends that state plus the task and history to the LLM, which returns the next action as structured output (“click element 14,” “type into element 7,” “done”); (3) acts via Playwright; and (4) reassesses the new page state, looping until “done” or the step limit. The key implication: every step is a fresh LLM call — a five-click task is at least five inferences — which is why model choice and step count drive both latency and cost.

Bring your own model — including free and local

Browser Use ships chat classes for 15+ providers, so switching brains is a one-line change:

Chat class Provider Free path?
ChatOllama Local models (Llama, Qwen) Fully $0 — your hardware
ChatGoogle Google Gemini Free API tier
ChatGroq Groq Free API tier
ChatOpenRouter OpenRouter (300+ models) :free variants
ChatCerebras Cerebras Free API tier
ChatDeepSeek / ChatMistral DeepSeek / Mistral Cheap / free tiers
ChatOpenAI / ChatAnthropic OpenAI / Anthropic Paid, highest accuracy
ChatLiteLLM 100+ providers via one gateway Depends on target

The genuinely $0 path is a local model via Ollama — raise the context window well above Ollama’s small default, because page states are large:

from browser_use import Agent, ChatOllama
llm = ChatOllama(model="qwen3", num_ctx=32000)   # page states are big
agent = Agent(task="Search Wikipedia for 'agentic AI' and summarize the intro.", llm=llm)

Or a free cloud key (Gemini’s free tier is popular for its speed and large context):

from browser_use import Agent, ChatGoogle
llm = ChatGoogle(model="gemini-2.5-flash")   # set GOOGLE_API_KEY
agent = Agent(task="Find today's top post on Hacker News and its comment count.", llm=llm)

Browser agents are unusually sensitive to model quality — a wrong decision on step 2 derails everything after. Per Browser Use’s own (directional, not independent) benchmark, its bu-ultra tops accuracy (~78%), with Claude Opus 4.6 (~62%), Claude Sonnet 4.6 (~59%), and Gemini 3.1 Pro (~59%) as strong standalone picks. The practical takeaway: prototype on a free/local model, and if the agent keeps taking wrong turns on a complex site, moving up a model tier beats any amount of prompt tinkering.

Five patterns you’ll actually use

1. Structured output — pass a Pydantic schema to get validated JSON, not prose:

from pydantic import BaseModel
from browser_use import Agent, ChatOpenAI

class Product(BaseModel):
    name: str; price: str; in_stock: bool

agent = Agent(task="Get name, price, stock for the top 'mechanical keyboard' result.",
    llm=ChatOpenAI(model="gpt-5.5-mini"), output_model_schema=Product)
result = await agent.run()
product = result.structured_output   # a validated Product

2. Reuse a logged-in session — attach a persistent profile so cookies survive between runs:

from browser_use import Browser
browser = Browser(user_data_dir="~/.config/browseruse/profiles/work")
agent = Agent(task="Open my dashboard and report this month's total.", llm=llm, browser=browser)

3. Keep secrets out of the model’s context — the model only sees placeholder names; real values are substituted at type-time in the browser:

agent = Agent(task="Log in with x_user and x_pass, then open Settings.", llm=llm,
    sensitive_data={"x_user": "[email protected]", "x_pass": "s3cr3t"})

4. Headless in production (Browser(headless=True)), headful while debugging. 5. Cap the steps so a stuck agent can’t spin up a bill — await agent.run(max_steps=25).

Browser Use vs Stagehand vs Skyvern

Dimension Browser Use Stagehand Skyvern
Language Python TypeScript / JS Python
License MIT MIT AGPL-3.0
Approach Agent-first autonomy loop Hybrid: act/extract/observe + deterministic Playwright Computer-vision agent for form-heavy sites
WebVoyager ~89% Strong (Browserbase-tuned) ~86%
Best for General autonomous browsing in Python TS shops wanting predictable, cheaper runs Complex forms across heterogeneous portals

Browser Use optimizes for agent autonomy and the largest community — start here if you write Python. Stagehand optimizes for cost and predictability by falling back to deterministic Playwright for the unchanging 80% of a workflow (natural for TypeScript teams). Skyvern optimizes for reliability on gnarly form-heavy portals via computer vision with native 2FA/CAPTCHA handling — but note its AGPL-3.0 copyleft if you embed it in a closed-source product, unlike MIT Browser Use and Stagehand.

A $0 browser-agent stack

Browser Use is the “hands.” Pair it with free pieces for a complete autonomous-web setup: the brain is a local model via Ollama or a free cloud key; for reading pages where you don’t need clicks, Crawl4AI or Firecrawl are far cheaper than driving a full agent; expose it over MCP for tool access; and wrap it in a CrewAI workflow when it’s one step in a larger pipeline. The money-saving mental model: don’t drive a browser to read a page — an LLM call per step is the most expensive way to fetch text. Reserve Browser Use for tasks that genuinely require acting on the page.

The real limits

  • Cost and latency scale with steps — every action is an inference; cap max_steps and pick the cheapest model that still succeeds.
  • Non-determinism — the same task can take a different path each run; for rock-stable flows, deterministic Playwright or Stagehand’s hybrid mode may be better.
  • Anti-bot and CAPTCHA — the free library drives a normal browser; aggressive bot detection can block it (that’s what the paid Cloud solves).
  • Security of autonomous action — an agent on a logged-in session can do real damage, and prompt-injection from page content is a genuine risk; use sensitive_data, scope credentials tightly, and keep a human in the loop for anything irreversible.
  • Pre-stable API — pin your version and read the changelog before upgrading.

FAQ

Is Browser Use free?

The open-source library is free under MIT, no quota or key required. Your only cost is the LLM — also $0 with a local Ollama model or a free API tier. Browser Use Cloud is a separate, paid, hosted product.

Do I need Playwright or CSS selectors?

No. The agent perceives pages semantically and decides its own actions from a natural-language task. You can drop to Playwright for fine control, but usually don’t have to.

How is it different from a scraper like Crawl4AI?

A scraper reads a page and returns text — fast and cheap, but can’t act. Browser Use clicks, types, logs in, and navigates multi-step flows. Use a scraper to read; use Browser Use when the task requires interaction.

Can I run it fully offline?

Almost — with a local Ollama model the reasoning is offline and free; the browser still needs internet to reach the target sites, and no data goes to a model provider.

Decision guide

  • Read a page’s text for RAG/searchCrawl4AI or Firecrawl, not an agent.
  • Click, type, log in, or complete a multi-step flow in Python → Browser Use.
  • Want it to cost $0 → drive it with local Ollama or a free Gemini/Groq key, and cap max_steps.
  • Work in TypeScript, want predictable/cheaper runs → Stagehand’s hybrid approach.
  • Heavy forms across many legacy portals → Skyvern (mind the AGPL license).
  • Need proxies and CAPTCHA solving without infra → the paid Browser Use Cloud.

Related Reads