We raised $15M to build the world's fastest neocloud.Read
browser agentsinference speedagentic AIweb automationlatency

Browser Agents: Inference Speed as the Gating Factor

General Compute·

Browser agents are one of the more concrete demonstrations of agentic AI: a model that can navigate a webpage, fill out a form, extract information from a table, and complete a multi-step task without human intervention. They're also one of the clearest examples of how inference speed becomes a hard constraint rather than a nice-to-have.

If you've built or experimented with a browser agent, you've probably hit the wall. The agent works -- it can browse, click, read, and act -- but it's painfully slow. A task that takes a human 30 seconds takes the agent several minutes. Users stop waiting. Demos fall flat in real time. The bottleneck is almost never the browser automation library. It's the inference calls.

What a Browser Agent Actually Does

To understand why latency compounds so badly, it helps to trace what happens during a single web task. Say the agent's job is to log into a site, find an invoice from last month, and extract the total amount.

The agent loop looks something like this:

  1. Take a screenshot (or parse the DOM)
  2. Call the LLM: "Here is the current state of the page. What should I do next?"
  3. Receive an action (click this element, type this text, scroll down)
  4. Execute the action in the browser
  5. Take another screenshot
  6. Repeat until the task is complete or the agent gives up

Each iteration requires at least one LLM call. A straightforward task might take 8-15 iterations. A more complex one -- navigating an unfamiliar UI, handling an error state, waiting for a redirect -- might take 20-30 or more.

Now do the math. If each LLM call takes 2 seconds (a fairly typical latency for a capable model at moderate load), a 15-step task takes 30 seconds just in inference time, not counting browser overhead, DOM parsing, or network latency. If the calls take 4-5 seconds each, that's over a minute. For interactive use cases, that's a dead-end.

The Screenshot-to-Action Loop Is Latency-Sensitive

Most browser agents today use one of two approaches to perceive the page: pixel-based (a screenshot sent to a vision model) or text-based (the DOM or an accessibility tree extracted and sent as text). Either way, the model has to process a large context -- either an image or a serialized tree of elements -- and return a structured action.

Vision-language models add another layer of cost. Processing an image alongside a long system prompt means longer time to first token and more total compute per call. If your agent uses a multimodal model for visual grounding, each step is slower than a text-only call at the same capability level.

The text-DOM approach avoids image encoding, but the accessibility tree for a complex page can be thousands of tokens. You're still dealing with large inputs and large outputs (structured JSON actions with selectors and values), which means inference latency stays high.

Neither approach magically becomes fast at 2+ seconds per call. You need the underlying model to be genuinely fast.

Why You Can't Just Cache Your Way Out

Prefix caching helps in some agentic contexts. If your system prompt is long and stable, caching the KV state for that prefix can shave meaningful time off each call. Most inference providers offer some form of this.

But browser agents have a structural problem: the page state changes every step. The screenshot or DOM snapshot that becomes part of the prompt is different on every turn. That's new context each time, so you don't get the same cache hit rates you'd see in, say, a chatbot with a fixed system prompt and short user turns.

The part of the prompt that's unique to each step -- the current page state -- is usually the largest part. A cache hit on your system prompt saves maybe 20-30% of the tokens. The other 70-80% are re-processed fresh each turn.

So caching is useful but not sufficient. You need the base inference to be fast.

Error Recovery Multiplies the Call Count

A well-designed browser agent doesn't just march forward. When it encounters an unexpected state -- a CAPTCHA, a login that failed, a page that didn't load correctly -- it needs to recognize the problem and decide what to do. That's another LLM call (or several).

Error recovery is often where browser agents fall apart in practice. In a demo, you control the environment. In production, the real web is messy: popups, rate limiting, session expiration, layout changes after A/B tests, modal dialogs that weren't there yesterday.

Each unexpected state can easily add 3-5 extra steps to the task. At high base latency, those extra steps push the total time from "slow but acceptable" to "completely impractical."

The cruel irony is that the harder tasks -- the ones where an agent would actually save a human meaningful time -- are precisely the ones with more error states, more edge cases, and more LLM calls.

Parallelism Helps, But Has Limits

One strategy for reducing total wall-clock time is to parallelize agent sub-tasks where possible. If the agent needs to visit three pages and extract data from each, you can spawn three concurrent sub-agents instead of visiting pages in sequence.

This works well for loosely-coupled tasks and can give significant speedups. But many browser tasks are inherently sequential: you have to log in before you can navigate to the account page. You have to fill out step 1 of a form before step 2 appears. The dependency graph often forces serialization.

Even with parallelism, the latency of each individual call matters. Parallelism reduces wall-clock time for independent subtasks, but it doesn't help at all for the sequential core of the task. If 15 of your 20 steps must happen in order, cutting inference latency in half cuts your total task time by 37%. That's meaningful, but you can only get there if base inference is fast.

Practical Implications for Agent Architecture

Given that inference speed is often the gating constraint, here's how it shapes design decisions in practice.

Model selection matters more than you might think. A model that's 20% less accurate but 60% faster can actually produce better task completion rates in practice, because faster recovery from mistakes is cheaper than the cost of slowness on every step. The tradeoff isn't obvious from benchmarks that measure accuracy in isolation.

Streaming helps perceived speed. If your agent displays its reasoning or intermediate steps, streaming the output lets users see progress while the next action is still being generated. This doesn't reduce total latency, but it makes the agent feel more interactive and builds trust that it's working.

Observation design is a lever. Sending the full accessibility tree on every step is expensive. Some frameworks use a two-phase approach: a fast "what changed?" observation (a diff from the previous step) followed by a full observation only when the page changes substantially. This reduces input token counts and can meaningfully cut per-step latency.

Rate limiting and retries have a cost. If your inference provider rate-limits your agent mid-task, you're waiting. If you're retrying on errors, you're adding calls. Pick an inference provider with high rate limits and reliable low latency at production scale, not just at demo scale.

# Example: a minimal browser agent step with timing instrumentation import time from playwright.sync_api import sync_playwright def agent_step(page, llm_client, task_description, dom_snapshot): step_start = time.time() # Build prompt from current DOM state prompt = build_prompt(task_description, dom_snapshot) # Time the inference call inference_start = time.time() response = llm_client.complete(prompt) inference_ms = (time.time() - inference_start) * 1000 # Parse and execute action action = parse_action(response) execute_action(page, action) total_ms = (time.time() - step_start) * 1000 print(f"step: {total_ms:.0f}ms total, {inference_ms:.0f}ms inference ({inference_ms/total_ms*100:.0f}% of step)") return action

When you add this kind of instrumentation, inference time almost always dominates. Browser actions (clicking, typing, navigating) are fast. DOM extraction and screenshot capture are fast. The LLM call is where the time goes.

What Fast Inference Actually Unlocks

At sub-300ms per inference call, browser agents start to feel qualitatively different. Task completion times drop into ranges where interactive use cases become viable. A user can kick off a task, watch it proceed, and course-correct if it goes wrong -- without the interaction feeling like waiting for a batch job.

At 500ms-1000ms per call, you're in the zone where background tasks work but interactive ones don't. Users won't watch the agent work; they'll walk away and check back later. This is acceptable for some use cases and a dealbreaker for others.

At 2+ seconds per call, most interactive use cases fail. Background automation is possible but slow. The agent is competing against a user who would just do the task themselves.

The threshold depends on what users are trying to accomplish. A browser agent running overnight to scrape data from 500 pages can tolerate higher per-call latency. A browser agent helping a user fill out an application while they're watching is competing with the user's patience directly.

The Infrastructure Question

Running a fast browser agent in production isn't just a model selection question. You need inference infrastructure that can sustain low latency under concurrent load. A model that returns 200ms per call when one agent is running might return 1500ms when 50 are running simultaneously, if the underlying infrastructure isn't built for it.

This is where managed inference APIs differ from self-hosted models. Self-hosting gives you control and potentially low latency on a warm, lightly-loaded system -- but capacity planning for variable agent workloads is genuinely difficult, and cold-start latency can be brutal if you're spinning up inference capacity on demand.

Managed APIs with consistent, guaranteed latency SLAs make it easier to reason about agent performance in production. You can design around a known p95 latency budget instead of a best-case number that degrades unpredictably at scale.

Building Toward Practical Browser Automation

Browser agents are increasingly real. The tooling has matured (Playwright, Puppeteer, browser-use, Stagehand), the vision models have improved, and the prompting strategies are better understood. The remaining friction is mostly infrastructure: can you run enough inference, fast enough, cheaply enough, to make the economics work?

The agents that will succeed in production are the ones built with latency as a first-class constraint from the start -- tight observation design, smart caching, good model selection, and inference infrastructure that doesn't become the bottleneck at scale.

If you're building browser agents and running into latency walls, General Compute's API is worth benchmarking. Consistent sub-200ms TTFT at scale is what makes the step-by-step loop actually work.

ModeHumanAgent