← all repositories
lexmount/moli

A headless browser that renders pixels only under duress

Moli is a standalone Rust headless browser that avoids continuous rendering by computing layout and paint only when an operation explicitly demands geometry or pixels.

932 stars Rust AgentsCoding Assistants
moli
Collecting fresh signals — velocity needs a few days of history.
collecting data…
star history

What it does

Moli is a standalone headless browser kernel written in Rust for AI agents and automation pipelines. It fetches pages, executes JavaScript, and speaks standard protocols like CDP and WebDriver, but it does not wrap Chromium. The native DOM and computed styles serve as the single source of truth, keeping the runtime lightweight until visual output is strictly necessary.

The interesting bit

Its on-demand rendering model treats layout and paint as expensive, optional operations. For structure-only tasks—extracting HTML, Markdown, or semantic trees—Moli skips geometry and rendering entirely. It only builds a temporary working layout tree, calculates boxes, or produces a software frame when a screenshot, PDF, or coordinate input is requested, then discards that transient state.

Key highlights

  • Built from discrete Rust components rather than wrapping an existing browser binary: rusty_v8 for JavaScript, Servo/Stylo for CSS, Taffy and Parley for layout, and Vello CPU for software rendering.
  • Exposes CDP, WebDriver Classic, and WebDriver BiDi from a single binary, so clients like Playwright connect directly without a separate ChromeDriver.
  • README benchmarks report a median RSS of 73 MiB versus 773 MiB for Chrome Headless across a 192-site crawl, with comparable success rates and median load times.
  • On an agent workload, it reportedly reaches CDP ready in roughly 35 ms and peaks under 103 MiB, against Chromium’s 169 ms and 349 MiB.
  • Unsupported protocol paths return explicit errors instead of silent failures.

Caveats

  • The project deliberately omits a GPU compositor, persistent window, and retained multi-frame paint architecture, so it is not a universal drop-in replacement for every Chrome Headless workflow.
  • High-fidelity Canvas, WebGL, and media playback are explicitly out of scope, and some Chrome screenshot or print modes remain unimplemented.

Verdict

Best suited for developers running crawls, retrieval pipelines, or browser-use agents where DOM structure and low memory matter more than visual fidelity. If your workload requires GPU-accelerated rendering, complex WebGL, or perfect Chrome parity, stick with Chromium.

Frequently asked

What is lexmount/moli?
Moli is a standalone Rust headless browser that avoids continuous rendering by computing layout and paint only when an operation explicitly demands geometry or pixels.
Is moli open source?
Yes — lexmount/moli is open source, released under the Apache-2.0 license.
What language is moli written in?
lexmount/moli is primarily written in Rust.
How popular is moli?
lexmount/moli has 932 stars on GitHub.
Where can I find moli?
lexmount/moli is on GitHub at https://github.com/lexmount/moli.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.