aixsam.dev / tools / browser-use
browser-use
Give an AI a real browser and one line of instructions: it opens websites, reads them, clicks, types and fills forms by itself. Free, open source, MIT.
What is browser-use?
browser-use is a free, open-source (MIT) library that gives an AI model a real web browser. You describe a task in one line, like "find the cheapest flight to Goa next Friday", and the agent opens sites, reads them, clicks, types and fills in forms by itself.
You can run it entirely on your own computer from Python, with any AI model, including a free local one through Ollama. The same team also sells an optional cloud service with hosted browsers; you don't need it for anything in this guide.
There are three ways in: a Python library (this guide), a command-line tool that plugs into agents like Claude Code, or their hosted cloud.
What browser-use can do
- Do web tasks for you search, compare, fill forms, collect information across several sites.
- Any model OpenAI, Claude, Gemini, or a free local model with Ollama.
- Your code, your browser it's a normal Python library (Python 3.11+), so you can build it into your own scripts.
- Works with coding agents the CLI path registers a skill so Claude Code or Codex can drive a browser.

What you need
- Python 3.11 or newer and uv (or plain pip).
- An AI model: a free local one with Ollama (needs a decent computer), or a paid API key such as OpenAI.
- About 10 minutes. You'll copy one small Python file.
Setup, step by stepcopy each command with the button on the right
Make a project and add browser-use
In a new, empty folder:
uv init --python 3.12 uv add browser-useNo uv?
pip install browser-useworks too.
Free: a local model with Ollama
Install Ollama, start it, and download a model (about 4.9 GB):
ollama serveThen in a second terminal:
ollama pull llama3.1:8bIt runs on your own computer, so speed depends on your hardware.
Or: a paid API key
Make a file called
.envin the folder:OPENAI_API_KEY=your-keyYou pay OpenAI for what you use. Claude and Gemini work too.
Save this as agent.py
This version uses the free Ollama model from step 2:
import asyncio from browser_use import Agent, ChatOllama async def main(): llm = ChatOllama(model="llama3.1:8b") agent = Agent(task="Find the number of stars of the browser-use repo", llm=llm) history = await agent.run() print(history.final_result()) asyncio.run(main())Using an OpenAI key instead? Swap the import and model line for the ones in the README quickstart.
Run it
uv run agent.pyA browser opens, the agent looks up the repo and prints the answer.
Give it your own task
Change the
task="..."line to anything you'd tell a person, for example the README's own: Fill in this job application with my resume and information.
Heads up: it clicks real buttons on real websites. Watch it the first few times, keep it away from banking, payments and passwords, and check every form before it's submitted. The library is free; Browser Use Cloud and paid model providers charge per use, and you don't need either.
Stuck?
The local model does strange things
Small local models sometimes return actions in the wrong format. Try a bigger model in Ollama, or give the task in very clear, simple steps.
Install fails
browser-use needs Python 3.11 or newer. Check with python --version; with uv, uv init --python 3.12 sets the right one for you.
Is it really free?
The library is free and MIT. A local Ollama model is free too. GPT, Claude, Gemini and Browser Use's own models and cloud browsers are paid per use.
Questions people ask
Is browser-use free?
The library is free and MIT licensed. You pay only for the AI model if you use a paid one; Ollama models are free. The cloud browsers are a separate, optional paid service.
Is it safe to let an AI control my browser?
Treat it like giving someone your mouse. Use a separate browser profile, don't let it log in to your bank or email, and watch what it does the first few times.
Can it solve CAPTCHAs?
The paid cloud browsers advertise CAPTCHA handling. Running locally, expect it to stop at CAPTCHAs, and respect each site's rules.
Which model works best?
Bigger models follow multi-step tasks better. Small local models are free and private but slower and make more mistakes on long tasks.
Still stuck?
DM me on Instagram with a screenshot of the error and which step you're on.
DM @aixsamdev