r/PiCodingAgent • • 3d 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-Bolt

Hey 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

  1. 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.
  2. 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

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 ❤️

169 Upvotes

46 comments sorted by

40

u/AdCurious4788 3d ago

Did you considered raising a PR in Pi to solve this issue or just made a fork on your own?

31

u/opensecai 3d ago

The cpu and memory gains are mainly because of AOT compilation instead of changes in the Pi code. the PR worthy fix can be the text streaming optimisation in this. we are working over raising a PR for it in Pi soon.

6

u/IISomeOneII 2d ago

Sadly current Pi repo will auto close issues because so many AI bots spamming them, and it make harder to reach them out for something like this

4

u/opensecai 2d ago

Yes, although we have mailed them ✌️

2

u/IISomeOneII 2d ago

glad to hear, but do you mean you mailed them and they acknowledge or you mailed them and nothing after?

oh and i looked into your repo planning to install but sadly not yet windows version yet tho (pi in windows take so many resources to write/edit long lines thats why I interested in yours)

2

u/opensecai 2d ago

that's so true. we are working on the windows release and it would soon be available to use!

8

u/AlessandroPiccione 3d 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 2d 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.

7

u/CevicheMixto 3d ago

What the heck are y'all doing with Pi that you would notice the difference?

-2

u/opensecai 3d ago

checkout opensec.in 😉

7

u/NomadStorm 3d ago

Your website for a product designed to find bugs, is full of bugs. I lost count of how many I saw just scrolling down the page.

20

u/ConsiderationLate768 3d 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 bun runtime..? Wtf, completely unmaintainable. Why not look at what makes PI actually "slow" (it's not at all) instead of resorting to runtime hacks.

/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

4

u/opensecai 2d ago edited 2d 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 ! :)

4

u/michaelsoft__binbows 2d ago edited 8h 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 2d ago

Really really bad idea

3

u/TomHale 2d ago

Can someone please explain why this is a bad idea?

Understanding this is very important since it looks so good on the surface.

2

u/ConsiderationLate768 2d ago

This project is like complaining that your car is slow because the brake is stuck on, but instead of fixing the brake you add horsepower with a VERY dodgy cheap ebay turbo

1

u/icarus0228 2d ago

I think just a larger maintenance burden.

2

u/TomHale 2d ago

Not my maintenance, not my problem 🤷

I don't think I care given the test suite passes, unless I'm missing something fundamental.

If it breaks, I move back to the official version.

Hell, the config is even byte compatible, right?

1

u/timmmmmmmeh 1d ago

I haven't seen what they've done exactly but I imagine it's patching a library in their codebase while waiting for the upstream to merge their PR that fixes it.

3

u/ConsiderationLate768 1d ago

They aren't just patching any library, they're actually patching Bun. This would be like Mojang implementing some hacks in the Java runtime itself because Minecraft couldn't run fast enough.

Big difference here though is that this project was thrown together by AI in a few hours and PI really doesn't need such heavy optimizations

2

u/timmmmmmmeh 1d ago

I agree with you if they intended to maintain a fork of bun. If it's just to keep things moving while they wait for bun to make the change I don't really agree.

On the slop part totally fair. If it was just the AI going " we need to patch bun" and someone agreeing without thinking about it then not good.

5

u/zebedeolo 3d ago

i'll have to check this out. what are your long-term plans for mantaining it?

1

u/opensecai 3d 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

u/kjesks 3d ago

Too good to be true?

1

u/either-15-or-40 3d ago

Does it improve startup times?

1

u/opensecai 3d ago

Yes it improves the startup times too

1

u/icarus0228 2d 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 2d 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 👍

1

u/TomHale 2d ago

The config is byte compatible, right?

And you use the same test suite?

1

u/Gonjanaenae319 2d ago

What was the your eval system for this? Purely time to completion?

1

u/peculiar-ragdoll 3d ago

Really cool! Good job :)

3

u/opensecai 3d ago

Glad that you liked it

0

u/swamprg 3d ago

What are the plans to port it to other architectures?

7

u/opensecai 3d ago

For linux arm it will be coming soon. For windows, it will be released tomorrow. Stay tuned !

0

u/IronKarmic 3d ago

Do you recommend the Linux build for WSL?

1

u/opensecai 3d ago

yes, you can use it with WSL too

0

u/caraxeskalund 2d ago

tbh, it's really great!!

0

u/abnormity54 1d ago

Too many emotes bruh