Boardsmith — Prompt to Hardware: text prompt → schematic + firmware
Project description
Text prompt → KiCad schematic, BOM, and firmware. No templates — real wired circuits with computed values.
Quick Start
pip install boardsmith
Works on Mac, Windows, and Linux. Requires Python 3.10+.
Why this exists · Install · Examples · How it works · Contributing
Why this exists
Designing a circuit today means: open KiCad, manually place components, look up datasheets for every pull-up value, voltage divider, and decoupling cap. Miss one constraint and the board doesn't work. Every hobby project starts with hours of busywork before you write a single line of firmware.
LLMs changed what's possible — they can write code, generate configs, plan architectures. But hardware has physical constraints that hallucinations destroy. You can't "almost" get a voltage divider right. A wrong pull-up value means the I2C bus doesn't talk. A missing decoupling cap means random resets under load.
boardsmith treats circuit design like compilation. You describe what you want in plain English. A 9-stage synthesis pipeline with 11 constraint checks turns that into a real schematic — with every pull-up resistor, every decoupling cap, every I2C address calculated from datasheet specs. The LLM handles intent. The pipeline enforces physics.
The difference: boardsmith works offline (--no-llm). It produces real computed values, not templates. Open the output in KiCad — it's a wired schematic with correct nets, not a starting point you have to fix.
Install
pip install boardsmith[llm]
export ANTHROPIC_API_KEY=sk-ant-... # or OPENAI_API_KEY
boardsmith build -p "ESP32 with BME280 temperature sensor"
The agent asks one clarifying question (power source?), then iterates until the design passes all constraint checks.
No API key? Run offline with the built-in knowledge base:
# Offline/demo fallback — no API key required:
pip install boardsmith
boardsmith build -p "ESP32 with BME280 temperature sensor" --no-llm
Output lands in ./boardsmith-output/.
What it does
boardsmith takes a natural language description and produces four artifacts:
Schematic (schematic.kicad_sch) — Opens directly in KiCad. Not a template — an actual wired schematic with computed pull-up resistors, decoupling caps, correct I2C addresses, and proper power nets.
BOM (bom.json) — Line items with manufacturer part numbers, quantities, and estimated cost. Every part comes from the verified knowledge base.
Firmware (firmware/main.cpp + hardware.h) — Arduino or ESP-IDF ready. Pin definitions, init sequences, and peripheral setup generated from the schematic.
Gerber (gerber/) — JLCPCB-compatible manufacturing files. Board outline, copper layers, drill files. Upload directly to order PCBs.
In v0.2, the LLM also closes the loop: boardsmith build automatically repairs ERC violations using a bounded agent loop, and boardsmith modify enables surgical patching of existing schematics.
Examples
# Weather station
boardsmith build -p "ESP32 with BME280 and SSD1306 OLED display" --no-llm
# CO2 monitor with display
boardsmith build -p "RP2040 CO2 monitor with SCD41 sensor and ST7789 TFT" \
--target rp2040 --quality high
# LoRa sensor node
boardsmith build -p "ESP32 with SX1276 LoRa and BME280 for remote weather" --no-llm
Supported hardware
| Target | Status | Notes |
|---|---|---|
| ESP32 | Stable | ESP-IDF + Arduino, 50+ compatible components |
| RP2040 | Stable | Pico SDK, I2C/SPI peripherals |
| STM32 | Beta | STM32 HAL, subset of peripherals |
212 verified components — sensors, displays, comms modules, MCUs, memory, and power. Each with electrical ratings, timing constraints, I2C addresses, and init sequences.
boardsmith list-components # browse all 212
boardsmith research BME280 # look up a specific part
How it works
The pipeline runs 11 constraint checks: voltage compatibility, I2C address conflicts, pin assignment, power budget, timing, decoupling, pull-up values, bus width, clock domains, current limits, and ERC validation.
--no-llm runs the full pipeline deterministically — no API key, no network, same output every time. With an LLM, the system iterates and improves designs until confidence exceeds the quality threshold.
The core data structure is HIR (Hardware Intermediate Representation) — a typed schema that flows through every stage. It's the contract between the synthesis pipeline and the firmware compiler.
Agentic EDA (v0.2)
Boardsmith v0.2 adds a closed-loop LLM-guided EDA layer on top of the v0.1 synthesis pipeline.
ERCAgent — Automatic ERC Repair
After schematic generation, boardsmith build automatically invokes the ERCAgent if LLM credentials are available. The agent:
- Reads real KiCad ERC output via
RunERCTool - Asks the LLM to reason about each violation
- Applies surgical patches via
WriteSchematicPatchTool(ADD/MODIFY only — no destructive deletes) - Repeats up to 5 iterations with stall detection (same violations twice = stop)
- Reports remaining violations in plain English if the cap is hit
Control the iteration cap: boardsmith build --max-erc-iterations 3
boardsmith modify — Brownfield Schematic Patching
Patch an existing KiCad schematic without touching the B1–B9 pipeline:
boardsmith modify existing.kicad_sch "add battery management with TP4056"
Flow:
- LLM reads the schematic and generates a structured modification plan
- Plan is displayed — you confirm (or pass
--yesto skip) - Patches are applied; ERCAgent validates post-patch
- A timestamped
.bakbackup is created before any write
Note:
boardsmith modifydoes not update the HIR. Runboardsmith build --from-schematicto re-sync.
boardsmith verify — Semantic Design Verification
Check a schematic's design intent against the HIR:
boardsmith verify path/to/design.kicad_sch --hir path/to/design.hir.json
Runs the SemanticVerificationAgent — 6 rule-based tools followed by an LLM-guided fix loop:
| Tool | What it checks |
|---|---|
| VerifyConnectivityTool | All HIR buses have matching schematic nets |
| VerifyBootabilityTool | Boot pins, reset circuits, oscillator config |
| VerifyPowerTool | Power rails, decoupling, voltage domains |
| VerifyComponentsTool | All HIR components present with correct roles |
| VerifyBomTool | BOM CSV matches HIR component list |
| VerifyPcbBasicTool | All schematic refs present in PCB layout |
Requires pip install boardsmith[llm]. No --no-llm fallback (rule-based checks are free; LLM fixes require a key).
Contributing
The fastest way to contribute: add a component to the knowledge base. It's a Python TypedDict with electrical specs from the datasheet. Takes about 20 minutes. Every new component immediately makes boardsmith more useful for everyone who needs that part.
# 1. Add your component to shared/knowledge/seed/sensor.py (or display.py, etc.)
# 2. Smoke test
boardsmith build -p "ESP32 with <your-component>" --no-llm --no-pcb
# 3. Run tests
pytest
# 4. Open a PR
See CONTRIBUTING.md for the full guide, component schema, and other ways to help.
License
AGPL-3.0 — use it, modify it, ship improvements back.
Commercial license available for closed-source integration. Contact root@foresthub.ai.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file boardsmith-0.2.0.tar.gz.
File metadata
- Download URL: boardsmith-0.2.0.tar.gz
- Upload date:
- Size: 1.1 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
44556d1e8b7295a8ae7f860a9a57b7c06065e377103b25d475214b3f8be90139
|
|
| MD5 |
d48845d5f1d06c4da1b98c942e0c9aa8
|
|
| BLAKE2b-256 |
60cfa1ff79e274ff5edfce259a17e2c60488a7352201a56f0cad4ebd6ea68108
|
Provenance
The following attestation bundles were made for boardsmith-0.2.0.tar.gz:
Publisher:
publish.yml on ForestHubAI/boardsmith
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
boardsmith-0.2.0.tar.gz -
Subject digest:
44556d1e8b7295a8ae7f860a9a57b7c06065e377103b25d475214b3f8be90139 - Sigstore transparency entry: 1087004289
- Sigstore integration time:
-
Permalink:
ForestHubAI/boardsmith@4189c69dc9390300af9090734ad6191953ed2d54 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/ForestHubAI
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@4189c69dc9390300af9090734ad6191953ed2d54 -
Trigger Event:
push
-
Statement type:
File details
Details for the file boardsmith-0.2.0-py3-none-any.whl.
File metadata
- Download URL: boardsmith-0.2.0-py3-none-any.whl
- Upload date:
- Size: 856.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6c9147fdfbee814641234633694e4abfd3648ba5f634a1dd5d34e1b8ebdb9a12
|
|
| MD5 |
0c43d36b008b9477d79f7ab03ae4b062
|
|
| BLAKE2b-256 |
5018c9b0c7c4be02df0931ffd52b24fe234c3bc3d69a37ac2fbb70728a8390a0
|
Provenance
The following attestation bundles were made for boardsmith-0.2.0-py3-none-any.whl:
Publisher:
publish.yml on ForestHubAI/boardsmith
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
boardsmith-0.2.0-py3-none-any.whl -
Subject digest:
6c9147fdfbee814641234633694e4abfd3648ba5f634a1dd5d34e1b8ebdb9a12 - Sigstore transparency entry: 1087004414
- Sigstore integration time:
-
Permalink:
ForestHubAI/boardsmith@4189c69dc9390300af9090734ad6191953ed2d54 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/ForestHubAI
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@4189c69dc9390300af9090734ad6191953ed2d54 -
Trigger Event:
push
-
Statement type: