lightpanda-io/browser

Developer Tools

A from-scratch headless browser in Zig for scraping and browser automation, controllable via CDP, WebDriver BiDi and MCP.

Best position on GitHub Trending (daily): #15. Click to get this badge for your README
37,948
1,849
Zig
AGPL-3.0
3 years old

Lightpanda is a headless browser written in Zig from scratch, not a Chromium or WebKit fork, aimed at crawlers, scraping pipelines and automation agents that need JavaScript execution without a full desktop browser's footprint. It is most relevant when you already drive Chrome headlessly through Puppeteer, Playwright or CDP and want to keep that client code while shrinking memory and runtime per page.

What changes in practice

Instead of launching Chrome, you run lightpanda serve and point an existing automation client at its WebSocket endpoint; the README's Puppeteer example only swaps in browserWSEndpoint (README). The same server can speak CDP, WebDriver BiDi, or both, and can listen on a Unix socket instead of TCP.

For one-off extraction there is no protocol needed: lightpanda fetch dumps a page as HTML, Markdown, PNG, PDF or structured JSON-LD/OpenGraph metadata, with flags to wait on a timer, selector or script. Respecting robots.txt is an opt-in --obey-robots flag, and the build includes an adblocker, proxy support, custom headers and network interception.

The other distinguishing mechanism is that the page model is deliberately smaller than Chrome: it has an HTML parser, DOM, V8-based JavaScript with XHR and Fetch, cookies and clicks, but no graphical rendering engine. That is the source of the advertised resource savings.

Reported performance

The project's benchmark requests 933 real pages over the network on an AWS EC2 m5.large, reporting 123MB peak memory for 100 pages versus 2GB for headless Chrome (~16x less) and 5s versus 46s execution (~9x faster) (benchmark details). These are crawler-focused figures from one setup, not a general page-load guarantee.

Agent and MCP paths

lightpanda agent drives the browser from natural language or slash commands using a model from Anthropic, OpenAI, Gemini, Vertex AI, Mistral, Hugging Face, OpenRouter, Vercel AI Gateway, an OpenAI-compatible base URL, or local Ollama/llama.cpp/LLMD (agent docs). A session can be exported as a PandaScript, plain JavaScript with native browser primitives, then replayed with lightpanda run without a model at runtime — useful when you want LLM prototyping but deterministic production runs. --no-llm drops to a plain REPL.

The browser also exposes an MCP server over stdio or HTTP; over HTTP, each client can get an isolated browsing session (or share one via a common Mcp-Session-Id), so multiple agents can run from one process (MCP guide). This path needs an MCP-capable client; the CDP path needs a Puppeteer/Playwright-style client; neither is required for fetch.

Requirements and limits

Binaries are distributed as nightly builds for Linux and macOS on x86_64 and aarch64, plus Homebrew, AUR, Nix and Docker images (releases). Linux binaries require glibc, so Alpine/musl images fail with a missing dynamic linker; Windows has no native binary and must use WSL2; Android/Termux is not supported. Building from source requires Zig 0.17.0 plus V8, libcurl and Rust (html5ever).

Telemetry is on by default and must be disabled with LIGHTPANDA_DISABLE_TELEMETRY=true (privacy policy). Licensing is AGPL-3.0, which matters if you plan to embed or redistribute it. Compatibility is tracked through Web Platform Tests with results published daily (WPT results); the README lists implemented features rather than claiming full standards parity.

Written by AI from the project's README, updated October 30, 2026. The project's own docs are the source of truth.

Hacker News

Show HN: Lightpanda, an open-source headless browser in Zig
▲ 319 · 137 comments · January 24, 2025
Lightpanda: Headless browser designed for AI and automation
▲ 154 · 1 comment · January 24, 2025
Show HN: Lightpanda, an open-source headless browser in Zig
▲ 7 · 0 comments · December 16, 2024