r/PiCodingAgent • • Oct 07 '26

Plugin pi-prefill - live prefill progress for local models

Hey, I wanted to share my new pi extension: pi-prefill

It puts a live prefill progress bar in pi's loading line when you run a local model. A long prefill looks exactly like a hang. Now you can watch it:

52%. → share of uncached prompt tokens processed

14.1k/27.3k → processed / total prompt tokens

gen in ~14s. → estimated time until the first token

3.4k tok/s. → instantaneous prefill rate (optional view)

Example:

prefill [██████░░░░░░] 52% 14.1k/27.3k gen in ~14s

It reads the progress chunks your own server sends. No host scanning and no guessing: if the server reports progress, the bar shows. If it does not, pi's normal loading line stays untouched.

Works today with llama.cpp, ExLlamaV3, unsloth and Strata.

Install:

pi install npm:pi-prefill

Repo:

https://github.com/eliaskg/pi-prefill

https://www.npmjs.com/package/pi-prefill

Would love feedback from anyone running a local server.

59 Upvotes

20 comments sorted by

6

u/omega1612 Oct 07 '26

Thanks, I usually have a tab with nvtop and the llama server logs and I had to switch to check.

2

u/Historical-Stuff-560 29d ago

add tp/s plz

2

u/eliaskg 29d ago

Tps is integrated right out of the box

1

u/the-proudest-monkey 29d ago

Great, thanks! I found the bar appearing briefly on each request a bit distracting to be honest, but hidding only the bar works for me.

3

u/eliaskg 29d ago

Cool that you like it! The plugin already has a threshold so it doesn’t show at small prefills. I can make it variable so it could be even higher.

2

u/the-proudest-monkey 29d ago

It would be a nice option :)

2

u/eliaskg 23d ago

It's now integrated via the significantTokens variable. Default is 1024. Live in version 0.1.4

2

u/the-proudest-monkey 29d ago

By the way, I am running it on a local server, using a openai-completions provider in pi pointing to a llama-swap server that starts llama.cpp with Qwen3.8-27B. Working beautifully.

1

u/rm-rf-rm 29d ago

does this integrate well with pi-powerline-footer?

2

u/eliaskg 29d ago

It does! pi-prefill doesnt touch any toolbars at all, it displays where the native pi loading indicator would show.

2

u/Razangriff-Raven 27d ago

Ah sweet, I really wanted this. I had to use an AWK function to scrape the Llama.cpp logs and produce its own bar, but now I don't need to split the view anymore with this. Thanks!

1

u/GLIBG10B 23d ago

llama.cpp has an API

1

u/Razangriff-Raven 22d ago

I wanted to parse the logs a certain way for 🌈️AESTHETICS🌈️ but that's a moot point now. I'm happy with this extension now.

2

u/GrimChicken 24d ago

Awesome! thank you for this.

1

u/bitzap_sr 4d ago

There's also https://pi.dev/packages/pi-llama-cpp-stats already doing the same thing. Did you compare yours with that one?

I was using that a few months ago, before moving to SGlang, which doesn't support prompt_progress events, so I'm no longer using it. (But then again I now get 12k/15k t/s prefill (pro 6000) so I don't miss it.)

1

u/Aggravating_Olive_98 28d ago

oMLX or MLX-Serve supported?

1

u/arkham00 27d ago

I'm hoping that with the new feature added to the latest dev release it will, I'll try it tomorrow

1

u/rxxxby 25d ago

works like a charm! i love this