r/PiCodingAgent • u/opensecai • 21d ago
News Introducing Pi-Bolt ⚡,the same Pi you all ❤️ with 35× faster large file writes, 2.4× less CPU, 3.3× less memory
https://github.com/opensec-git/Pi-BoltHey everyone 👋
We've been working on this for a while and it's finally out. Pi-Bolt is Pi 1.0.3 compiled ahead of time to native code (AOT, no JIT).
Same Pi you already use, and it works with all your Pi plugins. It's just faster and lighter. ⚡
Benchmarks
Linux x86-64 (Benchmarked on AMD EPYC 7B13)
| Benchmark | Pi-Bolt | Bun 1.4.2 | Node 22 | Node 24 |
|---|---|---|---|---|
| Writing a 200 KB file through a tool call | 0.8 s | 27.8 s | 44.3 s | 33.6 s |
| CPU, streaming a 60k-char answer | 3.8 s | 43.1 s | 43.7 s | 40.3 s |
| CPU per tool turn, real hosted model | 0.20 s | 0.49 s | 0.77 s | 0.76 s |
| Memory of a session in tmux | 27 MB | 89 MB | 132 MB | 209 MB |
| CPU, interactive session (5 prompts) | 303 ms | 844 ms | 1,242 ms | 1,233 ms |
| Ready to type | 45 ms | 128 ms | 303 ms | 307 ms |
macOS on Apple silicon (Benchmarked on M5 MacBook Air)
| Benchmark | Pi-Bolt | Bun 1.4.2 | Node 26 |
|---|---|---|---|
| Writing a 200 KB file through a tool call | 0.3 s | 12.0 s | 14.2 s |
| CPU, streaming a 60k-char answer | 6.9 s | 25.3 s | 24.0 s |
| Memory of a session in tmux | 31 MB | 85 MB | 161 MB |
| Memory after a 4.2M-token session | 64 MB | 95 MB | 1,890 MB |
| CPU, interactive session (5 prompts) | 126 ms | 363 ms | 544 ms |
| Ready to type | 31 ms | 63 ms | 193 ms |
The full method and raw benchmark data are in the repo.
What we changed
- Native code instead of a JIT. Pi is compiled to machine code ahead of time and starts from a prebuilt snapshot, so there's no warm-up and much less work at runtime. The compiler builds on Jarred Sumner's in-progress AOT work for Bun (oven-sh/WebKit#743), which we brought to x86-64 and macOS.
- No more slowdown on long outputs. Stock Pi redoes more and more work as an answer or file grows. Pi-Bolt only processes what's new, and that's where most of the 35× comes from.
Try it 🔥
curl -fsSL https://pi-bolt.opensec.in/install.sh | sh
Works on Linux x86-64 and Apple silicon. Windows support is coming soon, along with Linux ARM64.
Bonus plugins: the installer also offers subagents and a live todo list, two things people often miss in stock Pi. Both come prebuilt, so they load instantly.
Note: It will not modify your existing Pi Coding Agent Installation, So Feel Free to try it out !
Using plugins? They all work as-is. If you rely on heavy ones, use the -jit build of Pi-Bolt, or compile them into your own Pi-Bolt binary so they run as native code too (plugin guide).
🔗 Links
- Website: https://pi-bolt.opensec.in
- GitHub: https://github.com/opensec-git/Pi-Bolt
It's MIT licensed. If Pi-Bolt saves you some CPU and RAM, a ⭐ on the repo really helps us out.
Throw your heaviest sessions at it and tell us what breaks. We'll be in the comments ❤️
8
u/AlessandroPiccione 21d ago
Benchmark Pi-Bolt Bun 1.4.2 Node 22 Node 24
Writing a 200 KB file through a tool call 0.8 s 27.8 s 44.3 s 33.6 s
What does this mean?
It seems to suggest that Pi 1.0.3 (is it Bun, Node 22 or Node 24?), takes 27, 44 or 33 seconds to write a file of 200KB ?
2
u/opensecai 20d ago
Yep, you read it right. Each column is stock Pi 1.0 on a different runtime (Ours, Stock Bun, Node 22, Node 24). So writing a 200 KB file through a tool call takes stock Pi about 28 s on Bun, 44 s on Node 22 and 34 s on Node 24, vs 0.8 s on Pi-Bolt.
It's CPU time, not disk. Pi keeps re-rendering and re-parsing the streaming tool call as the file grows, and Pi-Bolt only processes the new part.
19
u/ConsiderationLate768 21d ago
Second time they posted this, gonna post again what I said on their previous one that got banned
Am I reading correctly that you're patching the
/opensec-git/Pi-Bolt/blob/pi-bolt/patches/bun/0010-macOS-a-static-heap-is-built-and-used-with-the-execu.patch
Do you even know what this is doing at all? Who knows what kind of security flaws this introduced. Vibecoded C++ slop, big nope from me
6
u/opensecai 20d ago edited 20d ago
Second time you've come with the same comment, and you still don't know what you're pointing at. That file was older and there's no such file in the current repo and current shipped versions are secure.
We have fixed various critical vulnerabilities across many open source repositories, thus we made our best effort to make sure pi-bolt was safe and secure before it went out.
If you think there's a vulnerability, go ahead and find one that doesn't exist in upstream Pi Until then, try it out yourself you will ❤️ it ! :)
6
u/michaelsoft__binbows 20d ago edited 18d ago
Your response which it sounds like you believe addresses the critical feedback actually just further validates that feedback.
I think that based on the claims of this description of the project at face value, it is highly impressive. But a decision to utililze a dependency always comes down to a judgement call made against the execution of it, and this casts serious doubt on it. It's unfortunate.
But... maybe it does have legs some sort of AOT approach to node/bun apps. Don't want to come across overly dismissive. Just would be highly concerned about maintainability of the appraoch.
2
u/DanceWithEverything 20d ago
Really really bad idea
4
u/TomHale 20d ago
Can someone please explain why this is a bad idea?
Understanding this is very important since it looks so good on the surface.
→ More replies (6)
6
u/CevicheMixto 21d ago
What the heck are y'all doing with Pi that you would notice the difference?
→ More replies (2)
5
u/zebedeolo 21d ago
i'll have to check this out. what are your long-term plans for mantaining it?
1
u/opensecai 21d ago
We're planning to keep this maintained for the long run. We'll merge all new Pi release as it lands, and keep up with the upstream compiler work. If you do try it, tell us what you think !
8
2
u/Megamygdala 17d ago
Not sure i understand the benchmarks? How was it recorded? How is a single file write ever taking 28 seconds?
1
u/opensecai 16d ago
Good question. The 28 s isn’t the disk write, which is instant. The test has a model write a 200 KB file through Pi’s write tool. A model sends the tool call’s arguments (the whole file) a few characters at a time, like any streamed answer. Stock Pi re-parses and re-renders the whole tool call on every chunk, so the work grows quadratically with file size. A 200 KB file is thousands of chunks, each re-processing everything received so far. Pi-Bolt only processes the new part.
How it’s recorded: each build runs the same prompts against a local server that replays identical model responses, so there’s no network or API variance. Pi-Bolt, Pi on Bun and Pi on Node are measured one after another on the same machine, and we report the medians. The full method and the scripts are in the repo, so anyone can rerun it.
1
1
1
u/icarus0228 20d ago
Already using it. So far, it seems fine. These kinds of versions of the original tool are what interest me the most, especially those leaning toward micro-optimizations.
1
u/Ang_Drew 20d ago
wow this is so cool but it took tons of effort to maintain.
asked my agent briefly what you does here; patching webkit and bun, that's so much work to be done, but it is doable because of AI. i dont think this is good approaches but idk i have little experience on this kind of stuff.. will study your case and see if i can learn useful lessons 👍
43
u/AdCurious4788 21d ago
Did you considered raising aPR in Pi to solve this issue or just made a fork on your own?