Agents In Use
What’s new todayLast update
499 additions

How to use Claude to build a Pi inference engine

Geistlib was built in C with heavy Claude Code pair-programming and packages BitNet 2B for offline use on a Raspberry Pi 5. The author published performance measurements, methodology and a local benchmark command.

TRY A BOUNDED VERSION

Prompt to try

Editorial adaptation, not the source author’s exact prompt. Replace bracketed inputs and review tool permissions first.

Pair-program with me on [C inference engine] for [model] on [ARM64 device]. Implement [ternary-weight kernels], embed weights with demand paging and package an offline executable. Create a reproducible benchmark protocol for [comparison engines], including thermal conditions and energy measurements, and document model limitations.

What happened

The author reports offline BitNet 2B inference on a 4 GB Raspberry Pi 5 at 15–18 tokens/s and 0.44 J/token, packaged in a single approximately 1.2 GB executable.

Reported by geisten on Hacker News

How the agent did it

  1. Built a C inference engine from scratch with heavy Claude Code pair-programming.
  2. Specialized the ARM64 inference loop for ternary weights and SDOT.
  3. Embedded model weights in a single executable with demand paging.

Where a person stepped in

The author made correctness measurable and published benchmarks and methodology; the post does not describe specific code review steps.

A person guided the agent closely as it worked.

The author spent three months building geistlib, an LLM inference engine written from scratch in C, with heavy pair-programming help from Claude Code. It runs Microsoft's BitNet 2B fully offline on a 4 GB Raspberry Pi 5. Engine and model are packaged in a single executable of approximately 1.2 GB, while the runtime itself is under 1 MB.

The implementation specializes in BitNet's ternary weights. On ARM64, the author says the main inference loop replaces much multiplication with additions and maps work to the SDOT instruction. Embedded weights are demand-paged, with memory usage described as comparable to mapping a separate model file.

The author reports 15–18 tokens per second on their Pi, compared with 9.3 for Microsoft's bitnet.cpp, and energy use of 0.44 joules per token. They published recordings, methodology and measurements and provided a make bench command that follows a frozen protocol, waits for thermal conditions and compares installed engines. The post also preserves a confidently incorrect model answer about the Moon, acknowledging the limits of the small model. These remain the author's measurements. Who it's for: C and ARM developers exploring local inference who want agent-assisted implementation accompanied by reproducible benchmarks.

Prompt
Suggested prompt (written by Agents In Use, not the author's)

Source: Hacker News · geisten

Frequently asked questions

How was the model packaged?

The author embedded model weights directly in an approximately 1.2 GB executable. The weights are demand-paged, and the runtime itself is under 1 MB.

How could someone rerun the benchmarks?

The author says make bench runs a frozen local benchmark protocol, waits for thermal conditions and compares against llama.cpp and bitnet.cpp when installed.

More details

Remaining steps

  1. Benchmarked the engine on a Raspberry Pi 5 and published recordings, methodology and energy measurements.

About this account

Claude Code contributed through heavy pair-programming; the author does not describe independently delegated coding jobs.

Platform: Hacker News. Attribution: https://news.ycombinator.com/item?id=49258137. Prompt: Suggested (written by Agents In Use, not the author's). Sourced by the Agents In Use pipeline.

Credit: geisten on Hacker News

Source published 11 Aug 2026

Source checked 14 Oct 2026

Tools and topics

Claude Code · C · BitNet 2B · Raspberry Pi 5 · make bench

local inference · Raspberry Pi · C programming

Editorial completeness: 100/100. Measures documented fields, not agent performance or verified outcomes.