{"repo":"skirianov/dom-distill","free":true,"listed":false,"github":"https://github.com/skirianov/dom-distill","clone":"git clone https://github.com/skirianov/dom-distill.git","description":"Token-efficient DOM-to-tree distiller for LLMs and browser automation. Zero dependencies.","language":"TypeScript","stars":10,"topics":["ai-agents","browser-automation","dom","llm","playwright","typescript"],"license":"MIT","category":"scrapers-browser-automation","readme_excerpt":"dom-distill Token-efficient DOM-to-tree distiller for LLMs and browser automation. The Problem AI agents that browse the web (AutoGPT, Skyvern, browser-use, etc.) hit the same bottleneck: bloated DOMs. A typical React/Next.js page has 2,000+ nodes. Serialize that and send it to an LLM, and you're burning 100k–180k tokens per step — most of it hidden s, s, and tags the model can't act on anyway. dom-distill is a zero-dependency TypeScript engine that runs inside the browser ( page.evaluate ) and converts the DOM into a minimal, structured JSON array of only the nodes an LLM needs to take action. Results Live benchmarks running dom-distill against real sites via Playwright: Site Raw Nodes Raw Tokens → Filtered Nodes Filtered Tokens Reduction --- --- --- --- --- --- GitHub 1,908 147k 115 4.6k 96.8% Stripe 2,438 180k 192 9.4k 94.8% React Docs 1,846 68k 139 6.4k 90.7% Hacker News 807 8.6k 226 10.2k n/a (already minimal) What the LLM Sees Instead of 2,000 nodes of raw HTML, the LLM gets a clean array like this: Each node includes: - selector — Deterministic CSS selector the LLM can act on: click(\"[data-testid=\\\"nav-home\\\"]\") - rank — InteractionRank score (0–10+) based on tag semantics, ARIA roles, and attributes - confidence — Selector stability score (0–1): how likely the selector survives DOM changes Install Quick Start With Playwright In-Browser API Distillation Function Description --- --- distill(root?, config?) Synchronous single-pass DOM → tree distillAsync(root?, config?) ","default_branch":null,"files":null,"tree":[],"storefront":"/r/skirianov","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/skirianov/dom-distill/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}