Skip to main content

Tools for AI agents to work with IC layout (GDSII/OASIS via KLayout)

Project description

klayout-tools

CI License: MIT Status: scaffold

Tools for AI agents to work with IC layout.

🌐 klayout-tools.org — project site.

The kicad-tools playbook, one layer down the stack: standalone Python tools that let AI agents (LLMs, autonomous coding assistants) parse, analyze, and manipulate chip layouts — GDSII/OASIS streams, DRC decks, LVS — programmatically, headless, with machine-readable JSON everywhere. Built on KLayout's Python API the way kicad-tools builds on KiCad's file formats: the heavy lifting stays in the proven engine; the agent-native surface is ours.

The target capability: an agent can take a spec → schematic/generator → sized circuit → layout → DRC/LVS clean → extracted netlist → simulation-verified, on an open PDK, unaided — with every step headless and JSON-contracted. ROADMAP.md holds the build order, docs/ARCHITECTURE.md how the pieces fit; the work itself is tracked in GitHub issues.

Built in the open by 2AM Logic.

Why agent-focused?

Chip design tooling assumes a human at a GUI. klayout-tools provides what an agent needs instead:

  • Structured data access — layouts parsed into clean Python objects
  • Machine-readable output — every CLI command supports --format json
  • Programmatic modification (planned) — edit layouts without a GUI
  • MCP server (planned) — expose the toolkit directly to agent frameworks
  • LLM reasoning interface (planned) — purpose-built module for layout decisions, with geometric execution handled by tools, not tokens

Status

Scaffold. The pattern is proven (see the kicad-tools gallery of boards designed end-to-end by agents); this repo is where it meets silicon. See ROADMAP.md for the build order and CLAUDE.md if you are an agent working here.

Install

uv tool install git+https://github.com/2AMLogic/klayout-tools

Or with pip:

pip install git+https://github.com/2AMLogic/klayout-tools

klt is now on PATH. (A published PyPI release is planned — see RELEASING.mdpip install klayout-tools will work once that lands.)

Quick start

klt layers design.gds                    # enumerate layers, JSON out
klt cells design.gds --top               # cell hierarchy
klt drc design.gds --deck sky130        # run a DRC deck, structured results
klt stats design.gds --per-layer         # densities, bbox, polygon counts
klt pdk find --pdk sky130A               # locate an installed PDK, JSON out

Development

Dependencies are managed with uv; the klayout pip wheel provides the headless Python API (no GUI, no source build needed).

uv sync --locked --extra dev    # create/refresh .venv from uv.lock

uv run --extra dev ruff check .     # lint
uv run --extra dev pytest           # tests

npm run check:ci                    # lint + tests — the same gate CI runs

.github/workflows/ci.yml runs ruff check plus pytest on Python 3.10–3.13 for every pull request and every push to main, so a red check is the signal that a PR is not mergeable.

Guides

Design notes

Spikes and engine surveys — proposals and findings, not commitments.

  • SPICE PVT corner runner — ngspice vs. Xyce, a proposed JSON contract for sweeping a netlist across a corner matrix, and the wrap/build call.
  • sc-leflib evaluation — whether siliconcompiler's LEF parser fills a gap that KLayout's own LEF/DEF reader leaves. Verdict: use pya, no new dependency.

License

MIT. © 2026 Two AM Logic, Inc.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

klayout_tools-0.1.0.tar.gz (1.4 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

klayout_tools-0.1.0-py3-none-any.whl (35.3 kB view details)

Uploaded Python 3

File details

Details for the file klayout_tools-0.1.0.tar.gz.

File metadata

  • Download URL: klayout_tools-0.1.0.tar.gz
  • Upload date:
  • Size: 1.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.0 {"installer":{"name":"uv","version":"0.12.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for klayout_tools-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a5e480f6e904dcf25c828c36a0e1efb37a1d177d8c08bf9b3530a1cd9fbb2ed8
MD5 8ecff8f97ada2d1d3cac06daa05eb9e0
BLAKE2b-256 149539560abdcd40ad6993037ed81401989e66c0d58e692429800f47f64a5b08

See more details on using hashes here.

File details

Details for the file klayout_tools-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: klayout_tools-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 35.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.0 {"installer":{"name":"uv","version":"0.12.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for klayout_tools-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3511bca9f687404f876e66a4b2979f400f34493442e6d08a0a7d0f88b08018b9
MD5 ecbde0cd5434da369231d15c22d3b3bd
BLAKE2b-256 f322825b6261d9cda45e4a371ecedcee252a0d5b824e993b814919612f8f2494

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page