A hardware-fault-clearance harness for Raspberry Pi 5. It distinguishes faults that look like broken hardware (wrong pin numbering, address, library, or config) from STOP hardware faults (shorted I2C, undervoltage), and may edit workspace-relative driver files when the gold fix is software.
The durable moat: typed sensor reads with units/ranges and
sub-millisecond time-series correlation that can't cross a WAN —
instead of parsing ASCII from i2cdetect over SSH.
GPIO, I2C, telemetry, and code-edit tools return structured values with units and nominal ranges — so the model reasons about the actual hardware state instead of grepping logs.
Edge-event capture via the kernel character device catches the glitches a single sample misses. The capability cloud-over-SSH genuinely can't match.
Reads are always safe. GPIO writes and physical ops are Class I — per-action human approval, risk-tiered, scoped. The under-voltage bit is a hard STOP before any load.
No C dependency (the gpiod crate talks to
/dev/gpiochipN directly). Cross-compiles to a single
static aarch64 binary (~2.7 MB) you drop on the Pi.
Built on llama.cpp's OpenAI-compatible server.
Fixes ~25–35% of "hardware feels broken" bugs in code/config. Correctly triages the rest as real hardware faults. Blind spot: analog/scope debugging (it can't see waveforms).
Ships with a headless eval harness: run the model against simulated fixtures and apply the 55% fix-rate / 10% hallucination go/no-go rule before trusting it with real hardware.
Start a local llama-server, point PiForge at it, give it a symptom.
Load a small model with the Qwen3 chat template and Q8 KV cache (the cache-friendly prefix is the key cost lever on a slow Pi).
# On the Pi 5 (8GB, NVMe, official Active Cooler) llama-server -m qwen3-4b-instruct-2507-q4_k_m.gguf \ --jinja --port 8080 -c 8192 \ -ctk q8_0 -ctv q8_0
Reads (i2c, gpio get, scope,
telemetry) are always safe. GPIO writes and I2C writes
are Class I and require per-action approval.
# Add your user to the hardware groups once: sudo usermod -aG gpio,i2c,spi,dialout $USER # Then: ./piforge --config piforge.toml \ --task "my BME280 keeps returning NaN for humidity"
hardware_inventory — list detected I2C devices, GPIO
pins, board model. Call first to ground yourself.
telemetry — vcgencmd temp/volts +
decoded get_throttled bitmask (the under-voltage STOP
signal).
i2c — scan / detect / read with parsed values,
units, and both endian interpretations for 2-byte reads.
gpio — typed get/set over the RP1 character device.
scope — time-series edge capture (the moat).
edit_file — whole-file edits, sandboxed to the
workspace root.
No public benchmark covers hardware diagnosis. So before betting on the local-appliance product, run the gate.
The eval runs cases headless: the agent's HIL tool calls are served by a simulator driven by each case fixture, and edits land in a per-case temp workspace the scorer reads back. A mock provider lets the whole thing run in CI without a llama-server.
# Headless CI run (scripted mock provider): ./piforge-eval --mock --config piforge.toml.example # Real model evaluation against a running llama-server: ./piforge-eval --config piforge.toml