How zetaphor/pi-webui works
Pi Web UI provides browser access to a Pi coding-agent session. The main workflow runs from user input in the Lit client, through the WebSocket server and typed protocol, to the agent session; responses and session state stream back to the browser. The server also supports session history and model selection, including LiteLLM model discovery. The excerpts show key handlers and calls, while some feature details come from the README; links based only on that documentation are identified as such by their evidence path.
Main entry points: index.ts WebSocket server · main.ts Pi Web UI · protocol.ts WebSocket protocol
Components 10
Browser interface
- Pi Web UI
client/main.ts - Pi UI components
Realtime transport
- WebSocket protocol
shared/protocol.ts - WebSocket server
server/index.ts
Agent and models
- Pi agent session
server/index.ts - Session history
server/index.ts - Model catalog
server/index.ts
Other components
- User
- LiteLLM service
- System tools
Connections 11
- User → Pi Web UI: uses
README.md - Pi Web UI → Pi UI components: renders with
client/main.ts - Pi Web UI → WebSocket protocol: uses types
client/main.ts - WebSocket server → WebSocket protocol: uses types
server/index.ts - Pi Web UI → WebSocket server: sends WebSocket messages
README.md - WebSocket server → Pi Web UI: streams events and state
README.md - WebSocket server → Pi agent session: creates and controls
server/index.ts - WebSocket server → Session history: lists and loads
server/index.ts - WebSocket server → Model catalog: fetches and merges
server/index.ts - Model catalog → LiteLLM service: fetches models
server/index.ts - Pi agent session → System tools: uses tools
README.md