Moli: Rust Headless Browser Built for AI Agents
GitHub Repo
MIT OR Apache-2.0
October 18, 2026 at 03:20 PM
0 views

Moli: Rust Headless Browser Built for AI Agents

@lexmountProject Author

What Moli is

Moli is a headless browser written in Rust and designed for AI agent workloads. Its README describes it as production-ready within its documented agent-browser scope, and its pitch is a complete browser runtime with a much smaller resource footprint than running headless Chrome. Agents use it to fetch and extract web pages, search the web and automate browser tasks, through a CLI or through the standard automation protocols: CDP, WebDriver Classic and WebDriver BiDi. It runs on Linux, macOS and Windows.

The idea behind it is that most automation requests never need pixels. Extracting text, querying the DOM, running JavaScript or inspecting network traffic only needs page structure, yet a conventional browser keeps a fully rendered visual state up to date the whole time. Moli treats the native DOM and style state as the single source of truth and triggers layout or software paint only for operations that need them, such as reading an element's box, sending coordinate input or taking a screenshot.

Moli is the open-source core of Lexmount's offering; Lexmount Browser is a managed cloud runtime and control plane built around it. The README is explicit that the open-source browser is fully usable without the hosted product.

How it works

Moli is a standalone browser kernel, not a Chromium wrapper. It is built from Rust and existing open-source components:

  • libcurl for network transport and the multi-request runtime.
  • html5ever for HTML parsing.
  • rusty_v8 / V8 for JavaScript execution.
  • Servo/Stylo for selectors, cascade and computed style.
  • Taffy and Parley for box and text layout.
  • AnyRender/Vello CPU and usvg for software rendering.

The cost model is the interesting part. By default Moli uses a mock layout policy that returns deterministic geometry in a compatible format with no real layout or paint. With --layout, the first geometry request builds a working layout tree from the current DOM and style, freezes the geometry into an immutable FrozenLayoutTree, and discards everything else. Ordinary geometry reads may reuse that frozen tree; screenshots always rebuild it and render a fresh frame, and paint results are never reused. Screencast polling compares an opaque generation token, so an unchanged page emits no frame. There is no incrementally maintained layout tree, retained display list, GPU compositor or persistent window.

Key features

  • Complete web runtime: streaming HTML parsing, a native DOM, V8 with modules, timers and events, iframes and workers, the CSS cascade, Fetch, XHR, WebSocket, cookies, WebCrypto and profile-scoped localStorage, IndexedDB and OPFS.
  • Extraction-friendly output: the CLI produces HTML, Markdown, JSON, compact semantic text trees and frame-aware serialisation directly.
  • One automation binary: CDP, WebDriver Classic and WebDriver BiDi share one kernel and endpoint, with no separate ChromeDriver, geckodriver or browser install.
  • Visual output on demand: --layout enables real geometry, hit-testing, coordinate input, viewport and full-page screenshots, PDF output and low-frequency DevTools screencast frames.
  • Explicit cost controls: images, fonts, audio, video and other optional resource families are only fetched when enabled with flags like --resource or --image.
  • Operational options: profiles, cookie files, HTTP cache, proxies, connection limits, timeouts, private-network policy, user-agent overrides and network tracing.
  • Honest failures: unsupported protocol paths return explicit errors instead of pretending an action or visual result occurred.

Getting started

On Linux or macOS, install the latest prebuilt binary with the project's installer script:

curl --proto '=https' --tlsv1.2 -fsSL \
  https://github.com/lexmount/moli/releases/latest/download/moli-installer.sh | sh

On Windows, in PowerShell:

powershell -ExecutionPolicy ByPass -c "irm https://github.com/lexmount/moli/releases/latest/download/moli-installer.ps1 | iex"

Render a page as Markdown with the default completion strategy:

moli fetch \
  --dump markdown \
  --wait-until done \
  https://example.com

Or enable layout and write a screenshot or a PDF:

moli fetch --layout --dump screenshot https://example.com > page.png
moli fetch --layout --dump pdf https://example.com > page.pdf

For automation, start the server. The same endpoint serves all three protocols, and Playwright can connect over CDP at http://127.0.0.1:9222:

# Basic automation server for DOM-first workloads
moli serve

# Enable real geometry, coordinate input, and screenshot/screencast surfaces
moli serve --layout

The README also offers an agent-first install: hand your agent the skills under the repository's skills/ folder and let it download the binary and run moli-webfetch.

Use cases

  • Agent web fetching: give an LLM agent a tool that returns Markdown or a semantic tree instead of raw HTML, without spinning up a full Chrome process per request.
  • Crawling and retrieval pipelines: extract JavaScript-rendered content at scale where memory per page matters.
  • Existing Playwright or Selenium scripts: point CDP or WebDriver clients at moli serve for DOM-centric automation.
  • Evaluation and reinforcement-learning environments: the README singles these out, since many short browser episodes benefit from low startup time and footprint.

How it compares

The README benchmarks Moli against Chrome Headless, Lightpanda, Obscura and Kitesurf, and the numbers should be read as the project's own claims. On a crawl of 192 public URLs it reports 103 useful pages for Moli (53.6%) against 101 for Chrome Headless, with a median RSS of 73 MiB versus 773 MiB; Lightpanda and Obscura used less memory but extracted fewer useful pages. On the project's Lexbench-Headless-Browser corpus, Moli 0.1.1 is reported at 81.88% task success against 99.85% for Chrome, the reference engine, and 53.29% for Lightpanda.

The takeaway the project itself draws is a trade-off rather than a replacement: Chrome remains the compatibility reference, while Moli aims for most of that coverage at a fraction of the memory. Workloads that need high-fidelity Canvas, WebGL, media playback or pixel-perfect rendering are still better served by a real Chromium.

Things to know before adopting

  • Licence: dual MIT or Apache-2.0 at your option, unless a file states otherwise; separately licensed third-party components keep their own licences, recorded under licenses/.
  • Intentional limits: no GUI, persistent window or GPU compositor, no goal of pixel parity with Chrome, and not every Chrome screenshot or print mode is implemented.
  • Default geometry is mock: without --layout, element boxes are deterministic placeholders, so scripts that depend on real coordinates must opt in.
  • Young project: the repository was created in August 2026 and the benchmark refers to version 0.1.1, so expect fast-moving behaviour.
  • Installer scripts: the quick install pipes a script from GitHub releases into a shell; review it first if your environment requires that.

Project activity

As of October 2026 the repository has about 18,900 stars. It was created in August 2026, is written in Rust and is dual-licensed under MIT and Apache-2.0, with commits landing in October 2026. The README is available in English, Chinese, Japanese, German, French, Spanish and Korean, and the project reports one full run passing about 1.612 million Web Platform Tests in its selected scope. The source and releases are at github.com/lexmount/moli, and the hosted product is at browser.lexmount.com.

Enjoying this project?

Discover more amazing open-source projects on TechLogHub. We curate the best developer tools and projects.

Project
moli-headless-browser
Created
October 18
Last Updated
October 18, 2026 at 03:20 PM

Maintain Moli: Rust Headless Browser Built for AI Agents? Add the badge to your README

Show that the project is featured on TechLogHub and send readers to this write-up.

Featured on TechLogHub
[![Featured on TechLogHub](https://techloghub.com/badge-neutral.svg)](https://techloghub.com/open-source/moli-headless-browser?utm_source=techloghub_badge&utm_medium=referral&utm_campaign=readme)

Find more projects like this

One email a week: new and trending developer tools, fresh comparisons, and what shipped. Unsubscribe in one click.