Lightpanda: The Headless Browser Built From Scratch for AI Agents
TL;DR: Lightpanda is an open-source headless browser written in Zig (not a Chromium fork) that runs 11x faster than Chrome and uses 9x less memory. It supports CDP protocol, so your existing Puppeteer/Playwright scripts work. Install via
curlor Docker, start the CDP server on port 9222, and connect your automation tools.
Every AI agent that needs to browse the web faces the same problem: headless Chrome is slow, memory-hungry, and built for humans, not machines. Lightpanda takes a different approach — it’s a browser built from scratch specifically for headless usage.
What is Lightpanda?
This is important: Lightpanda is not a Chromium wrapper, fork, or modification. It’s a new browser written in Zig with:
- html5ever for HTML parsing (from Servo)
- V8 for JavaScript execution
- libcurl for HTTP
- Custom DOM implementation
- CDP (Chrome DevTools Protocol) compatibility
The result? Massive performance gains.
How Fast is Lightpanda Compared to Chrome?
Benchmarked on AWS EC2 m5.large with Puppeteer requesting 100 pages:
| Metric | Chrome | Lightpanda | Improvement |
|---|---|---|---|
| Speed | Baseline | 11x faster | 🚀 |
| Memory | Baseline | 9x less | 💾 |
| Startup | Slow | Instant | ⚡ |
For AI agents that need to scrape thousands of pages or automate workflows at scale, this isn’t incremental — it’s transformative.
Does Lightpanda Work with Puppeteer and Playwright?
Despite being a new browser, Lightpanda speaks CDP (Chrome DevTools Protocol). Your existing Puppeteer, Playwright, or chromedp scripts work:
import puppeteer from 'puppeteer-core';
// Connect to Lightpanda's CDP server
const browser = await puppeteer.connect({
browserWSEndpoint: "ws://127.0.0.1:9222",
});
const context = await browser.createBrowserContext();
const page = await context.newPage();
await page.goto('https://example.com', {waitUntil: "networkidle0"});
const links = await page.evaluate(() => {
return Array.from(document.querySelectorAll('a'))
.map(a => a.getAttribute('href'));
});
console.log(links);
await browser.disconnect();
You don’t need to rewrite your automation code.
How Do I Install Lightpanda?
macOS (Apple Silicon):
curl -L -o lightpanda https://github.com/lightpanda-io/browser/releases/download/nightly/lightpanda-aarch64-macos
chmod a+x ./lightpanda
Linux:
curl -L -o lightpanda https://github.com/lightpanda-io/browser/releases/download/nightly/lightpanda-x86_64-linux
chmod a+x ./lightpanda
Docker:
docker run -d --name lightpanda -p 9222:9222 lightpanda/browser:nightly
Fetch a page:
./lightpanda fetch --log_format pretty https://example.com
Start CDP server:
./lightpanda serve --host 127.0.0.1 --port 9222
Then connect with Puppeteer/Playwright to ws://127.0.0.1:9222.
What Web APIs Does Lightpanda Support?
Lightpanda is in Beta — many websites work, but coverage is still growing:
✅ Implemented:
- HTTP loader (libcurl)
- HTML parsing (html5ever)
- DOM tree & APIs
- JavaScript (V8)
- XHR and Fetch APIs
- CDP/WebSocket server
- Click and form input
- Cookies
- Custom HTTP headers
- Proxy support
- Network interception
- robots.txt respect (
--obey_robots)
🚧 Work in progress:
- Full Web API coverage (there are hundreds)
- Edge cases and stability
The team is actively expanding coverage. Check their zig-js-runtime project for JavaScript API progress.
Why This Matters for AI Agents
The headless browser landscape has been stuck:
- Headless Chrome/Chromium — full browser, massive overhead
- Playwright/Puppeteer — great APIs, but still running Chrome underneath
- Selenium — even heavier, designed for testing not automation
Lightpanda represents a different philosophy: build a browser specifically for machines. Strip out everything humans need (rendering, GPU, extensions) and optimize for what automation actually requires (DOM, JavaScript, network).
The 11x speed and 9x memory improvements mean:
- More concurrent pages per server
- Lower infrastructure costs at scale
- Faster scraping pipelines
- More responsive AI agents
Comparison with Other Tools
| Tool | Approach | Best For |
|---|---|---|
| Lightpanda | New browser from scratch | High-volume automation, cost-sensitive |
| PinchTab | Browser control server | AI agent integration, token-efficient snapshots |
| Browser-Use | LLM-driven automation | Natural language browser control |
| Headless Chrome | Full browser, headless mode | Maximum compatibility |
Lightpanda isn’t trying to replace everything — it’s optimized for the subset of use cases where speed and memory matter more than 100% Web API compatibility.
The Zig Advantage
Building in Zig (rather than C++ like Chromium) brings:
- Smaller binary — no massive Chromium dependencies
- Memory safety — without garbage collection overhead
- Fast compilation — easier to contribute and iterate
- Cross-compilation — same codebase for Linux, macOS, Windows
It’s a bet on a newer systems language for a new kind of browser.
When to Use This
Use Lightpanda if:
- You’re scraping at scale and Chrome is your bottleneck
- Memory constraints matter (serverless, edge, containers)
- You need instant startup for ephemeral automation
- Your target sites work with current Web API coverage
Stick with Chrome if:
- You need 100% Web API compatibility
- You’re automating complex SPAs with obscure APIs
- Stability is more important than performance
Frequently Asked Questions
What is Lightpanda?
Lightpanda is an open-source headless browser built from scratch in Zig, designed specifically for AI agents, web scraping, and automation. It runs 11x faster than Chrome and uses 9x less memory.
Is Lightpanda a Chromium fork?
No. Lightpanda is built from scratch using Zig, with html5ever for HTML parsing (from Mozilla’s Servo project), V8 for JavaScript execution, and libcurl for HTTP. It’s a completely new browser implementation.
How much faster is Lightpanda than Chrome?
In benchmarks using Puppeteer to request 100 pages on AWS EC2 m5.large, Lightpanda was 11x faster than headless Chrome and used 9x less memory.
Does Lightpanda work with Puppeteer and Playwright?
Yes. Lightpanda implements the Chrome DevTools Protocol (CDP), so existing Puppeteer, Playwright, and chromedp scripts work by connecting to Lightpanda’s WebSocket endpoint instead of Chrome.
What Web APIs does Lightpanda support?
Lightpanda currently supports DOM APIs, JavaScript (V8), XHR, Fetch API, cookies, form input, click events, custom HTTP headers, proxy support, and network interception. Full Web API coverage is still in progress.
How do I install Lightpanda?
Download the binary for your platform (Linux x86_64 or macOS aarch64) from GitHub releases, or use Docker: docker run -d -p 9222:9222 lightpanda/browser:nightly
Is Lightpanda production-ready?
Lightpanda is in Beta. Many websites work, but you may encounter errors on complex SPAs or sites using obscure Web APIs. It’s actively developed and coverage is improving rapidly.
Why is Lightpanda written in Zig?
Zig provides memory safety without garbage collection overhead, smaller binaries than C++, fast compilation times, and easy cross-compilation. It’s a modern systems language well-suited for building performance-critical software like browsers.
Does Lightpanda respect robots.txt?
Yes. Use the --obey_robots flag when running Lightpanda to automatically respect robots.txt directives.
What license is Lightpanda released under?
Lightpanda is open source under the AGPL-3.0 license.
Getting Involved
Lightpanda is open source (AGPL-3.0) and actively developed:
If you’re building AI agents that browse the web, this is worth testing. The performance gap is real, and the team is shipping fast.