pi-llm-rounds0.1.0
Visualize pi's agent loop: live turn counter, per-LLM-call separators with tokens/duration/tools, run summaries, and /llm-stats.
Untested on omp
This is a pi package. No one has reported whether it works on omp yet. If you try it, add your result below.
Reports 0
No reports yet.
Readme
pi-llm-rounds
Visualize pi's agent loop in the terminal: which LLM call is streaming, how many API calls one message triggered, and a separator line between rounds.
你:帮我看看这个目录
🔄 LLM 调用 #1(消息 #1 的 agent loop) ← live, while streaming
(模型回复 + 工具调用)
──── LLM 第 1 轮 · 3.4s · ↑1.5k ↓300 tok · 2 工具 ────────────
(模型带着工具结果再回复)
──── LLM 第 2 轮 · 1.2s · ↑2.1k ↓120 tok · 0 工具 ────────────
==== 消息 #1 完成 · 共 2 次 LLM 调用 · 2 工具 · 6.1s ════════
pi's agent loop, made visible:
- One user message → one agent run (
agent_start…agent_end) - Each LLM API call inside the run → one turn (
turn_start/turn_end)
Install
pi install npm:pi-llm-rounds
# or from git
pi install git:github.com/nilpo/pi-llm-rounds
What you get
- Live indicator — while streaming, the working loader shows
🔄 LLM 调用 #N; the status bar showsR1·T2(run 1, turn 2), then✓ 消息 #1: 2 次 LLM 调用. - Turn separators — after every LLM call, a dim rule line in the transcript with duration, input/output tokens, and tool-call count. Expand tool output (Ctrl+X) to also see model name and cache-read tokens.
- Run summary — a
====line after each run: total LLM calls, tools, wall time. Directly answers "how many API calls did this message trigger?" /llm-stats— session totals (runs, calls, tools, tokens), rebuilt from the session branch so it stays correct after resume or branch switches.
Markers are stored as custom session entries: they render in the transcript and persist across restarts, but are never sent to the LLM — zero context pollution.
Notes
- Automatic retries / post-compaction reruns start a new run and are counted honestly.
- Subagents (pi-subagents) run in their own sessions; their turns are marked in their own session files.
Uninstall
pi remove npm:pi-llm-rounds