eraser-diagrams · MIT

AI-native diagramming library

Reliably generated by models, beautifully rendered for humans.

diagram.json

{
  "entities": [
    { "tag": "Icon", "id": "client",
      "icon": "user",
      "x": 190, "y": 40,
      "width": 40, "height": 40,
      "texts": [{ "text": "Client" }] },
    { "tag": "Group", "id": "vpc",
      "color": "blue",
      "title": { "text": "Production",
                 "icon": "server" },
      "x": 40, "y": 190,
      "width": 420, "height": 190 },
    { "tag": "Icon", "id": "api",
      "icon": "node",
      "x": 190, "y": 270,
      "containerId": "vpc",
      "texts": [{ "text": "Orders API" }] },
    { "tag": "Icon", "id": "db",
      "icon": "postgres",
      "x": 350, "y": 270,
      "containerId": "vpc",
      "texts": [{ "text": "Postgres" }] }
  ],
  "connections": [
    { "from": "client", "to": "api",
      "endArrowhead": "triangle",
      "label": "HTTPS",
      "fromPort": "bottom",
      "toPort": "top" },
    { "from": "api", "to": "db",
      "endArrowhead": "triangle",
      "label": "reads" }
  ]
}

render

The JSON on the left, rendered: a Client icon connected over HTTPS into a Production group containing an Orders API reading from Postgres

PNGHTML

Designed to be

Generated by models

generator
Claude Opus
GPT Sol
Gemini Pro
Moonshot Kimi
Z.ai GLM
valid JSON → same render
Compatible with any LLM The JSON schema any text-based LLM can generate
Token-efficient3,238 tok
Fast to generate25.4s
Rarely malformed0.6% retry
A schema designed for AI Token-efficient, fast to generate, rarely malformed
“make it a star layout”
“arrange them in a grid”
“put them in a ring”
“make it symmetrical”
“one row per tier”
Instructable layout LLM controls the layout at the pixel level, not a layout engine
  { "tag": "Icon", "id": "api" }, + { "tag": "Icon", "id": "queue" },   { "tag": "Relationship", −   "from": "api", "to": "db" } +   "from": "api", "to": "queue" }
Built for iteration Make surgical edits and run diffs, instead of regenerating each time

Designed to be

Read by humans

L1system context L2payments service L3components API Ledger Queue Users Partner
Legible at any size Layout quality holds on complex, real-world diagrams, not just at demo scale.
4 CROSSINGS 0 CROSSINGS WebiOSCLI BillingSearchOrders WebiOSCLI OrdersSearchBilling
Best-in-class line routing Orthogonal paths, minimal crossings, clean label placement.
Orders Service Owner · payments-team • handles idempotent retries • p99 120ms
Payments DB Region · us-east-1 single writer → multi-AZ • retention 35 days
Rich text support Formatted text inside nodes, labels and groups, not just single-line captions.
4,000 icons AWSAzureGCPKubernetesCiscoOracle+more
4,000 icons available AWS, Azure, GCP and vendor logo sets, as an optional add-on.

Designed to be

Run anywhere

Local
CI
Server
Container
Lambda
Runs on your own infrastructure Local, CI, server or Lambda — anywhere you can run a headless browser.
eraser-diagrams render --format
PNGdefault
HTMLself-contained
PNG or interactive HTML One call, either output — the HTML is self-contained, fonts and all.
$ npm i -D @eraser/diagrams-cli $ export CHROMIUM_PATH=$(which chromium) $ npx eraser-diagrams render diagram.json Wrote diagram.png
Easy installation One package install. Point it at a Chromium you already have.
base schema
tag Icon
id orders
text Orders
extended
tier badge critical
oncall true
Orders critical oncall
Customizable schema Extend element types, defaults and styling to match your own domain.
MIT License 2026
Copyright Eraser Labs, Inc.
Permissions use · copy · modify · sell
Conditions keep the notice
Limitations no warranty
MIT licensed Use it, ship it, embed it in a commercial product.

Open source scope

License
MIT
Contributions
Not open to contribution
Included
Data schema · rendering engine · line routing · icon library adapter · exporting
Not included
GUI editor · AI prompts · LLM · pre- and post-processing
Support
Hosted offering and professional services available. Talk to us →