dev-tools 3 min read

Lightpanda: a headless browser built for agents

Lightpanda is a Zig-built, CDP-compatible headless browser for AI agents and automation, published under AGPL-3.0 with 40,210 GitHub stars and 1,966 forks.

#github-trending #headless-browser #automation #zig#cdp
By
Share: X in
GitHub social preview card for lightpanda-io/browser

TL;DR: Lightpanda is a headless browser written in Zig for AI agents and automation. It speaks the Chrome DevTools Protocol, so existing CDP clients drive it, and it is published under AGPL-3.0. The project has 40,210 stars, 1,966 forks and a topic list of browser, browser-automation, cdp, headless and lightpanda, which is a fairly complete description of what it is for.

What it is

Lightpanda describes itself as “the headless browser designed for AI and automation”. The GitHub topics say the same thing more precisely: browser, browser-automation, cdp, headless, lightpanda.

The positioning is the interesting part. A general purpose headless Chrome is excellent at almost everything and expensive at running many instances at once. If your workload is an agent that fetches a page, parses a DOM and clicks a link, you are paying for a full rendering engine to get a tree of nodes. Lightpanda targets that workload instead.

That is why the language is Zig. The project was created in February 2023 and has been developed as a performance and footprint exercise from the start, not as an experiment in rewriting an existing browser.

The CDP angle is the whole integration story

CDP, the Chrome DevTools Protocol, is the contract that makes Lightpanda usable without rewriting anything. Tools that already speak CDP, such as Puppeteer and Playwright, connect to it the same way they connect to Chrome.

// Point an existing CDP client at a running Lightpanda instance
const browser = await puppeteer.connect({
  browserURL: 'http://127.0.0.1:9222',
});

If your automation code already drives Chrome headless, the swap is a connection string. That is the whole adoption path, and it is why the cdp topic tag is doing so much work in that list of five.

Licensing is the part to think about first

Lightpanda is published under AGPL-3.0. That matters more than the star count does, because AGPL is a network copyleft license.

The practical effect: if you modify Lightpanda and offer the modified version to users over a network, you have to publish your modifications. For a personal script or an internal tool, this rarely comes up. For a commercial service that embeds a modified browser and exposes it to paying customers, it is a legal question you should answer before you build on it, not after.

MIT would have been the permissive choice, and BSD-3-Clause is what other infrastructure projects in this space tend to use. AGPL was picked on purpose. Just know which one you are taking on.

How to try it

The container image is the quickest route:

docker run -d --rm -p 9222:9222 --shm-size=2g lightpanda/browser

Confirm the image tag on the project homepage before pulling, since the tag moves as releases land. Then point your CDP client at port 9222 and run the same script you would run against Chrome.

When to use it

Lightpanda fits when you are running many concurrent browser sessions, when you mostly need DOM and JavaScript rather than pixels, or when you are building agent infrastructure where per-instance memory cost is the budget line.

It does not fit when your workflow depends on rendering, screenshots or visual assertions. It also does not fit if your legal team will not approve AGPL for a hosted product.

Source and Accuracy Notes