**edit: forgive the "ligher" typo, was a little too excited to press post :)
A couple of weeks ago I posted that 0.5.0 was en route and that I thought you would like it. It is out now 🐷 Here is what landed from that list, plus a few things that grew along the way.
Piglets. Piglet build can strip features out of the base harness or out of a prior Piglet, and a stripped Piglet can be the base for the next one. Piglets keep getting core updates for the parts they kept. pig-tern shipped as planned. pig-core is a lean base: it keeps only read, bash, edit and write.
Parity and porting. The port-map ledger is maintained mechanically now, and every row is closed. PiG follows Pi 1.3.0 up to Pi commit 1402973a, and every one of Pi's semantic interfaces is covered and held by a zero-gap gate in CI.
Evals. The eval and benchmark tooling became buffon, an open benchmark arena for the whole Pi community. The numbers below come from it, and you can rerun them.
Quality of life. pig extension upgrade rewrites older Go extensions for the new SDK, plus a lot of great contributions from the herd.
Release notes: https://github.com/MichaelKinsy/PiG/releases/tag/v0.5.0
Blog post with the full tables: https://pi-in-go.dev/blog/pig-0-5-0/
Repo: https://github.com/MichaelKinsy/PiG
Piglets (Pigpen): https://github.com/MichaelKinsy/pigpen
Buffon: https://github.com/MichaelKinsy/buffon
Performance
All numbers are median CPU ms from buffon on one machine, on the 0.5.0 release candidate. Lower is better.
| Task | PiG 0.5.0 | PiG 0.4.1 | Pi-Bolt | Pi (Node) |
|---|
--version | 5 | 18 | 11 | 282 |
| One prompt | 16 | 64 | 44 | 424 |
| One prompt with tools | 29 | 119 | 56 | 518 |
| RPC session | 71 | 438 | 108 | 675 |
| Interactive start | 61 | 145 | 55 | 536 |
| Resume a long session | 69 | 137 | 50 | 443 |
| Streaming a long answer (TUI) | 403 | 2,451 | 925 | 2,850 |
| One prompt, 10 TypeScript extensions | 934 | 2,191 | 109 | 676 |
| RPC, 10 TypeScript extensions | 2,016 | 9,430 | 194 | 950 |
0.5.0 beats 0.4.1 on every row. Without extensions it beats Pi on every row. Pi-Bolt is a little ahead on interactive start and long-session resume.
The extension rows are a real loss. PiG starts a separate Node host for TypeScript extensions, and that adds a fixed cost. So I also ran the same extensions ported to Go and fused into a Piglet. This is my own run, not buffon, and it is labelled provisional. The Go and TypeScript extensions were checked to produce the same commands, tools, results and messages.
| Scenario | TS extensions | Go extensions in a Piglet | No extensions |
|---|
| Print, 10 extensions | 941 | 67 | 16 |
| RPC, 10 extensions | 2,004 | 521 | 70 |
In print mode the Go Piglet is ahead of Pi-Bolt (67 against 109). In RPC mode Pi-Bolt is still ahead (194 against 521). Scripts and raw data are attached to the release as go-ext-comparison.tar.gz.
Most of the speed came from removing a few patterns. A streamed file write used to re-highlight the whole file for every new piece, and tool-call arguments were reparsed from the start on every token, which made long streams quadratic. Now PiG keeps state and processes only the new part. Every speed-up has to keep output byte-identical to Pi.
Piglets and binary size
Every built-in part of PiG is now a slot. A Piglet keeps a part, replaces it with Go code, or strips it so it leaves the binary. Stock PiG is the normal pig binary with everything built in. pig-core is a Piglet that keeps only read, bash, edit and write.
| Binary | Size |
|---|
| Stock PiG 0.5.0 | 70.3 MB |
| Go extensions only (TypeScript, Python and Rust runtimes stripped) | 61.4 MB |
| pig-core | 39.4 MB |
Sizes are from linux/amd64 builds of the release commit. Slots can also replace a part: pig-tern fills the frontend slot so the same PiG draws natively in the Tern terminal.
Durable
Durable has come up a lot here, so here is how I think about it. Pi Durable is a stateful agent whose state lives on a server, separate from the client (TUI, web UI, mobile) and from the chat history. A session keeps going when a client disconnects, and any client can attach to it. PiG runs Durable natively in Go. In 0.5.0 its cost no longer grows with your history, and a session finds its next wake without walking every live task. The Cloudflare Durable host follows Pi 1.3.0 and runs its suite in CI. https://pi-in-go.dev/blog/pig-0-5-0/
buffon
buffon is a benchmark arena I made for the Pi community. Every harness gets the same tasks and the same Pi extensions on the same machine. You can rerun it, point it at your own tools, or add to it. It builds on the open work of Pi, Pi-Bolt, durable-bench and everyone who publishes their evals.
Try it
go install github.com/MichaelKinsy/PiG/cmd/pig@latest
Custom models in models.json now need an api on the model or its provider, as in Pi. Go SDK users can run pig extension upgrade to rewrite older extensions.
Not done yet
TypeScript extensions are slower than in Pi and Pi-Bolt, as above. The TinyGo Durable build used for Cloudflare starts cold slower than Pi's, and the normal pig binary does not use it. The first code-mode use in a process costs a few ms more, and the OAuth credential store is not available to Node extensions yet.
PiG is MIT licensed and free, with no hosted or paid tier holding anything back. Big thanks to the Pi team, to Pi-Bolt for its open benchmark suite, to durable-bench, to everyone who posts their evals in the open, and to the herd for the contributions and issues.🐷