★ Reading this for free? Get 20 structured AI courses + per-chapter AI tutor — the first chapter of every course free, no card.Start free in 30 seconds
Agents

Browser-Use + Ollama: Build a Local Web-Browsing Agent (No API Costs)

September 6, 2026
13 min read
LocalAimaster Research Team

Want to go deeper than this article?

Free account unlocks the first chapter of all 25 courses — RAG, agents, MCP, voice AI, MLOps, real GitHub repos.

📚AI Learning Path

Ollama’s running. Here’s what to build with it. Go from “ollama run” to RAG apps, agents, and fine-tuned models — structured and hands-on. First chapter free.

Start free
Or own it for life — Lifetime $149, pay once

Short answer: uv pip install browser-use, uvx browser-use install, then ChatOllama(model="qwen3-vl:8b") — that is a web-browsing agent with $0 in API costs. Browser-use is the biggest open-source browser agent there is (107.9K GitHub stars, MIT license, v0.13.7 as of late July 2026) and it supports Ollama first-party. The part most tutorials skip: model size decides everything. An 8B model (~6GB VRAM) completes simple lookups and fails multi-step tasks; the docs themselves warn small models return broken action schemas; things only get dependable around the 30B tier (~20GB). This guide gives you the working setup and an honest map of that line.

Every command, class name, and model size below was verified against the browser-use docs, PyPI, the GitHub repo, and the Ollama model library in August 2026. Where a reliability claim comes from browser-use's own benchmarks or issue tracker rather than our own machines, we say so inline.


What Browser-Use Is — and Why Run It Locally

Browser-use is a Python library (MIT, 107.9K stars) that hands a Chromium browser to an LLM: the model reads the page's element tree — plus screenshots if it can see — and emits structured actions like click, type, and scroll until the task is done. You write one sentence ("find the number 1 post on Show HN"); the agent does the clicking.

It is not a research toy. The project self-reports an 89.1% success rate on the WebVoyager benchmark, and its own benchmark of 100 deliberately hard browser tasks is worth internalizing before you form expectations of any model, cloud or local: Claude Fable 5 tops their leaderboard at 80%, and Browser Use Cloud reports 78% — which they describe as "16 points ahead of the best open-source model" (all figures are browser-use's published results, not ours). Even the best cloud stacks miss a fifth of hard web tasks, and open models trail them by double digits. Keep that bar in mind when a 6GB local model stumbles — the ceiling is lower than the demos suggest for everyone.

So why local? Three reasons that hold up:

  • Cost. The hosted product charges from $0.36/M input and $1.44/M output tokens plus $0.02/browser-hour (browser-use pricing, August 2026). Browser agents are token furnaces — every step re-sends a chunk of the page. Local tokens are free.
  • Privacy. A browser agent sees whatever your browser sees: logged-in sessions, internal dashboards, prices, PII. With Ollama, none of it leaves your machine — same argument that anchors our local AI agents guide.
  • No key, no meter, no cutoff. The README's own FAQ lists "run local models with Ollama" as the way to use the library without any provider API key.

The trade you make is reliability, and the rest of this page is about managing that trade honestly.


Reading articles is good. Building is better.

Free account = the first chapter of all 25 courses, with a per-chapter AI tutor. No card.

Hardware & Model Requirements

Minimum useful setup: 8GB of VRAM and an 8B model. Comfortable setup: 24GB and a 30B-class model. Browser-use itself is a thin Python layer — your hardware budget is entirely about the model behind it.

Sizes below are official Ollama library download sizes (August 2026). Rule of thumb: VRAM needed = download size + headroom for context, and browser-use needs more context headroom than a chatbot because each step carries the page's element tree.

Model (Ollama tag)DownloadVisionRealistic VRAM tierOur take
llama3.1:8b4.9GBNo8GBThe docs' official example. Text-only DOM mode; fine for first runs
qwen3-vl:4b3.3GBYes6-8GBSmallest vision option; expect schema errors on anything multi-step
qwen3-vl:8b6.1GBYes8-12GBBest starting point per VRAM dollar
qwen2.5:14b9.0GBNo12-16GBNoticeably steadier action output than 7-8B
qwen3-vl:30b20GBYes24GBWhere vision + reliability starts feeling real
qwen2.5:32b / qwen3-vl:32b20GB / 21GBNo / Yes24GB (tight)The serious local tier

Two practical notes. First, if you are on 8GB, our 8GB VRAM model picks cover which quants leave room for the context window this workload needs. Second, if you are speccing a machine for agents in general — not just this library — the local agent hardware guide covers the build math, and the 24GB VRAM picks show what that tier unlocks beyond browsing.

CPU-only works in the sense that it runs; a 30-step browser task at CPU token speeds is an afternoon. We don't recommend it beyond a smoke test.


Setup: Install to First Run

Four commands install everything; the fifth runs your first agent. Python 3.11+ required (the docs' venv uses 3.12); current release v0.13.7, July 27, 2026 (PyPI).

Quoted from the official quickstart, August 2026:

pip install uv
uv venv --python 3.12
source .venv/bin/activate
uv pip install browser-use
uvx browser-use install   # downloads the Chromium build the agent drives

Then make sure Ollama is serving and pull a model. That side is three steps — install Ollama, ollama serve, pull a model (llama3.1:8b is the usual starting point, a 4.9GB download):

ollama serve          # if it isn't already running
ollama pull llama3.1:8b
ollama pull qwen3-vl:8b   # our suggested step up: adds vision, 6.1GB

And the minimal agent, adapted from the docs' example with the official Ollama import:

from browser_use import Agent, ChatOllama
import asyncio

async def main():
    llm = ChatOllama(model="qwen3-vl:8b")
    agent = Agent(
        task="Go to news.ycombinator.com and return the title of the top post",
        llm=llm,
    )
    await agent.run()

asyncio.run(main())

No .env file, no API key. The quickstart's BROWSER_USE_API_KEY / OPENAI_API_KEY variables belong to the cloud-model path — the Ollama path needs none of them. A Chromium window opens, the model starts reasoning in your terminal, and the meter never runs.

If Ollama lives on another box (a common homelab pattern), ChatOllama takes a host parameter — ChatOllama(model="qwen3-vl:8b", host="http://192.168.1.50:11434") — along with timeout and ollama_options, all confirmed in the class source.


Wiring Ollama Properly

Three settings separate a frustrating local agent from a workable one: a big context window, a generous timeout, and vision set to match your model.

1. Raise the context window. Browser-use's per-step messages include the page's element tree, and busy pages produce long prompts. Ollama's default context window is conservative, and a silently truncated prompt is the classic source of malformed actions and loops. Pass it through ollama_options:

llm = ChatOllama(
    model="qwen3-vl:8b",
    ollama_options={"num_ctx": 32768},  # VRAM permitting; try 16384 on 8GB
    timeout=120,
)

More context costs VRAM — this is why the "requirements" table adds headroom beyond the download size.

2. Set the timeout for local speeds. A 30B model on consumer hardware can take a while per step; the default HTTP timeout tuned for cloud APIs will cut it off mid-thought. timeout=120 is a sane floor for the bigger tiers.

3. Match vision to the model. The Agent's use_vision parameter defaults to "auto" (screenshots available, used when asked for); False removes the screenshot tool entirely (docs, August 2026). Run text-only models like llama3.1:8b or qwen2.5 with use_vision=False so the agent never tries to show images to a model that cannot see, and leave "auto" for qwen3-vl. Browser-use's DOM-first design is precisely why text-only local models are viable here at all — vision helps on canvas-heavy and badly-labeled UIs, but the element tree does most of the work.

One more dial worth knowing: max_actions_per_step (default 4) lets the model batch actions like filling several form fields at once. Small local models get less reliable when batching; dropping it to 1-2 trades speed for fewer schema errors.

For the underlying skill this all rests on — models emitting well-formed structured calls — our tool calling guide for Ollama and best agent models roundup are the deeper references.


Save yourself the weekend

Skip the plumbing and get to the part that works

Agents with tool calling already wired up, ready to point at your own tasks — instead of rebuilding the same scaffolding.

Get it — $19$19 once · instant accessStart free →

What Local Models Can Actually Do

The honest answer: small local models fail a lot, and the project's own issue tracker says so. Smaller models return malformed action schemas — and in our reading of the tracker that is the defining failure mode of the whole local path, across model families.

Here is the documented evidence, so you can calibrate before burning an evening:

  • The 8B tier is an entry point, not an endorsement. It is the size most walkthroughs start with because it fits everywhere, not because it finishes hard tasks.
  • The issue tracker, checked August 2026: an open bug (#5017, filed June 2026) reports "Invalid JSON error in browser-use while using ollama vision models" from a user who tried models up to 27B parameters; an open PR (#5023) to strip invalid options and improve JSON error handling for the Ollama provider was still unmerged as we wrote. Translation: even mid-size local models still trip on the action schema, and contributors are actively sanding this path.
  • Browser-use's own hard-task benchmark (their numbers): the best score on their 100-task set is 80%, and their cloud product claims to sit 16 points ahead of the best open-source model. If the strongest cloud stacks still miss a fifth of hard tasks and open models trail them by double digits, a 6GB local model failing most hard tasks is not a broken setup — it is the expected result.

What that means task-by-task — a calibration guide, not a benchmark we ran:

Task shape8B tier30B tier
Open a site, read one thing, report backUsually worksWorks
Fill a simple, well-labeled formOften worksUsually works
Multi-step: search, compare, pick, extractMostly failsHit and miss — retry-worthy
Anything with logins, popups, ambiguityFailsFails more often than not

Three habits move the needle more than model shopping: write tasks like instructions to a temp on their first day ("go to X, click Y, copy Z" beats "research the best Y"); keep tasks short and chain several small agent runs instead of one epic; and watch the terminal reasoning — when a model starts looping on a selector, no amount of patience fixes it, but a more specific task usually does.

And if what you really want is automation of applications rather than websites, the vision-first approach in our UI-TARS desktop automation guide attacks the same problem from the screenshot side, while the Hermes agent stack is the stronger local pick for tool-calling agents that don't need a browser at all.


Honest Limitations

Use browser-use + Ollama for private, low-stakes, well-specified browsing tasks. Do not build anything mission-critical on the local path yet. Where it genuinely creaks:

  • Reliability is the product of model size, and local tops out low. The schemas-from-small-models problem is documented in the tracker (issues #5017/#5023), and no prompt engineering fully closes the gap to the tuned cloud models the project's headline numbers come from.
  • It is slow. Every step is a full LLM inference over a long prompt. A task a human does in 40 seconds can take a local 30B model several minutes. Fine for unattended jobs; maddening interactively.
  • The repo moves fast. v0.13.7 shipped in late July 2026 and imports have changed across versions (ChatOllama now comes straight from browser_use). If a snippet from an older tutorial fails, trust the current docs — including over this page, eventually.
  • Token appetite makes context management your job. Long tasks accumulate history; small VRAM budgets force small num_ctx; truncation causes exactly the failures the tracker is full of. This is the hidden coupling most tutorials never mention.
  • An agent driving a real browser is a real security surface. It clicks what a model tells it to click, and prompt-injection via page content is an unsolved problem across every browser-agent framework, not just this one. Keep it away from sessions that can spend money or delete things, local model or not.

None of this argues against the setup — it argues for entering with calibrated expectations. A local browser agent that reliably handles the boring 60% of lookups and form-fills, for free, in private, is worth having. Just don't promise it the other 40%.


Sources

  • Browser-use docs — quickstart install commands and the Agent parameter defaults (use_vision, max_actions_per_step), checked August 2026
  • Browser-use GitHub repository — 108K stars, MIT license, the ChatOllama class and its host/timeout/ollama_options parameters, README FAQ on Ollama, and issues #5017 / #5023 (checked August 2026)
  • PyPI: browser-use — v0.13.7, tagged July 27, 2026; Python >=3.11 requirement
  • Browser-use published benchmarks and pricing — the WebVoyager 89.1% claim, the 100-hard-task leaderboard, and the $0.36/$1.44 per-million and $0.02/browser-hour rates (all self-reported by browser-use, checked August 2026)
  • Ollama model library — qwen3-vl, qwen2.5, and llama3.1 tags and download sizes, August 2026

FAQ

🎯
AI Learning Path

Ollama’s running. Here’s what to build with it.

Go from “ollama run” to RAG apps, agents, and fine-tuned models — structured and hands-on. First chapter free.

Or own it for life — Lifetime $149 $599, pay once
Once your hardware is sorted

Stop piecing Ollama together from blog posts

Ollama Mastery is 15 chapters end to end — install, model choice, Modelfiles, GPU offload, the API, and the 20 errors that actually happen. Plus 24 more courses.

$149 once unlocks everything, forever — about $0.27/chapter for life. Prefer to spread it out? Pro is $79/year (saves 27%) or $8.99/month.
Secure checkout by Lemon Squeezy — your card never touches this siteInstant access the moment you payFirst chapter of every course is free — try before you buy

Liked this? 25 full AI courses are waiting.

From fundamentals to RAG, agents, MCP servers, voice AI, and production deployment with real GitHub repos. First chapter free, every course.

Reading now
Join the discussion

LocalAimaster Research Team

Creator of Local AI Master. I've built datasets with over 77,000 examples and trained AI models from scratch. Now I help people achieve AI independence through local AI mastery.

Build Real AI on Your Machine

RAG, agents, NLP, vision, and MLOps - chapters across 25 courses that take you from reading about AI to building AI.

Want structured AI education?

25 courses, 519+ chapters, from $9. Understand AI, don't just use it.

AI Learning Path
More on Ollama
See the full Best Ollama Models 2026 guide.

Comments (0)

No comments yet. Be the first to share your thoughts!

Does browser-use work with Ollama without any API keys?

Yes. The open-source library is MIT-licensed and ships a first-party ChatOllama class — `from browser_use import Agent, ChatOllama` is the official import (ChatOllama is exported from the package root, verified in the repo, August 2026). Point it at a running `ollama serve` and no BROWSER_USE_API_KEY, OPENAI_API_KEY, or any other cloud credential is required. The .env keys in the quickstart exist for the cloud-model path; the Ollama path skips them entirely. Your only costs are electricity and VRAM.

Which Ollama model is best for browser-use?

llama3.1:8b (a 4.9GB pull) is the usual starting point, and a fair floor for simple, single-site tasks. For anything you want to succeed more often than it fails, go bigger: qwen3-vl:8b (6.1GB) adds vision on the same VRAM budget, and the 30B-class tier — qwen3-vl:30b at 20GB or qwen2.5:32b at 20GB — is where multi-step tasks start completing with any consistency. The reason is schema reliability: small local models are the least dependable at emitting browser-use's strict action format, a failure mode documented on the repo's own issue tracker (#5017) and one that generalizes across model families.

How much VRAM do I need to run a browser-use agent locally?

Budget the model download size plus headroom for a large context window, because browser-use sends the page's element tree with every step. In practice: 8GB of VRAM runs the 8B tier (llama3.1:8b at 4.9GB, qwen3-vl:8b at 6.1GB) with a reduced context; 16GB runs 8B models with the full context they really need; 24GB fits the 20-21GB 30B-class models that make the agent genuinely useful. All sizes are from the Ollama model library, August 2026.

Why does my local browser-use agent loop or throw Invalid JSON errors?

Because browser-use requires the model to emit a strict structured-output action schema each step, and small local models are the least reliable at exactly that. This is a known, documented failure mode: browser-use issue #5017 (opened June 2026, still open when we checked in August) reports invalid-JSON errors with Ollama vision models "up to 27B parameters," and an open PR (#5023) that strips invalid options and improves Ollama JSON error handling was still unmerged as we wrote this. Mitigations, in order of effect: use a bigger model, raise the Ollama context window via ollama_options (truncated prompts produce malformed actions), and keep tasks short and concrete.

Is browser-use free? What does the hosted version cost?

The Python library is free and MIT-licensed — that is what this guide uses, and paired with Ollama the whole stack runs at $0 in API fees. The company also sells a hosted product: managed agents from $0.36 per million input tokens and $1.44 per million output tokens, plus $0.02 per browser-hour for managed Chromium (browser-use pricing page, August 2026). That pricing is the clearest argument for the local path: a chatty agent burns tokens on every page it reads, and locally those tokens are free.

Ready to Go Beyond Tutorials?

20 structured courses with hands-on chapters - build RAG chatbots, AI agents, and ML pipelines on your own hardware.

Bonus kit

Ollama Docker Templates

10 one-command Docker stacks for local models — get the Ollama backend behind your browser agent serving in minutes. Included with paid plans, or free after subscribing to both Local AI Master and Little AI Master on YouTube.

See Plans →

Was this helpful?

📅 Published: September 6, 2026🔄 Last Updated: September 6, 2026✓ Manually Reviewed
LM

Written by the Local AI Master Team

The team behind Local AI Master

We build Local AI Master around practical, testable local AI workflows: model selection, hardware planning, RAG systems, agents, and MLOps. The goal is to turn scattered tutorials into a structured learning path you can follow on your own hardware.

✓ Local AI Curriculum✓ Hands-On Projects✓ Open Source Contributor
📚
Free · no account required

Grab the AI Starter Kit — career roadmap, cheat sheet, setup guide

No spam. Unsubscribe with one click.

🎯
AI Learning Path

Ollama’s running. Here’s what to build with it.

Go from “ollama run” to RAG apps, agents, and fine-tuned models — structured and hands-on. First chapter free.

Or own it for life — Lifetime $149 $599, pay once
Free Tools & Calculators