pi-llama-cpp-stats

Shows prompt processing progress from llama.cpp's SSE stream

Packages

Package details

extension

Install pi-llama-cpp-stats from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:pi-llama-cpp-stats
Package
pi-llama-cpp-stats
Version
0.1.11
Published
Oct 24, 2026
Downloads
1,935/mo · 367/wk
Author
cr4xy
License
unknown
Types
extension
Size
25.8 KB
Dependencies
0 dependencies · 0 peers
Pi manifest JSON
{
  "image": "https://cr4xy.dev/pi-llama-cpp-stats/preview.png",
  "extensions": [
    "./index.ts"
  ]
}

Security note

Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.

README

pi-llama-cpp-stats

Pi extension that shows real-time prompt processing statistics from llama.cpp's SSE stream.

Features

  • Replaces the "Working..." text with a live progress bar during prompt processing
  • Shows progress percentage, estimated time remaining, and tokens/second
  • Shows the same bar while the context is being compacted (/compact, auto-compaction, overflow recovery) and while /tree summarizes a branch, then a live count of the tokens the summary is generating

Example display:

Prefilling... ████████░░░░░░░░░░░░ 40% · 30s · 1234 tok/s

During compaction Pi's own "Compacting context..." spinner owns the status row, so the prefill bar appears above the editor instead. When prefill finishes the line switches to counting the tokens being generated:

Auto-compacting... (esc to cancel)                                  ← Pi's spinner
Prefilling... ████████░░░░░░░░░░░░ 40% · 30s · 1234 tok/s          ← above the editor
Generating... 1.2k tok                                             ← after prefill

The live token count is estimated from the stream (llama.cpp only reports usage on the final chunk) and matches the exact figure within about 1% on prose. It clears when compaction ends, succeeds, fails, or is cancelled.

It disappears once prefill finishes (the summary is then generating, which the bar cannot measure) and when compaction ends, succeeds, fails, or is cancelled.

Installation

pi install npm:pi-llama-cpp-stats

Or install locally for the current project:

pi install npm:pi-llama-cpp-stats -l

Usage

  1. Restart pi (or /reload)
  2. Start a chat with a llama.cpp model
  3. The "Working..." text will be replaced with a live progress bar during prefilling

Requirements

  • llama.cpp with OpenAI-compatible API
  • llama.cpp must be built with prompt_progress support (enabled by default in recent versions)